-
Notifications
You must be signed in to change notification settings - Fork 67
Project restructure to make it easier to implement more backends #32
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
Conversation
23281bc to
76fe3e0
Compare
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 46.52% 47.57% +1.04%
==========================================
Files 17 26 +9
Lines 2764 2825 +61
==========================================
+ Hits 1286 1344 +58
- Misses 1478 1481 +3
Continue to review full report at Codecov.
|
|
@ajslone , I've tested Thank you! |
ajslone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This re-org should make the structure of the project clearer.
| # ---------------------------------------------------------------------------- | ||
| def _get_caip_job_api() -> Any: | ||
| return discovery.build('ml', 'v1', cache_discovery=False).projects().jobs() | ||
| def _get_caip_job_api(credentials_path: Optional[str] = None) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition here.
| import caliban.util as u | ||
| import caliban.docker.build as b | ||
| import caliban.history.cli | ||
| import caliban.platform.cloud.core as cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely like the platform.xxx structure better here.
| # credentials. | ||
| credentials = gcloud_auth_credentials() | ||
|
|
||
| credentials = ua.gcloud_credentials(credentials_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleaner, nice
This PR refactors:
caliban.configintocaliban.configandcaliban.config.experimentcaliban.utilbecomescaliban.utilandcaliban.util.{argparse, auth, fs, tqdm}caliban.cloud.*becomescaliban.platform.cloud.*caliban.dockerbecomescaliban.docker.{build, push}andcaliban.platform.{run, shell, notebook}The tests are also split accordingly.
I snuck in ONE bugfix that appeared during testing. I moved our method of generating credentials from
gcloud auth loginover tocaliban.util.authso that I could reuse it in the caliban history API. We had one spot where we were callingdiscovery.buildand NOT passing any credentials, which threw an error when the user didn't haveGOOGLE_APPLICATION_CREDENTIALSspecified.I also removed unused imports and sorted imports wherever I could.
Why?
The project needed it; specifically this is going to make it easier to increase test coverage, and to get the
.calibanconfig.jsoncode working with a proper schema, so that we can start to add options there.I really want to make the platforms pluggable, and sorting them out into separate modules is the first step.