Esempio n. 1
0
if len(sys.argv) > 2:
    key_num = int(sys.argv[2])
if len(sys.argv) > 3:
    max_workers = int(sys.argv[3])
if len(sys.argv) > 4:
    sequence_exec = sys.argv[4] == '0'

num_requests = 100 * max_workers

f_elb = 'a8576b08f54cb4c0ebefb5f79a448438-342174087.us-east-1.elb.amazonaws.com'
my_ip = '34.204.195.6'

cloudburst_client = CloudburstConnection(f_elb, my_ip, tid=0, local=False)

if chosen_test == 'clean':
    all_func = cloudburst_client.list()
    for f in all_func:
        suc, err = cloudburst_client.delete_dag(f)

        print(f'Delete {f} {suc}')
    exit(0)


def write_casual_test(cloudburst, size, key_num):
    exe_id = cloudburst.getid()
    new_v = np.random.random(size)
    result = serializer.dump_lattice(new_v, MultiKeyCausalLattice)

    keys = ['v' + str(i) for i in range(key_num)]
    start = time.time()
Esempio n. 2
0

def map_fn(self, row: Row) -> int:
    return row["a"] + row["b"]


def filter_fn(self, row: Row) -> bool:
    return row["sum"] % 2 == 0


cloudburst = CloudburstConnection(
    "a7b4fb6f87473467c86de15406e6a094-2079112079.us-east-1.elb.amazonaws.com",
    "34.239.175.232",
)

cloudburst.list()

import random
import string
salt = "".join(random.choices(string.ascii_letters, k=6))

print("Running sanity check")
cloud_sq = cloudburst.register(lambda _, x: x * x, "square-2"+salt)
print(cloud_sq(2).get())
cloudburst.delete_dag("dag")
cloudburst.register_dag("dag", ["square-2"+salt], [])
print(cloudburst.call_dag("dag", {"square-2"+salt: [2]}).get())

# 1 / 0
print("Running example flow")
dataflow = Flow("example-flow"+salt, FlowType.PUSH, cloudburst)