This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Resolve requirements installed from Git or local source #645
Merged
Conversation
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
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #645 +/- ##
==========================================
- Coverage 85.97% 85.90% -0.08%
==========================================
Files 107 107
Lines 9770 9805 +35
==========================================
+ Hits 8400 8423 +23
- Misses 1370 1382 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
aguschin
added a commit
that referenced
this pull request
Mar 31, 2023
this is for #647 (comment) This work similarly to #645: `mlem build docker` works the same, but I'll provide an example for k8s deploy here: ``` $ mlem declare deployment kubernetes deployer \ --image_name myimage --service_type loadbalancer --registry remote \ --env docker --env.registry remote --registry.host localhost --namespace myns \ --set_env.0 VAR1 --set_env.1 VAR2=aguschin 💾 Saving deployment to deployer.mlem ``` ```yaml # deployer.mlem env: object_type: env registry: type: remote type: kubernetes image_name: myimage namespace: myns object_type: deployment registry: host: localhost type: remote service_type: type: loadbalancer set_env: - VAR1 - VAR2=aguschin type: kubernetes ``` Then in Dockerfile for your image you'll get: ``` ... ENV VAR1=VALUE1 ENV VAR2=aguschin ``` `VALUE1` will be taken from shell/env vars with `os.getenv("VAR1")`. If it's not set, an Exception will be raised by MLEM.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
For a package installed with
pip install git+https://...
this will pin down the URL to the package to be installed from Git.For a package installed with
pip install local/path
this will collect the package and add it as base64-encoded string to.mlem
file.PR also adds
--build_arg
option for Docker builder to pass args at building time.TODO:
requirements:
(e.g.source_url
)For k8s deployment this works like:
$ mlem declare deployment kubernetes deployer \ --image_name myimage --service_type loadbalancer --registry remote \ --env docker --env.registry remote --registry.host localhost --namespace myns \ --build_arg.0 GITHUB_TOKEN --build_arg.1 GITHUB_USERNAME=aguschin 💾 Saving deployment to deployer.mlem
Note that one ARG value is set, another isn't:
Now at
mlem deploy --load deployer.mlem
MLEM will useGITHUB_TOKEN
env var if set. If var has a different name, this can be run like$ GITHUB_TOKEN=$ENV_VAR_TO_USE mlem deploy --load deployer.mlem
Env var takes precedence, so if you set
GITHUB_USERNAME
, it's value will be used instead ofaguschin
.