import com.sun.jini.start.NonActivatableServiceDescriptor; import com.sun.jini.start.ServiceDescriptor; import com.sun.jini.start.SharedActivatableServiceDescriptor; import com.sun.jini.start.SharedActivationGroupDescriptor; import com.mathworks.toolbox.distcomp.mjs.service.ConfigUtil; import com.mathworks.toolbox.distcomp.control.PortConfig; /* Copyright 2004-2017 The MathWorks, Inc. */ com.sun.jini.start { // To use this config file you MUST override the input value for the following // variables when you create the configuration file. // // serviceName // lookupHosts // cleanCheckpointInfo // preserveJobs // useGDSStorage serviceType = "jobmanager"; /* log, config, and jar directory definitions */ private static logPrefix = ConfigUtil.concat( "${com.mathworks.toolbox.distcomp.checkpointdir}${/}${com.mathworks.toolbox.distcomp.hostname}_", serviceName); private static configDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}config${/}"; private static jarDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jar"; private static resourcesDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jar${/}resources"; private static jarExtDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext"; private static axis2Dir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}axis2"; private static ccClientDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}webservices${/}cloud_console"; private static gdsClientDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}webservices${/}gds_jobs_client"; private static urlmanagerDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}webservices${/}urlmanager"; private static wsClientCoreDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}webservices${/}ws_client_core"; private static toolboxJarDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jar${/}toolbox"; private static parallelJarDir = "${com.mathworks.toolbox.distcomp.matlabroot}${/}java${/}jar${/}toolbox${/}parallel"; private static distcompJarextDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}distcomp"; private static jiniJarDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}..${/}..${/}java${/}jarext${/}distcomp${/}jini2${/}lib"; act_sys_host = "${com.mathworks.toolbox.distcomp.hostname}"; act_sys_port = PortConfig.getPhoenixPort("${com.mathworks.toolbox.distcomp.base_port}"); persistenceDirectory = ConfigUtil.concat(logPrefix, ConfigUtil.getServicePostfix(serviceType)); checkpointDirectory = "${com.mathworks.toolbox.distcomp.checkpointdir}"; logDirectory = "${com.mathworks.toolbox.distcomp.logdir}"; databaseDirectoryOverride = "${com.mathworks.toolbox.distcomp.database_directory_override}"; databaseDirectory = ConfigUtil.ifThenElse( /*if*/ ConfigUtil.isEmpty(databaseDirectoryOverride), /*then*/ ConfigUtil.concat(new String[] { "${com.mathworks.toolbox.distcomp.checkpointdir}${/}", serviceName, "_jobmanager_storage"}), /*else*/ databaseDirectoryOverride); matlabroot = "${com.mathworks.toolbox.distcomp.matlabroot}"; // If we are preserving jobs, or using GDS for job manager storage then // we should ensure that running tasks are cancelled, because in both cases // jobs have a longer lifetime than the workers that would be running their // tasks. cancelRunningTasks = Boolean.toString( ConfigUtil.or(Boolean.parseBoolean(preserveJobs), Boolean.parseBoolean(useGDSStorage))); // // Shared Group Environment // private static sharedVM_classpath = ConfigUtil.path(new String[]{ ConfigUtil.fullfile(jiniJarDir, "sharedvm.jar"), ConfigUtil.fullfile(jiniJarDir, "phoenix.jar"), ConfigUtil.fullfile(parallelJarDir, "util.jar"), ConfigUtil.fullfile(parallelJarDir, "pctutil.jar"), ConfigUtil.fullfile(toolboxJarDir, "distcomp.jar"), ConfigUtil.fullfile(jiniJarDir, "jini-ext.jar"), ConfigUtil.fullfile(jiniJarDir, "reggie.jar"), ConfigUtil.fullfile(jiniJarDir, "destroy.jar"), ConfigUtil.fullfile(distcompJarextDir, "h2.jar"), ConfigUtil.fullfile(jarDir, "jmi.jar"), // Needed for MatlabMCR by CloudCenterResizeService ConfigUtil.fullfile(jarDir, "mvm.jar"), // Needed for MatlabMCR by CloudCenterResizeService ConfigUtil.fullfile(jarDir, "services.jar"), // Needed for MatlabMCR by CloudCenterResizeService ConfigUtil.fullfile(jarDir, "beans.jar"), ConfigUtil.fullfile(jarDir, "util.jar"), ConfigUtil.fullfile(jarDir, "instutil.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarExtDir, "commons-cli.jar"), // Needed for the resize service ConfigUtil.fullfile(jarExtDir, "commons-lang.jar"), ConfigUtil.fullfile(jarExtDir, "commons-io.jar"), ConfigUtil.fullfile(ccClientDir, "cloud-console-client.jar"), // Needed for the resize service ConfigUtil.fullfile(gdsClientDir, "gds-jobs-client.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(urlmanagerDir, "urlmanager.jar"), // Needed for the resize service ConfigUtil.fullfile(wsClientCoreDir, "mw-service-client-core.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(axis2Dir, "commons-httpclient.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarExtDir, "commons-logging.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarExtDir, "commons-codec.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarDir, "mlwebservices.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarDir, "webproxy.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarDir, "net.jar"), // Needed for GDS cloud storage ConfigUtil.fullfile(jarDir, "foundation_libraries.jar"), //Needed for I18n ConfigUtil.fullfile(jarDir, "resource_core.jar"), //Needed for I18n ConfigUtil.fullfile(resourcesDir, "parallel_res.jar"), //Needed for I18n ConfigUtil.fullfile(distcompJarextDir, "h2mig_pagestore_addon.jar"), //Needed for h2 database upgrade "${com.mathworks.toolbox.distcomp.additionalClasspath}" }); private static sharedVM_policy = ConfigUtil.fullfile(configDir,"jsk-all.policy"); sharedVM_log = ConfigUtil.concat(logPrefix, ConfigUtil.getServiceSharedVMPostfix(serviceType)); private static sharedVM_command = "${com.mathworks.toolbox.distcomp.jrecmd}"; private static jvmStartupFlags = ConfigUtil.concat( ConfigUtil.getJVMStartupFlags("${com.mathworks.toolbox.distcomp.jreflags}"), ConfigUtil.getJVMDebugProperties("${com.mathworks.toolbox.distcomp.debug_jobmanager_port}") ); // -Xrs: Reduces usage of operating-system signals by the Java virtual machine (JVM) // -Xmx: Specify the maximum size, in bytes, of the memory allocation pool. private static extraJVMFlags = new String[]{"-Xrs", "-Xmx${com.mathworks.toolbox.distcomp.job_manager_maximum_memory}","-XX:ParallelGCThreads=6"}; private static sharedVM_options = ConfigUtil.concat(jvmStartupFlags, extraJVMFlags); private static sharedVM_properties = new String[]{ "com.mathworks.toolbox.distcomp.toolboxroot", "${com.mathworks.toolbox.distcomp.toolboxroot}", "com.mathworks.toolbox.distcomp.membergroups", "${com.mathworks.toolbox.distcomp.membergroups}", "com.mathworks.toolbox.distcomp.servicename", serviceName, "com.mathworks.toolbox.distcomp.hostname", "${com.mathworks.toolbox.distcomp.hostname}", "com.mathworks.toolbox.distcomp.base_port", "${com.mathworks.toolbox.distcomp.base_port}", "com.mathworks.toolbox.distcomp.lookup_hosts", lookupHosts, "com.mathworks.toolbox.distcomp.checkpointdir", "${com.mathworks.toolbox.distcomp.checkpointdir}", "com.mathworks.toolbox.distcomp.clean_checkpoint_info", cleanCheckpointInfo, "com.mathworks.toolbox.distcomp.logdir", "${com.mathworks.toolbox.distcomp.logdir}", "com.mathworks.toolbox.distcomp.persistenceDir", persistenceDirectory, "com.mathworks.toolbox.distcomp.databaseDir", databaseDirectory, "com.mathworks.toolbox.distcomp.cancel_running_tasks", cancelRunningTasks, "com.mathworks.toolbox.distcomp.use_GDS_storage", useGDSStorage, "com.mathworks.toolbox.distcomp.GDS_end_point", GDSEndPoint, "com.mathworks.toolbox.distcomp.GDS_login_token", GDSLoginToken, "com.mathworks.toolbox.distcomp.GDS_queue_id", GDSQueueID, "com.mathworks.toolbox.distcomp.use_MSMPI", useMSMPI, "com.mathworks.toolbox.distcomp.maxJobManagerHeapMemory", "${com.mathworks.toolbox.distcomp.job_manager_maximum_memory}", "com.mathworks.toolbox.distcomp.loglevel", "${com.mathworks.toolbox.distcomp.loglevel}", "com.mathworks.toolbox.distcomp.matlabroot", "${com.mathworks.toolbox.distcomp.matlabroot}", "com.mathworks.toolbox.distcomp.securityLevel", "${com.mathworks.toolbox.distcomp.securityLevel}", "com.mathworks.toolbox.distcomp.securityDir", "${com.mathworks.toolbox.distcomp.securityDir}", "com.mathworks.toolbox.distcomp.mjs.auth.mdceAllowGlobalPasswordlessLogon","${com.mathworks.toolbox.distcomp.mjs.auth.mdceAllowGlobalPasswordlessLogon}", "com.mathworks.toolbox.distcomp.mjs.auth.allowClientPasswordCache", "${com.mathworks.toolbox.distcomp.mjs.auth.allowClientPasswordCache}", "com.mathworks.toolbox.distcomp.mjs.auth.adminUser", "${com.mathworks.toolbox.distcomp.mjs.auth.adminUser}", "com.mathworks.toolbox.distcomp.mjs.auth.allowedUsers", "${com.mathworks.toolbox.distcomp.mjs.auth.allowedUsers}", "com.mathworks.toolbox.distcomp.mjs.jobmanager.serializedPublicKey", "${com.mathworks.toolbox.distcomp.mjs.jobmanager.serializedPublicKey}", "com.mathworks.toolbox.distcomp.rmi.useSecureCommunication", "${com.mathworks.toolbox.distcomp.rmi.useSecureCommunication}", "com.mathworks.toolbox.distcomp.requireWebLicensing", "${com.mathworks.toolbox.distcomp.requireWebLicensing}", "com.mathworks.toolbox.distcomp.rmi.requireClientCertificate", "${com.mathworks.toolbox.distcomp.rmi.requireClientCertificate}", "com.mathworks.toolbox.distcomp.rmi.secureDataTransfer", "true", "com.mathworks.toolbox.distcomp.mjs.security.keystorePath", "${com.mathworks.toolbox.distcomp.mjs.security.keystorePath}", "com.mathworks.toolbox.distcomp.mjs.security.defaultKeystorePath", "${com.mathworks.toolbox.distcomp.mjs.security.defaultKeystorePath}", "com.mathworks.toolbox.distcomp.mjs.security.keystorePassword", "${com.mathworks.toolbox.distcomp.mjs.security.keystorePassword}", "com.mathworks.toolbox.distcomp.rmi.useServerSpecifiedHostname", "true", "com.mathworks.toolbox.distcomp.allServerSocketsInCluster", "${com.mathworks.toolbox.distcomp.allServerSocketsInCluster}", "com.mathworks.toolbox.distcomp.duplexPeerRmiEnabled", "${com.mathworks.toolbox.distcomp.duplexPeerRmiEnabled}", "com.mathworks.toolbox.distcomp.pmode.keepAlivePeriod", "${com.mathworks.toolbox.distcomp.pmode.keepAlivePeriod}", "com.mathworks.toolbox.distcomp.pmode.keepAliveTimeUnit", "${com.mathworks.toolbox.distcomp.pmode.keepAliveTimeUnit}", "com.mathworks.toolbox.distcomp.workerProxiesPoolConnections", "${com.mathworks.toolbox.distcomp.workerProxiesPoolConnections}", "com.mathworks.toolbox.distcomp.sendActivityNotifications", "${com.mathworks.toolbox.distcomp.sendActivityNotifications}", "com.mathworks.toolbox.distcomp.scriptRoot", "${com.mathworks.toolbox.distcomp.scriptRoot}", "com.mathworks.toolbox.distcomp.wait_on_num_workers", waitOnNumWorkers, "com.mathworks.toolbox.distcomp.allowResizing", allowResizing, "com.mathworks.toolbox.distcomp.mjs.cloud_center_token", cloudCenterToken, "com.mathworks.toolbox.distcomp.mjs.cluster_id", clusterID, "java.security.manager", "com.mathworks.toolbox.distcomp.util.AllowAllSecurityManager", "java.library.path", "${com.mathworks.toolbox.distcomp.library_path}", "java.rmi.server.hostname", "${com.mathworks.toolbox.distcomp.hostname}", "java.security.egd", "file:/dev/urandom", "java.rmi.server.useCodebaseOnly", "true", "sun.net.inetaddr.ttl", "${com.mathworks.toolbox.distcomp.DNS_lookupInterval}", "sun.rmi.transport.connectionTimeout", "${com.mathworks.toolbox.distcomp.RMI_connectionTimeout}", "sun.rmi.transport.tcp.readTimeout", "${com.mathworks.toolbox.distcomp.RMI_readTimeout}", "sun.rmi.dgc.client.gcInterval", "${com.mathworks.toolbox.distcomp.jobmanager_gcInterval}"}; private static sharedVM = new SharedActivationGroupDescriptor( sharedVM_policy, sharedVM_classpath, sharedVM_log, sharedVM_command, sharedVM_options, sharedVM_properties, act_sys_host, act_sys_port); // // Job Manager // private static jobmanager_codebase = ""; private static jobmanager_policy = ConfigUtil.fullfile(configDir,"jsk-all.policy"); private static jobmanager_classpath = ConfigUtil.path(new String[]{ ConfigUtil.fullfile(jiniJarDir, "phoenix.jar"), ConfigUtil.fullfile(jiniJarDir, "reggie.jar"), ConfigUtil.fullfile(jiniJarDir, "destroy.jar"), ConfigUtil.fullfile(jarDir, "beans.jar"), ConfigUtil.fullfile(jarDir, "util.jar") }); private static jobmanager_impl = "com.mathworks.toolbox.distcomp.mjs.jobmanager.JobManagerImpl"; private static jobmanager_config = ConfigUtil.fullfile(configDir,"jobmanager.config"); // - The h2.check properties change some internal database settings which // otherwise cause sporadic failures when inserting a job (freeCount) as // seen in BaT. These properties may be removed in the future when // updating H2 database to a newer version (> 1.0.78). See geck 491052. // - The settings for lobFiles cause lob files (large objects files) to be // put into dedicated directories with limited number of files therein. // Surplus files and directories will be put into sub-directories (for // which the same limit applies). This avoids checkpoint dirs with huge // numbers of files in any directory. private static jobmanager_service = new SharedActivatableServiceDescriptor( jobmanager_codebase, jobmanager_policy, jobmanager_classpath, jobmanager_impl, sharedVM_log, new String[]{ jobmanager_config, "h2.check", "false", "h2.check2", "false", "h2.lobFilesInDirectories", "true", "h2.lobFilesPerDirectory", "256" }, true, act_sys_host, act_sys_port); private static discovery_codebase = ""; private static discovery_policy = ConfigUtil.fullfile(configDir,"jsk-all.policy"); private static discovery_classpath = ""; private static discovery_impl = "com.mathworks.toolbox.distcomp.mjs.discovery.DiscoveryImpl"; private static discovery_config = ConfigUtil.fullfile(configDir,"discovery.config"); private static discovery_service = new SharedActivatableServiceDescriptor( discovery_codebase, discovery_policy, discovery_classpath, discovery_impl, sharedVM_log, new String[]{ discovery_config }, true, act_sys_host, act_sys_port); // The CloudCenterResizeService is used by MATLAB Parallel Cloud to communicate with // Cloud Center to dynamically resize the cluster. It is optionally started below // based on the -startResizeService flag to startjobmanager. private static resize_codebase = ""; private static resize_policy = ConfigUtil.fullfile(configDir, "jsk-all.policy"); private static resize_classpath = ""; private static resize_impl = "com.mathworks.toolbox.distcomp.mjs.resize.CloudCenterResizeService"; private static resize_config = ConfigUtil.fullfile(configDir, "resize.config"); private static resize_service = new SharedActivatableServiceDescriptor( resize_codebase, resize_policy, resize_classpath, resize_impl, sharedVM_log, new String[] { resize_config }, true, act_sys_host, act_sys_port); // // Services to start -- used by ServiceStarter.main() // startResizeService = "${com.mathworks.toolbox.distcomp.mjs.start_resize_service}"; static serviceDescriptors = (ServiceDescriptor[])ConfigUtil.ifThenElse( /*if*/ Boolean.parseBoolean(startResizeService), /*then*/ new ServiceDescriptor[] { sharedVM, jobmanager_service, discovery_service, resize_service }, /*else*/ new ServiceDescriptor[] { sharedVM, jobmanager_service, discovery_service }); // // Shared Group // private static shared_group_codebase = ""; private static shared_group_policy = ConfigUtil.fullfile(configDir, "jsk-all.policy"); private static shared_group_classpath = ConfigUtil.fullfile(jiniJarDir, "group.jar"); private static shared_group_config = ConfigUtil.fullfile(configDir, "group.config"); private static shared_group_impl = "com.sun.jini.start.SharedGroupImpl"; private static shared_group_service = new SharedActivatableServiceDescriptor( shared_group_codebase, shared_group_policy, shared_group_classpath, shared_group_impl, sharedVM_log, // Same as above new String[] { shared_group_config }, false, act_sys_host, act_sys_port); // // Groups to destroy -- used by DestroySharedGroup.main() // static serviceDestructors = new ServiceDescriptor[] { shared_group_service }; }