예제 #1
0
def get_standalone_context(role,
                           self_party_id,
                           props_file=default_props_file,
                           roll_site_session_id=None):
    options = {}
    options[
        SessionConfKeys.CONFKEY_SESSION_DEPLOY_MODE] = DeployModes.STANDALONE
    options[CoreConfKeys.STATIC_CONF_PATH] = props_file
    os.environ["EGGROLL_RESOURCE_MANAGER_AUTO_BOOTSTRAP"] = "1"

    rp_context = rpta.get_standalone_context(options=options)

    rs_options = get_option(role,
                            self_party_id,
                            props_file,
                            deploy_mode=DeployModes.STANDALONE)
    options.update(rs_options)
    rs_context = RollSiteContext(roll_site_session_id,
                                 rp_ctx=rp_context,
                                 options=get_option(
                                     role,
                                     self_party_id,
                                     props_file,
                                     deploy_mode=DeployModes.STANDALONE))

    return rs_context
예제 #2
0
 def setUp(self) -> None:
     self.init_job()
     self.rpc = get_standalone_context()
     self.rsc_guest = get_debug_rs_context(self.rpc, self.job_id,
                                           guest_options)
     self.rsc_host = get_debug_rs_context(self.rpc, self.job_id,
                                          host_options)
     self.rptc = RptContext(self.rpc)
예제 #3
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)
예제 #4
0
def get_standalone_context(role, props_file=default_props_file):
    rp_context = rpta.get_standalone_context()
    rs_context = RollSiteContext(roll_site_session_id, rp_ctx=rp_context,
                                 options=get_option(role, props_file))

    return rs_context
예제 #5
0
 def setUpClass(cls) -> None:
     cls.ctx = get_standalone_context()