Build a client given specific destination parameters and job_id.
437846
def get_client(self, destination_params, job_id, **kwargs):
        """"""
        destination_params = _parse_destination_params(destination_params)
        destination_params.update(**kwargs)
        job_manager_interface_class = self.job_manager_interface_class
        job_manager_interface_args = dict(destination_params=destination_params, **self.job_manager_interface_args)
        job_manager_interface = job_manager_interface_class(**job_manager_interface_args)
        return self.client_class(destination_params, job_id, job_manager_interface, **self.extra_client_kwds)
1230931
def build_job_scripts(root_dir, jobs):
    
    # Loop over the job list, creating each job script in turn, and then adding
    # scriptPath to the Job object
    for job in jobs:
        scriptpath = os.path.join(root_dir, "jobs", job.name)
        with open(scriptpath, "w") as scriptfile:
            scriptfile.write("#!/bin/sh\n#$ -S /bin/bash\n%s\n" % job.script)
        job.scriptpath = scriptpath
1264798
def build(id=None, name=None, revision=None,
          temporary_build=False, timestamp_alignment=False,
          no_build_dependencies=False,
          keep_pod_on_failure=False,
          force_rebuild=False,
          rebuild_mode=common.REBUILD_MODES_DEFAULT):
    
    data = build_raw(id, name, revision, temporary_build, timestamp_alignment, no_build_dependencies,
              keep_pod_on_failure, force_rebuild, rebuild_mode)
    if data:
        return utils.format_json(data)
1335667
@Override
    public JobParameters buildIdentifyingJobParameters(Snapshot snapshot) {
        Map<String, JobParameter> map = createIdentifyingJobParameters(snapshot);
        JobParameters params = new JobParameters(map);
        return params;
    }
451126
def _build_job_meta(cls, job_dir):
        
        meta_file = os.path.join(job_dir, JOB_META_FILE)
        meta = parse_json(meta_file)

        if not meta:
            job_name = job_dir.split("/")[-1]
            user = os.environ.get("USER", None)
            meta = {
                "job_id": job_name,
                "job_name": job_name,
                "user": user,
                "type": "ray",
                "start_time": os.path.getctime(job_dir),
                "end_time": None,
                "best_trial_id": None,
            }

        if meta.get("start_time", None):
            meta["start_time"] = timestamp2date(meta["start_time"])

        return meta
573446
def build(context, provider, **kwargs):  # pylint: disable=unused-argument
    """"""
    session = get_session(provider.region)
    options = kwargs.get('options', {})
    context_dict = {}
    context_dict['artifact_key_prefix'] = "%s-%s-" % (options['namespace'], options['name'])  # noqa
    default_param_name = "%shash" % context_dict['artifact_key_prefix']

    if options.get('build_output'):
        build_output = os.path.join(
            options['path'],
            options['build_output']
        )
    else:
        build_output = options['path']

    context_dict['artifact_bucket_name'] = RxrefLookup.handle(
        kwargs.get('artifact_bucket_rxref_lookup'),
        provider=provider,
        context=context
    )

    if options.get('pre_build_steps'):
        run_commands(options['pre_build_steps'], options['path'])

    context_dict['hash'] = get_hash_of_files(
        root_path=options['path'],
        directories=options.get('source_hashing', {}).get('directories')
    )

    # Now determine if the current staticsite has already been deployed
    if options.get('source_hashing', {}).get('enabled', True):
        context_dict['hash_tracking_parameter'] = options.get(
            'source_hashing', {}).get('parameter', default_param_name)

        ssm_client = session.client('ssm')

        try:
            old_parameter_value = ssm_client.get_parameter(
                Name=context_dict['hash_tracking_parameter']
            )['Parameter']['Value']
        except ssm_client.exceptions.ParameterNotFound:
            old_parameter_value = None
    else:
        context_dict['hash_tracking_disabled'] = True
        old_parameter_value = None

    context_dict['current_archive_filename'] = (
        context_dict['artifact_key_prefix'] + context_dict['hash'] + '.zip'
    )
    if old_parameter_value:
        context_dict['old_archive_filename'] = (
            context_dict['artifact_key_prefix'] + old_parameter_value + '.zip'
        )

    if old_parameter_value == context_dict['hash']:
        LOGGER.info("staticsite: skipping build; app hash %s already deployed "
                    "in this environment",
                    context_dict['hash'])
        context_dict['deploy_is_current'] = True
        return context_dict

    if does_s3_object_exist(context_dict['artifact_bucket_name'],
                            context_dict['current_archive_filename'],
                            session):
        context_dict['app_directory'] = download_and_extract_to_mkdtemp(
            context_dict['artifact_bucket_name'],
            context_dict['current_archive_filename'], session
        )
    else:
        if options.get('build_steps'):
            LOGGER.info('staticsite: executing build commands')
            run_commands(options['build_steps'], options['path'])
        zip_and_upload(build_output, context_dict['artifact_bucket_name'],
                       context_dict['current_archive_filename'], session)
        context_dict['app_directory'] = build_output

    context_dict['deploy_is_current'] = False
    return context_dict
