Skip to content

Commit

Permalink
fix(run-launcher): using id instead job_run_id && job_definition_id (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclimse authored Jan 14, 2024
1 parent b1ee03a commit 3d68d47
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dagster_scaleway/serverless_job_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _create_or_update_job_definition(
continue

job_def = api.update_job_definition(
id=job_def.id,
job_definition_id=job_def.id,
name=job_def_name,
image_uri=docker_image,
environment_variables=job_def_env,
Expand Down Expand Up @@ -195,7 +195,7 @@ def _launch_serverless_job_with_command(
client, run, docker_image, command
)

job_run = api.start_job_definition(id=job_def.id)
job_run = api.start_job_definition(job_definition_id=job_def.id)

self._instance.report_engine_event(
message=f"Started job definition {job_def.name} with run id {job_run.id} for Dagster run {run.run_id}",
Expand Down Expand Up @@ -257,7 +257,7 @@ def _get_scaleway_job_run_from_dagster_run(self, run) -> Optional[scw.JobRun]:
api = scw.JobsV1Alpha1API(client)

try:
return api.get_job_run(id=job_run_id)
return api.get_job_run(job_run_id=job_run_id)
except scaleway.ScalewayException:
return None

Expand Down Expand Up @@ -291,7 +291,7 @@ def terminate(self, run_id):
client = self._get_client(serverless_job_context)
api = scw.JobsV1Alpha1API(client)

api.stop_job_run(id=job_run.id)
api.stop_job_run(job_run_id=job_run.id)

return True

Expand Down

0 comments on commit 3d68d47

Please sign in to comment.