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

feat: add kill run endpoint #9061

Merged
merged 22 commits into from
Apr 22, 2024
Merged

feat: add kill run endpoint #9061

merged 22 commits into from
Apr 22, 2024

Conversation

AmanuelAaron
Copy link
Contributor

@AmanuelAaron AmanuelAaron commented Mar 27, 2024

Description

Adding KillRuns endpoint to Run API for FlatRuns table

Test Plan

e2e tests should pass

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

ET-92

@cla-bot cla-bot bot added the cla-signed label Mar 27, 2024
Copy link

netlify bot commented Mar 27, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 7b3f172
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6626801e03fc7e00082eae27
😎 Deploy Preview https://deploy-preview-9061--determined-ui.netlify.app
📱 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.

@AmanuelAaron AmanuelAaron changed the title add kill run api feat: add kill run endpoint Apr 1, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 11.40351% with 101 lines in your changes are missing coverage. Please review.

Project coverage is 44.72%. Comparing base (e7d870e) to head (7b3f172).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9061      +/-   ##
==========================================
- Coverage   44.75%   44.72%   -0.03%     
==========================================
  Files        1266     1266              
  Lines      154656   154770     +114     
  Branches     2439     2439              
==========================================
+ Hits        69213    69225      +12     
- Misses      85211    85313     +102     
  Partials      232      232              
Flag Coverage Δ
backend 41.57% <0.00%> (-0.07%) ⬇️
harness 64.14% <32.50%> (-0.04%) ⬇️
web 35.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
harness/determined/common/api/bindings.py 40.06% <32.50%> (-0.03%) ⬇️
master/internal/api_runs.go 64.18% <0.00%> (-17.28%) ⬇️

... and 1 file with indirect coverage changes

@AmanuelAaron AmanuelAaron marked this pull request as ready for review April 1, 2024 17:06
@AmanuelAaron AmanuelAaron requested a review from a team as a code owner April 1, 2024 17:06
@AmanuelAaron AmanuelAaron requested a review from stoksc April 8, 2024 19:09
Copy link
Contributor

@stoksc stoksc left a comment

Choose a reason for hiding this comment

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

i have some feedback and i think it applies to other prs too. let me know if you want to meet to discuss it.

master/internal/api_runs.go Outdated Show resolved Hide resolved
master/internal/api_runs.go Show resolved Hide resolved
Copy link
Contributor

@stoksc stoksc left a comment

Choose a reason for hiding this comment

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

lgtm besides style feedback and the test i think is likely broken, but i do have one sweeping concern that the requirements for all these endpoints are too harsh and that some minor simplifications would make them twice as simple.

Comment on lines 20 to 27
resp = bindings.get_SearchRuns(
test_session,
limit=1,
filter="""{"filterGroup":{"children":[{"columnName":"id","kind":"field",
"location":"LOCATION_TYPE_RUN","operator":"=","type":"COLUMN_TYPE_NUMBER","value":"""
+ str(run_id)
+ """}],"conjunction":"and","kind":"group"},"showArchived":false}""",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

we really need a simple "GET /runs/:id". can you at least make a ticket for it, if it doesn't exist?

e2e_tests/tests/run/test_api.py Outdated Show resolved Hide resolved
e2e_tests/tests/run/test_api.py Outdated Show resolved Hide resolved
e2e_tests/tests/run/test_api.py Outdated Show resolved Hide resolved
master/internal/api_runs.go Outdated Show resolved Hide resolved
master/internal/api_runs.go Outdated Show resolved Hide resolved
master/internal/api_runs.go Show resolved Hide resolved
master/internal/api_runs.go Outdated Show resolved Hide resolved
master/internal/api_runs.go Show resolved Hide resolved
Id: runID,
})
if err != nil {
results = append(results, &apiv1.RunActionResult{
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess after really sinking into this PR, i've realized this "wanting a result back for everything" really complicates it. how do we plan to use this result? how necessary is it?

because I was thinking, why are we not just doing base select with runs, filtering for killable runs by adding a WHERE state in (...terminal states) and request_id IS NOT NULL, then passing those all to kill trial. at that point, if there are any errors we can pass them back to the user? that seems sufficient and twice as simple?

Copy link
Contributor 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 responses were structured in the Experiment equivalent functions (PauseExperiments, DeleteExperiments, etc...) I believe as well that Frontend expects this behaviour.

Co-authored-by: Bradley Laney <bradley.laney@hpe.com>
Copy link
Contributor

@stoksc stoksc left a comment

Choose a reason for hiding this comment

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

lgtm

@AmanuelAaron AmanuelAaron merged commit 1b212ae into main Apr 22, 2024
83 of 96 checks passed
@AmanuelAaron AmanuelAaron deleted the kill-run branch April 22, 2024 16:02
JComins000 pushed a commit that referenced this pull request Apr 22, 2024
Co-authored-by: Bradley Laney <bradley.laney@hpe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants