Example #1
0
        node_imagelist = {}
        node_imagelist[1] = []
        node_imagelist[2] = []




        nodes_available = {2: True}
        max_concurrency = 4


        for each_node in nodeid_map:
            if (each_node == nodeid):
                continue
            client = lib.FileClient('localhost:' + nodeid_map[each_node], nodeid)
            node_client[each_node] = client

        images_filepath = '/home/vm1/Desktop/ODM/grpc_stages/node1'  #file path of current node images
        file_path = images_filepath + '/'
        opensfm_config = opensfm_interface.setup_opensfm_config(file_path)
        active_number_of_nodes = 2
        photos_name = collections.defaultdict(lambda : "None")
        photo_list =  os.listdir(os.path.join(images_filepath, 'images'))
        print(photo_list)

        image_sent_nodes = collections.defaultdict(lambda : 'none')

        cluster_size = len(photo_list) / active_number_of_nodes # images per node
        distance_overlap = 10 # meters overlap of images
import os

import lib

if __name__ == '__main__':
    client = lib.FileClient('localhost:8888')

    # demo for file uploading
    in_file_name = '/tmp/large_file_in'
    client.upload(in_file_name)

    # demo for file downloading:
    out_file_name = '/tmp/large_file_out'
    if os.path.exists(out_file_name):
        os.remove(out_file_name)
    client.download('whatever_name', out_file_name)
    os.system(f'sha1sum {in_file_name}')
    os.system(f'sha1sum {out_file_name}')
Example #3
0
        #nodes_available = {2: True}
        max_concurrency = 4
	node_imagelist = {}
	node_imagelist[1] = []
	node_imagelist[2] = []
	node_imagelist[3] = []
	node_imagelist[4] = []

	
        for each_node in nodeid_map:
            if (each_node == nodeid):
                continue
	    #fe80::ba6c:4e2:b8cc:a62b]
            #client = lib.FileClient('localhost:' + nodeid_map[each_node], nodeid)
	    if (each_node == 2):
	    	client = lib.FileClient('10.10.10.3:' + nodeid_map[each_node], nodeid)
	    if (each_node == 3):
	    	client = lib.FileClient('10.10.10.4:' + nodeid_map[each_node], nodeid)
	    if (each_node == 4):
	    	client = lib.FileClient('10.10.10.5:' + nodeid_map[each_node], nodeid)
            node_client[each_node] = client

        images_filepath = '/home/vm1/Desktop/ODM/grpc_stages/node1'  #file path of current node images
        file_path = images_filepath + '/'
        opensfm_config = opensfm_interface.setup_opensfm_config(file_path)
        active_number_of_nodes = 2
        photos_name = collections.defaultdict(lambda : "None")
        photo_list =  os.listdir(os.path.join(images_filepath, 'images'))
        #print(photo_list)

        image_sent_nodes = collections.defaultdict(lambda : 'none')
import lib
import yaml

if __name__ == '__main__':

    with open("config.yml", 'r') as ymlfile:
        cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)

    server = cfg['client']['server_ip'] + ':' + str(
        cfg['client']['server_port'])
    client = lib.FileClient(server)

    # demo for file uploading
    in_file_name = cfg['client']['input_file']
    client.upload(in_file_name)
Example #5
0
import os
import lib

import time
import grpc

import demo_pb2_grpc
import demo_pb2

__all__ = [
    'simple_method', 'client_streaming_method', 'server_streaming_method',
    'bidirectional_streaming_method'
]

SERVER_ADDRESS = "localhost:23333"
client = lib.FileClient('localhost:23333')
CLIENT_ID = 2

def simple_method(stub):
    #Uploading file
    in_file_name = 'C:\Users\usuario\Documents\Dev\gRPC-Python\data_transmission\uploading\file.parquet'
    client.upload(in_file_name)

    #Downloading file
    out_file_name = 'C:\Users\usuario\Documents\Dev\gRPC-Python\data_transmission\downloading\file.parquet'
    if os.path.exists(out_file_name):
       os.remove(out_file_name)
    client.download('whatever_name', out_file_name)
    os.system(f'sha1sum {in_file_name}')
    os.system(f'sha1sum {out_file_name}')
Example #6
0
import os
import lib

if __name__ == '__main__':
    client = lib.FileClient('191.252.204.57:1000')

    # demo for file uploading
    #in_file_name = 'C:/teste/file2.parquet'
    #print("FAZENDO UPLOADING DO ARQUIVO PARQUET")
    #client.upload(in_file_name)

    #demo for file downloading:
    out_file_name = 'D:/teste/baixado/file.txt'
    if os.path.exists(out_file_name):
        os.remove(out_file_name)

    print(client)
    client.download('file.txt', out_file_name)
    #os.system(f'sha1sum {in_file_name}')
    #os.system(out_file_name)
    print("ARQUIVO BAIXADO NA PASTA :", out_file_name)