forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
using_file_mounts_with_env_vars.yaml
52 lines (43 loc) · 1.21 KB
/
using_file_mounts_with_env_vars.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 bucket mounting
# - 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}