Пример #1
0
 def setUpClass(cls) -> None:
     if is_debug:
         cls.ctx = get_debug_test_context()
     else:
         if is_standalone:
             cls.ctx = get_standalone_context()
         else:
             cls.ctx = get_cluster_context()
     set_default_option('include_key', False)
     set_default_option('total_partitions', total_partitions)
Пример #2
0
def get_cluster_context(role, options: dict = None, props_file=default_props_file, party_id=None):
    if options is None:
        options = {}
    rp_context = rpta.get_cluster_context(options=options)

    rs_options = get_option(role, props_file)

    if party_id:
        rs_options['self_party_id'] = str(party_id)
    rs_context = RollSiteContext(roll_site_session_id, rp_ctx=rp_context,
                                 options=rs_options)

    return rs_context
Пример #3
0
def get_cluster_context(role,
                        options: dict = None,
                        props_file=default_props_file,
                        party_id=None,
                        roll_site_session_id=None):
    if options is None:
        options = {}
    options['session_id'] = '_'.join([roll_site_session_id, role, party_id])
    print("session_id: ", options['session_id'])

    options[CoreConfKeys.STATIC_CONF_PATH] = props_file
    rp_context = rpta.get_cluster_context(options=options)

    rs_options = get_option(role, self_party_id=party_id, conf_file=props_file)

    rs_context = RollSiteContext(roll_site_session_id,
                                 rp_ctx=rp_context,
                                 options=rs_options)

    return rs_context
Пример #4
0
 def setUpClass(cls) -> None:
     opts = {"eggroll.session.processors.per.node": "3"}
     #opts = {}
     cls.ctx = get_cluster_context(options=opts)
Пример #5
0
 def setUp(self):
     self.ctx = get_cluster_context()