Skip to content

Commit

Permalink
Fix job name in test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvelich committed Jan 9, 2024
1 parent 1c4a011 commit cee5ddf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sdk/python/test/e2e/test_e2e_pytorchjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@ def test_sdk_e2e_with_gang_scheduling(job_namespace):

unschedulable_pytorchjob = generate_pytorchjob(
job_namespace,
JOB_NAME,
master,
worker,
KubeflowOrgV1SchedulingPolicy(min_available=10),
)
schedulable_pytorchjob = generate_pytorchjob(
job_namespace, master, worker, KubeflowOrgV1SchedulingPolicy(min_available=2)
job_namespace,
JOB_NAME,
master,
worker,
KubeflowOrgV1SchedulingPolicy(min_available=2),
)

TRAINING_CLIENT.create_job(job=unschedulable_pytorchjob, namespace=job_namespace)
Expand Down Expand Up @@ -145,7 +150,7 @@ def test_sdk_e2e(job_namespace):
),
)

pytorchjob = generate_pytorchjob(job_namespace, master, worker)
pytorchjob = generate_pytorchjob(job_namespace, JOB_NAME, master, worker)

TRAINING_CLIENT.create_job(job=pytorchjob, namespace=job_namespace)
logging.info(f"List of created {TRAINING_CLIENT.job_kind}s")
Expand Down Expand Up @@ -205,14 +210,15 @@ def train_func():

def generate_pytorchjob(
job_namespace: str,
job_name: str,
master: KubeflowOrgV1ReplicaSpec,
worker: KubeflowOrgV1ReplicaSpec,
scheduling_policy: Optional[KubeflowOrgV1SchedulingPolicy] = None,
) -> KubeflowOrgV1PyTorchJob:
return KubeflowOrgV1PyTorchJob(
api_version=constants.API_VERSION,
kind=constants.PYTORCHJOB_KIND,
metadata=V1ObjectMeta(name=JOB_NAME, namespace=job_namespace),
metadata=V1ObjectMeta(name=job_name, namespace=job_namespace),
spec=KubeflowOrgV1PyTorchJobSpec(
run_policy=KubeflowOrgV1RunPolicy(
clean_pod_policy="None",
Expand Down

0 comments on commit cee5ddf

Please sign in to comment.