990658
function (jobName, customParams, callback) {
      [jobName, customParams, callback] = doArgs(arguments, ['string', ['object', {}], 'function']);

      doRequest({
        urlPattern: [LAST_BUILD, jobName]
      }, customParams, callback);
    }
1179660
def get_job(project_id, job_id, opts = {})
      data, _status_code, _headers = get_job_with_http_info(project_id, job_id, opts)
      return data
    end
1259487
def init_client(client_id):
    
    if client_id not in drivers:
        drivers[client_id] = init_driver(client_id)
    return drivers[client_id]
214684
def run_job(args):
  """"""
  jm = setup(args)
  job_id = int(os.environ['JOB_ID'])
  array_id = int(os.environ['SGE_TASK_ID']) if os.environ['SGE_TASK_ID'] != 'undefined' else None
  jm.run_job(job_id, array_id)
1155946
def make_client(ip, port, authkey):
    
    QueueManager.register('get_job_q')
    QueueManager.register('get_result_q')
    QueueManager.register('get_function')
    QueueManager.register('q_closed')

    manager = QueueManager(address=(ip, port), authkey=authkey)
    manager.connect()
    return manager
450766
function all_builds(jobName, param, customParams, callback) {

      // TODO better name and handle the "param" ???
      var _doArgs17 = doArgs(arguments, ['string', ['string', 'id,timestamp,result,duration'], ['object', {}], 'function']);

      var _doArgs18 = _slicedToArray(_doArgs17, 4);

      jobName = _doArgs18[0];
      param = _doArgs18[1];
      customParams = _doArgs18[2];
      callback = _doArgs18[3];
      doRequest({
        urlPattern: [ALL_BUILDS, jobName, param],
        bodyProp: 'allBuilds'
      }, customParams, callback);
    }
675642
def build_from_job_list(scheme_files, templates, base_output_dir):
    """"""
    queue = Queue()
    for scheme in scheme_files:
        queue.put(scheme)

    if len(scheme_files) < 40:
        thread_num = len(scheme_files)
    else:
        thread_num = 40

    threads = []
    for _ in range(thread_num):
        thread = Thread(target=build_single_worker,
                        args=(queue, templates, base_output_dir))
        thread.start()
        threads.append(thread)

    queue.join()

    for _ in range(thread_num):
        queue.put(None)

    for thread in threads:
        thread.join()
1186306
def create_or_update_job(job, opts = {})
      data, _status_code, _headers = create_or_update_job_with_http_info(job, opts)
      return data
    end
417441
function build_info(jobName, buildNumber, customParams, callback) {
      var _doArgs15 = doArgs(arguments, ['string', 'string|number', ['object', {}], 'function']);

      var _doArgs16 = _slicedToArray(_doArgs15, 4);

      jobName = _doArgs16[0];
      buildNumber = _doArgs16[1];
      customParams = _doArgs16[2];
      callback = _doArgs16[3];


      doRequest({
        urlPattern: [BUILD_INFO, jobName, buildNumber]
      }, customParams, callback);
    }
419007
function (jobName, param, customParams, callback) {
      [jobName, param, customParams, callback] = doArgs(arguments, ['string', ['string', 'id,timestamp,result,duration'], ['object', {}], 'function']);

      // TODO better name and handle the "param" ???
      doRequest({
        urlPattern: [ALL_BUILDS, jobName, param],
        bodyProp: 'allBuilds'
      }, customParams, callback);
    }
1371891
def _construct_from_json(self, rec):
        

        self.delete()

        for required_key in ['dagobah_id', 'created_jobs']:
            setattr(self, required_key, rec[required_key])

        for job_json in rec.get('jobs', []):
            self._add_job_from_spec(job_json)

        self.commit(cascade=True)