def init_class(cls, job_supervisor): cls.cfg = pkconfig.init( agent_starting_secs=( cls._AGENT_STARTING_SECS_DEFAULT + 3, int, 'how long to wait for agent start', ), constrain_resources=(True, bool, 'apply --cpus and --memory constraints'), dev_volumes=(pkconfig.channel_in('dev'), bool, 'mount ~/.pyenv, ~/.local and ~/src for development'), hosts=pkconfig.RequiredUnlessDev(tuple(), tuple, 'execution hosts'), idle_check_secs=pkconfig.ReplacedBy( 'sirepo.job_driver.idle_check_secs'), image=('radiasoft/sirepo', str, 'docker image to run all jobs'), parallel=dict( cores=(2, int, 'cores per parallel job'), gigabytes=(1, int, 'gigabytes per parallel job'), slots_per_host=(1, int, 'parallel slots per node'), ), sequential=dict( gigabytes=(1, int, 'gigabytes per sequential job'), slots_per_host=(1, int, 'sequential slots per node'), ), supervisor_uri=job.DEFAULT_SUPERVISOR_URI_DECL, tls_dir=pkconfig.RequiredUnlessDev( None, _cfg_tls_dir, 'directory containing host certs'), ) if not cls.cfg.tls_dir or not cls.cfg.hosts: cls._init_dev_hosts() cls._init_hosts(job_supervisor) return cls
continue s = r.models.simulation if s.simulationId == ignore_sim_id: continue res.append('{}{}{}'.format( s.folder, '' if s.folder == '/' else '/', s.name, )) return res def _source_cache_key(): if cfg.enable_source_cache_key: return '?{}'.format(simulation_db.app_version()) return '' def static_dir(dir_name): return str(simulation_db.STATIC_FOLDER.join(dir_name)) cfg = pkconfig.init( enable_source_cache_key=( True, bool, 'enable source cache key, disable to allow local file edits in Chrome' ), db_dir=pkconfig.ReplacedBy('sirepo.srdb.root'), google_tag_manager_id=(None, str, 'enable google analytics with this id'), )
continue s = r.models.simulation if s.simulationId == ignore_sim_id: continue res.append('{}{}{}'.format( s.folder, '' if s.folder == '/' else '/', s.name, )) return res def _source_cache_key(): if cfg.enable_source_cache_key: return '?{}'.format(simulation_db.app_version()) return '' def static_dir(dir_name): return str(simulation_db.STATIC_FOLDER.join(dir_name)) cfg = pkconfig.init( enable_source_cache_key=( True, bool, 'enable source cache key, disable to allow local file edits in Chrome' ), db_dir=pkconfig.ReplacedBy('sirepo.srdb.root'), job_queue=pkconfig.ReplacedBy('sirepo.runner.job_class'), )