コード例 #1
0
def stop_job(project_name, project_uuid, job_name, job_uuid, specification):
    spawner = JobSpawner(project_name=project_name,
                         project_uuid=project_uuid,
                         job_name=job_name,
                         job_uuid=job_uuid,
                         spec=specification,
                         k8s_config=settings.K8S_CONFIG,
                         namespace=settings.K8S_NAMESPACE,
                         in_cluster=True)

    spawner.stop_job()
コード例 #2
0
def stop_job(job, update_status=False):
    spawner = JobSpawner(project_name=job.project.unique_name,
                         project_uuid=job.project.uuid.hex,
                         job_name=job.unique_name,
                         job_uuid=job.uuid.hex,
                         spec=job.specification,
                         k8s_config=settings.K8S_CONFIG,
                         namespace=settings.K8S_NAMESPACE,
                         in_cluster=True)

    spawner.stop_job()
    if update_status:
        # Update experiment status to show that its stopped
        job.set_status(status=JobLifeCycle.STOPPED, message='Job was stopped')
コード例 #3
0
def stop_job(project_name, project_uuid, job_name, job_uuid):
    spawner = JobSpawner(project_name=project_name,
                         project_uuid=project_uuid,
                         job_name=job_name,
                         job_uuid=job_uuid,
                         k8s_config=conf.get(K8S_CONFIG),
                         namespace=conf.get(K8S_NAMESPACE),
                         in_cluster=True)

    return spawner.stop_job()
コード例 #4
0
def stop_job(project_name, project_uuid, job_name, job_uuid):
    spawner = JobSpawner(project_name=project_name,
                         project_uuid=project_uuid,
                         job_name=job_name,
                         job_uuid=job_uuid,
                         k8s_config=settings.K8S_CONFIG,
                         namespace=settings.K8S_NAMESPACE,
                         spec=None,
                         in_cluster=True)

    return spawner.stop_job()