forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
managed_job_with_storage.yaml
66 lines (48 loc) · 1.46 KB
/
managed_job_with_storage.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# A managed spot example with storages.
#
# Runs a task that uses cloud buckets for uploading and accessing files.
#
# Usage:
# sky jobs launch -c spot-storage examples/managed_job_with_storage.yaml
# sky down spot-storage
resources:
cloud: aws
use_spot: true
job_recovery: failover
workdir: ./examples
file_mounts:
~/bucket_workdir:
# Change this to your own globally unique bucket name.
name: sky-workdir-zhwu
source: ./examples
persistent: false
mode: COPY
/output_path:
# Change this to your own globally unique bucket name.
name: sky-output-bucket
mode: MOUNT
/public-bucket:
source: s3://fah-public-data-covid19-cryptic-pockets
# File mounts for folder
/tmp/workdir: ~/tmp-workdir
# File mounts for file
~/tmpfile: ~/tmpfile
~/a/b/c/tmpfile: ~/tmpfile
# Intermediate dirs are created and chown-ed to $USER if they don't already
# exist. Thus they can be used too, e.g., 'mkdir -p /data/logs'. See 'run'.
/data/checkpoints/best.pt: ~/tmpfile
~/.ssh/id_rsa.pub: ~/.ssh/id_rsa.pub
run: |
set -ex
ls ~/sky_workdir/managed_job_with_storage.yaml
ls ~/bucket_workdir/managed_job_with_storage.yaml
ls -l /public-bucket
mkdir -p /data/logs
touch /data/logs/test.log
touch /data/checkpoints/last.pt
echo hi >> /tmp/workdir/new_file
ls -al /tmp/workdir
cat ~/tmpfile
cat ~/a/b/c/tmpfile
# Write to a file in the mounted bucket
echo "hello world!" > /output_path/output.txt