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

add simple queue control example to python docs #967

Merged

Conversation

vsoch
Copy link
Contributor

@vsoch vsoch commented Jul 10, 2023

Problem: a developer user might want to (after submission) retrieve and list jobs.
Solution: provide a simple example of doing this.

What type of PR is this?

/kind documentation

What this PR does / why we need it:

A developer user might want to submit and monitor jobs, and this presents very simple monitoring. However, I'm wondering how this would scale? E.g., would hundreds of users be expected to be on the user-queue, in which case we'd have to (every time) get a complete listing of many jobs and iterate through? Or how would we do something like get jobs associated with a queue (I'm guessing this would be done via the label selector, which I mention at the end, but is that the only way?)

I started on an executor plugin for Snakemake using Kueue this weekend https://github.com/snakemake/snakemake-executor-kueue/ and these questions are real ones that I have :)

Which issue(s) this PR fixes:

The issue is now closed, but my plan is to do the following PRs:

  • Flux Operator (PR is in)
  • MPI Operator (example is written but I'm debugging some issues)
  • Final PR to consolidate redundancy (e.g., we should not have script and embedded markdown examples)

Does this PR introduce a user-facing change?

None

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 10, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @vsoch. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 6d9dda9
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/64b02b63756e36000840cf11
😎 Deploy Preview https://deploy-preview-967--kubernetes-sigs-kueue.netlify.app/docs/tasks/run_python_jobs
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 10, 2023
@alculquicondor
Copy link
Contributor

alculquicondor commented Jul 11, 2023

FYI @mimowo is looking into #168, which sounds related to what you have been experimenting.

Other than that, as discussed offline, we would like to have some CLI (like a kubectl plugin) that would allow users to obtain some basic information about their jobs.

I'm hesitant to include too many python scripts as "tutorials" for things that we should provide via built-in mechanisms (either the CLI #487 or a dashboard #940 )

@vsoch
Copy link
Contributor Author

vsoch commented Jul 11, 2023

Other than that, as discussed offline, we would like to have some CLI (like a kubectl plugin) that would allow users to obtain some basic information about their jobs.

Agree!

I'm hesitant to include too many python scripts as "tutorials" for things that we should provide via built-in mechanisms (either the CLI #487 or a dashboard #940 )

But perhaps with the include snippets it's not too much? We would only have a simple example, and then one for each operator. I do think this is an important use case for a developer. I needed to figure this out for the snakemake executor that uses kueue. If we have it, developers can easily have a handle to kueue in their workflow tools. If we don't, we add toil that they have to figure it out first. TLDR: getting the information explicitly isn't the goal, which would be satisfied by a plugin or dashboard. The use case is integration into Python based workflow tools (there are a lot).

@alculquicondor
Copy link
Contributor

alculquicondor commented Jul 12, 2023

Ah, I see where you are coming from.

I'll defer to @moficodes to review, with the mindset of keeping the samples as simple as possible

@alculquicondor
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2023
@moficodes
Copy link
Contributor

I think if we move the code sample to samples folder it should be fine.

+1 for the kubectl plugin for getting info about kueue. @vsoch happy to pair with you on that. (been looking to explore kubectl plugins).

Please rebase and move the example to /site/static/examples/python

Problem: a developer user might want to (after submission) retrieve and list
jobs.
Solution: provide a simple example of doing this.

Signed-off-by: vsoch <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 12, 2023
@vsoch
Copy link
Contributor Author

vsoch commented Jul 12, 2023

All set! I also removed the hard-coded version from the install script. If someone doesn't provide it, they will install from the main branch.

@moficodes
Copy link
Contributor

I think something is wrong.

(Could be my PR that messed it up)

https://deploy-preview-967--kubernetes-sigs-kueue.netlify.app/docs/tasks/run_python_jobs/#install-kueue

We should have install-kueue-queues.py in include here right?

For this section https://deploy-preview-967--kubernetes-sigs-kueue.netlify.app/docs/tasks/run_python_jobs/#interact-with-queues-and-jobs is there a sample-queue-control.py? Because include has install-kueue-queues.py again.

@vsoch
Copy link
Contributor Author

vsoch commented Jul 12, 2023

oh yeah - looks like you switched the labels (or just forgot to change one) - not a problem! I'll fix it here.

After running the example above, you can test the following example to interact
with the results. Write the following to a script called `sample-queue-control.py`.

{{% include "python/install-kueue-queues.py" "python" %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be sample-queue-control.py?

Is there a file called sample-queue-control.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep - it got lost in the (now several) rebases but thankfully I had it in another place!

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 13, 2023
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 13, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: moficodes, vsoch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit f5bbb05 into kubernetes-sigs:main Jul 13, 2023
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants