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

Adding Armada Job Submission Code #43

Merged
merged 29 commits into from
Nov 1, 2022

Conversation

Sharpz7
Copy link
Collaborator

@Sharpz7 Sharpz7 commented Sep 9, 2022

Closes #39
Closes #50
Closes #41
Closes #45

@Sharpz7 Sharpz7 marked this pull request as draft September 9, 2022 16:54
@Sharpz7 Sharpz7 self-assigned this Sep 9, 2022
@Sharpz7 Sharpz7 marked this pull request as ready for review September 19, 2022 11:27
@kannon92
Copy link
Contributor

Should we close this?

@Sharpz7 Sharpz7 changed the title Added initial changes to get it functional for demo Adding Armada Job Submission Code Sep 28, 2022
Copy link

@ClifHouck ClifHouck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to my other review comments, I think we need unit test(s) exercising all the new code/behavior in def submit.

armada_jupyter/__main__.py Outdated Show resolved Hide resolved
armada_jupyter/__main__.py Outdated Show resolved Hide resolved
armada_jupyter/__main__.py Outdated Show resolved Hide resolved
armada_jupyter/__main__.py Outdated Show resolved Hide resolved
Copy link

@ClifHouck ClifHouck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs more testing of new code in submit().

Added note in code
@Sharpz7 Sharpz7 marked this pull request as draft September 30, 2022 13:41
@Sharpz7
Copy link
Collaborator Author

Sharpz7 commented Sep 30, 2022

Moving to draft as I am going to add the issues into this one that will be needed for the MVP, as they will require significant testing.

#50
#41

armada_jupyter/armada.py Outdated Show resolved Hide resolved
@Sharpz7 Sharpz7 marked this pull request as ready for review October 7, 2022 17:02
tests/unit/test_submit.py Outdated Show resolved Hide resolved
armada_jupyter/armada.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Sharpz7 and others added 3 commits October 14, 2022 17:34
Co-authored-by: Kevin Hannon <[email protected]>
Co-authored-by: Kevin Hannon <[email protected]>
kannon92
kannon92 previously approved these changes Oct 14, 2022
Copy link

@ClifHouck ClifHouck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments.

typer.echo(f"Submitted Job {job_id} to Armada")

# Sleep to make sure that job-set-id is created
time.sleep(3)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to do this? Sleeping is a pretty brittle way to wait for something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how the API was designed - to the best of my knowlegde working with the python client over summer there is no other option

Copy link
Contributor

@kannon92 kannon92 Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @Sharpz7. This is a problem we found with the Armada API and their focus on being "eventually consistent".

If we this proves to be brittle, we could add an environment variable for this sleep behavior or remove the logic around checking if pod is ready.

As I write this, we may want to relax this. Since Armada is a queueing solution, you could actually have days/weeks before your job starts running. Right now we assume that it takes 3 seconds for your job to be queued and running but this is an invalid assumption.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change how this operates. All this should do, IMO, is report whether the job is submitted successfully. Beyond that its up to the user to check on the status of their jobs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd want more discussion with GR internally before I make that kind of call.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, this sleep is waiting until the event stream becomes active, not for the job to start running - I think those are independent. Therefore, this sleep time is pretty consistently under 3 seconds?

Maybe polling is acceptable in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done what I said above, with three "tries" to connect to the event stream, 1s between each try. Regardless of the job states, the job should generally always be created within this time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I write this, we may want to relax this. Since Armada is a queueing solution, you could actually have days/weeks before >your job starts running. Right now we assume that it takes 3 seconds for your job to be queued and running but this is an >invalid assumption.

Based on this I am going to add a config option to toggle whether the user wants to use the event stream to wait or not

armada_jupyter/podspec.py Outdated Show resolved Hide resolved
docs/dev/cancel.py Outdated Show resolved Hide resolved
docs/quickstart.md Outdated Show resolved Hide resolved
docs/quickstart.md Outdated Show resolved Hide resolved
armada_jupyter/armada.py Outdated Show resolved Hide resolved
@Sharpz7
Copy link
Collaborator Author

Sharpz7 commented Oct 26, 2022

Going to split this PR into a docs PR and a code PR

@Sharpz7 Sharpz7 requested a review from kannon92 October 31, 2022 01:02
Copy link

@suprjinx suprjinx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@ClifHouck ClifHouck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sharpz7 Sharpz7 merged commit f801728 into armadaproject:main Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants