diff --git a/examples/oci/dataset-upload-and-mount.yaml b/examples/oci/dataset-upload-and-mount.yaml index 37b4d17b9b6..13ddc4d2b35 100644 --- a/examples/oci/dataset-upload-and-mount.yaml +++ b/examples/oci/dataset-upload-and-mount.yaml @@ -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: . @@ -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 diff --git a/sky/data/storage.py b/sky/data/storage.py index 413eeef843e..18bca668a21 100644 --- a/sky/data/storage.py +++ b/sky/data/storage.py @@ -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.') @@ -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