determined-ai / determined

Determined is an open-source machine learning platform that simplifies distributed training, hyperparameter tuning, experiment tracking, and resource management. Works with PyTorch and TensorFlow.
https://determined.ai
Apache License 2.0
3k stars 350 forks source link

fix: do not modify cached GetAgentsResponse #9569

Closed kkunapuli closed 3 months ago

kkunapuli commented 3 months ago

Ticket

RM-350

Description

The Kubernetes resource manager caches the response to a GetAgents request. Return a deep copy of the cached response to prevent unintentionally modifying the cached response.

Test Plan

Checklist

netlify[bot] commented 3 months ago

Deploy Preview for determined-ui ready!

Name Link
Latest commit f00443354f0d9edaaa98962ee39753e8253d6eb5
Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/667b2969969c2b0008a44ec1
Deploy Preview https://deploy-preview-9569--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.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 49.80%. Comparing base (f1aa1b4) to head (f004433). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9569 +/- ## ========================================== - Coverage 49.80% 49.80% -0.01% ========================================== Files 1247 1247 Lines 162241 162249 +8 Branches 2888 2887 -1 ========================================== + Hits 80803 80806 +3 - Misses 81266 81271 +5 Partials 172 172 ``` | [Flag](https://app.codecov.io/gh/determined-ai/determined/pull/9569/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/determined-ai/determined/pull/9569/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai) | `43.89% <70.00%> (-0.01%)` | :arrow_down: | | [harness](https://app.codecov.io/gh/determined-ai/determined/pull/9569/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai) | `63.74% <ø> (ø)` | | | [web](https://app.codecov.io/gh/determined-ai/determined/pull/9569/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai) | `46.16% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/determined-ai/determined/pull/9569?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai) | Coverage Δ | | |---|---|---| | [master/internal/rm/kubernetesrm/jobs.go](https://app.codecov.io/gh/determined-ai/determined/pull/9569?src=pr&el=tree&filepath=master%2Finternal%2Frm%2Fkubernetesrm%2Fjobs.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai#diff-bWFzdGVyL2ludGVybmFsL3JtL2t1YmVybmV0ZXNybS9qb2JzLmdv) | `69.66% <100.00%> (-0.09%)` | :arrow_down: | | [...nal/rm/kubernetesrm/kubernetes\_resource\_manager.go](https://app.codecov.io/gh/determined-ai/determined/pull/9569?src=pr&el=tree&filepath=master%2Finternal%2Frm%2Fkubernetesrm%2Fkubernetes_resource_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai#diff-bWFzdGVyL2ludGVybmFsL3JtL2t1YmVybmV0ZXNybS9rdWJlcm5ldGVzX3Jlc291cmNlX21hbmFnZXIuZ28=) | `30.81% <0.00%> (ø)` | | | [master/internal/rm/resource\_manager\_iface.go](https://app.codecov.io/gh/determined-ai/determined/pull/9569?src=pr&el=tree&filepath=master%2Finternal%2Frm%2Fresource_manager_iface.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai#diff-bWFzdGVyL2ludGVybmFsL3JtL3Jlc291cmNlX21hbmFnZXJfaWZhY2UuZ28=) | `77.77% <75.00%> (-22.23%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/determined-ai/determined/pull/9569/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=determined-ai)