-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API/YAML: Support using env vars to define file_mounts. (#2146)
* WIP: storage creation is eager * Fixes. * Fixes * Updates * Guard against invalid env keys. * Updates * cleanup * Pylint * Update
- Loading branch information
1 parent
eee216a
commit 3385975
Showing
11 changed files
with
294 additions
and
49 deletions.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Example showcasing how env vars can be used in the file_mounts section. | ||
|
||
# You can set the default values for env vars in this 'envs' section. | ||
# When launching, `sky launch --env ENV=val` will override the default. | ||
envs: | ||
MY_BUCKET: skypilot-temp-gcs-test | ||
MY_LOCAL_PATH: tmp-workdir | ||
MODEL_SIZE: 13b | ||
|
||
resources: | ||
cloud: gcp | ||
|
||
# You can use env vars in | ||
# - the destination: source paths | ||
# - for SkyPilot Storage | ||
# - the "name" (bucket name) and "source" (local dir/file to upload) fields. | ||
# | ||
# Both syntaxes work: ${MY_BUCKET} and $MY_BUCKET. | ||
file_mounts: | ||
/mydir: | ||
name: ${MY_BUCKET} # Name of the bucket. | ||
store: gcs | ||
mode: MOUNT | ||
|
||
/mydir2: | ||
name: $MY_BUCKET # Name of the bucket. | ||
store: gcs | ||
mode: MOUNT | ||
|
||
/another-dir: | ||
name: ${MY_BUCKET}-2 | ||
source: ["~/${MY_LOCAL_PATH}"] | ||
store: gcs | ||
mode: MOUNT | ||
|
||
/another-dir2: | ||
name: $MY_BUCKET-2 | ||
source: ["~/${MY_LOCAL_PATH}"] | ||
store: gcs | ||
mode: MOUNT | ||
|
||
/checkpoint/${MODEL_SIZE}: ~/${MY_LOCAL_PATH} | ||
|
||
run: | | ||
echo Env var MY_BUCKET has value: ${MY_BUCKET} | ||
echo Env var MY_LOCAL_PATH has value: ${MY_LOCAL_PATH} | ||
ls -lthr /mydir | ||
ls -lthr /mydir2 | ||
ls -lthr /another-dir | ||
ls -lthr /another-dir2 | ||
ls -lthr /checkpoint/${MODEL_SIZE} |
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
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
Oops, something went wrong.