Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always pull Docker image #6

Merged
Prev Previous commit
Next Next commit
Update results even when job failed/canceled
nolan1999 committed Mar 20, 2024
commit 6457124d2813fe3e49043fa07355a85bdfbf0cad
12 changes: 5 additions & 7 deletions cli/main.py
Original file line number Diff line number Diff line change
@@ -126,12 +126,6 @@
pinger_run.start()
pinger_run.stop()
res = container.wait()
if res["StatusCode"] != 0:
logs = container.logs()
api_job.ping(
status="error", exit_code=res["StatusCode"], body=f"Logs:\n{str(logs)}"
)
continue

# upload result
pinger_post = status.pinger.ParallelPinger(
@@ -145,7 +139,11 @@
[p.push() for p in p_upload if p.is_file()]
pinger_post.stop()

api_job.ping(status="finished", exit_code=0, body="")
if res["StatusCode"] == 0:
api_job.ping(status="finished", exit_code=0, body="")
else:
logs = f"Logs:\n{str(logs)}"
api_job.ping(status="error", exit_code=res["StatusCode"], body=logs)

except HTTPException as e:
if e.status_code == 404: