-
Notifications
You must be signed in to change notification settings - Fork 467
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
Misc code repository improvements #3306
Open
schustmi
wants to merge
8
commits into
develop
Choose a base branch
from
feature/misc-code-repo
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8e154c6
Allow updating code repository using the CLI
schustmi e94deb5
Increase logging verbosity on non-import related code repo exceptions
schustmi 302b8bd
Some fixes and logs
schustmi de59cb7
Misc improvements
schustmi 5fd0775
Merge branch 'develop' into feature/misc-code-repo
schustmi b048e54
Merge branch 'develop' into feature/misc-code-repo
schustmi d76ee26
Docs improvements and rename some attributes for clarity
schustmi cc16953
Remove url mention
schustmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -48,11 +48,13 @@ Afterward, you can register a GitHub code repository by running the following CL | |||||
|
||||||
```shell | ||||||
zenml code-repository register <NAME> --type=github \ | ||||||
--url=<GITHUB_URL> --owner=<OWNER> --repository=<REPOSITORY> \ | ||||||
--owner=<OWNER> --repository=<REPOSITORY> \ | ||||||
--token=<GITHUB_TOKEN> | ||||||
``` | ||||||
|
||||||
where \<REPOSITORY> is the name of the code repository you are registering, \<OWNER> is the owner of the repository, \<NAME> is the name of the repository, \<GITHUB\_TOKEN> is your GitHub Personal Access Token and \<GITHUB\_URL> is the URL of the GitHub instance which defaults to `https://github.com.` You will need to set a URL if you are using GitHub Enterprise. | ||||||
where \<REPOSITORY> is the name of the code repository you are registering, \<OWNER> is the owner of the repository, \<NAME> is the name of the repository, \<GITHUB\_TOKEN> is your GitHub Personal Access Token. | ||||||
|
||||||
If you're using a self-hosted GitHub Enterprise instance, you'll need to also pass the `--api_url=<API_URL>` and `--host=<HOST>` options. \<API_URL> should point to where the GitHub API is reachable (defaults to `https://api.github.com/`) and \<HOST> should be the [hostname of your GitHub instance](https://docs.github.com/en/[email protected]/admin/configuring-settings/configuring-network-settings/configuring-the-hostname-for-your-instance?learn=deploy_an_instance&learnProduct=admin). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
{% hint style="warning" %} | ||||||
Please refer to the section on using secrets for stack configuration in order to securely store your GitHub | ||||||
|
@@ -105,11 +107,14 @@ Afterward, you can register a GitLab code repository by running the following CL | |||||
|
||||||
```shell | ||||||
zenml code-repository register <NAME> --type=gitlab \ | ||||||
--url=<GITLAB_URL> --group=<GROUP> --project=<PROJECT> \ | ||||||
--group=<GROUP> --project=<PROJECT> \ | ||||||
--token=<GITLAB_TOKEN> | ||||||
``` | ||||||
|
||||||
where `<NAME>` is the name of the code repository you are registering, `<GROUP>` is the group of the project, `<PROJECT>` is the name of the project, \<GITLAB\_TOKEN> is your GitLab Personal Access Token, and \<GITLAB\_URL> is the URL of the GitLab instance which defaults to `https://gitlab.com.` You will need to set a URL if you have a self-hosted GitLab instance. | ||||||
where `<NAME>` is the name of the code repository you are registering, `<GROUP>` is the group of the project, `<PROJECT>` is the name of the project, \<GITLAB\_TOKEN> is your GitLab Personal Access Token. | ||||||
|
||||||
If you're using a self-hosted GitLab instance, you'll need to also pass the `--instance_url=<INSTANCE_URL>` and `--host=<HOST>` options. \<INSTANCE_URL> should point to your GitLab instance (defaults to `https://gitlab.com/`) and \<HOST> should be the hostname of your GitLab instance (defaults to `gitlab.com`). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
|
||||||
{% hint style="warning" %} | ||||||
Please refer to the section on using secrets for stack configuration in order to securely store your GitLab | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,12 +214,14 @@ def download_code_if_necessary( | |
if not should_download_code: | ||
return | ||
|
||
if code_reference := deployment.code_reference: | ||
if code_path := deployment.code_path: | ||
code_utils.download_code_from_artifact_store(code_path=code_path) | ||
elif code_reference := deployment.code_reference: | ||
# TODO: This might fail if the code repository had unpushed changes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder for the TODO. |
||
# at the time the pipeline run was started. | ||
self.download_code_from_code_repository( | ||
code_reference=code_reference | ||
) | ||
elif code_path := deployment.code_path: | ||
code_utils.download_code_from_artifact_store(code_path=code_path) | ||
else: | ||
raise RuntimeError( | ||
"Code download required but no code reference or path provided." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(also keeps it consistent with the section below)