determined icon indicating copy to clipboard operation
determined copied to clipboard

chore: option to use cli populated determined session

Open hamidzr opened this issue 9 months ago • 3 comments

Ticket

Description

often times the first barrier to interacting with det in a quick way when developing or debugging is preparing the session object. the cli already does this and gives users various options to configure the process. the goal here is to allow devs to reuse that here in a semi stable and detached way without having to rely on the py sdk

add an option to execute a python script utilizing a cli configured determined session provider a global session

#!/usr/bin/env python3

import determined.common.api.bindings as b

jobs = b.get_GetJobs(cli_session).jobs
for job in jobs:
    print(job)

det dev execute myscript.py

Test Plan

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.

hamidzr avatar May 02 '24 05:05 hamidzr

Deploy Preview for determined-ui canceled.

Name Link
Latest commit 160c36cfc82b1dddd6b6bab07a0abf5097cf2336
Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66332584cd49550008370abc

netlify[bot] avatar May 02 '24 05:05 netlify[bot]

Codecov Report

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

Project coverage is 44.58%. Comparing base (a9c8700) to head (160c36c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9288      +/-   ##
==========================================
- Coverage   44.58%   44.58%   -0.01%     
==========================================
  Files        1275     1275              
  Lines      156214   156222       +8     
  Branches     2451     2450       -1     
==========================================
- Hits        69655    69651       -4     
- Misses      86319    86331      +12     
  Partials      240      240              
Flag Coverage Δ
backend 41.75% <ø> (-0.01%) :arrow_down:
harness 64.08% <12.50%> (-0.02%) :arrow_down:
web 35.00% <ø> (ø)

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

Files Coverage Δ
harness/determined/cli/dev.py 47.34% <12.50%> (-1.55%) :arrow_down:

... and 2 files with indirect coverage changes

codecov[bot] avatar May 02 '24 05:05 codecov[bot]

todo: check

authentication.login_with_cache and authentication.login both return Sessions now.

hamidzr avatar May 02 '24 16:05 hamidzr

considering the new auth changes maybe this is not as helpful anymore. I'll close it for now

hamidzr avatar Jul 11 '24 15:07 hamidzr