Skip to content

Commit

Permalink
Address review comments & more testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
HysunHe committed Dec 27, 2024
1 parent 5fb9d45 commit 4fc8928
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions examples/oci/dataset-upload-and-mount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ file_mounts:
persistent: True # Defaults to True; can be set to false. Optional.
mode: MOUNT # Either MOUNT or COPY. Optional.

/datasets-storage2:
name: skybucket2 # Name of storage, optional when source is bucket URI
source: './examples/oci' # Source path, can be local or bucket URL. Optional, do not specify to create an empty bucket.
store: oci # E.g 'oci', 's3', 'gcs'...; default: None. Optional.
persistent: True # Defaults to True; can be set to false. Optional.
mode: MOUNT # Either MOUNT or COPY. Optional.

# Working directory (optional) containing the project codebase.
# Its contents are synced to ~/sky_workdir/ on the cluster.
workdir: .
Expand All @@ -34,3 +41,7 @@ run: |
ls -lthr /datasets-storage
echo "hi" >> /datasets-storage/foo.txt
ls -lthr /datasets-storage
ls -lthr /datasets-storage2
echo "hi" >> /datasets-storage2/foo2.txt
ls -lthr /datasets-storage2
5 changes: 4 additions & 1 deletion sky/data/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3664,6 +3664,9 @@ def _validate(self):
assert self.name == data_utils.split_oci_path(self.source)[0], (
'OCI Bucket is specified as path, the name should be '
'the same as OCI bucket.')
elif not re.search(r'^\w+://', self.source):
# Treat it as local path.
pass
else:
raise NotImplementedError(
f'Moving data from {self.source} to OCI is not supported.')
Expand Down Expand Up @@ -3826,7 +3829,7 @@ def get_dir_sync_command(src_dir_path, dest_dir_name):
'oci os object bulk-upload --no-follow-symlinks --overwrite '
f'--bucket-name {self.name} --namespace-name {self.namespace} '
f'--object-prefix "{dest_dir_name}" --src-dir "{src_dir_path}" '
f'{excludes}" ')
f'{excludes} ')

return sync_command

Expand Down

0 comments on commit 4fc8928

Please sign in to comment.