Repository: skypilot-org/skypilot (branch: continuous-sync-alpha-1)
Commit date: 2023-11-09T06:59:57Z

Workflow file: .github/workflows/format.yml (format)
name: format

on:
  # Trigger the workflow on push or pull request,
  # but only for the main branch
  push:
    branches:
      - master
      - 'releases/**'
  pull_request:
    branches:
      - master
      - 'releases/**'
jobs:
  format:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    strategy:
      matrix:
        python-version: ["3.8"]
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install yapf==0.32.0
        pip install toml==0.10.2
        pip install black==22.10.0
        pip install isort==5.12.0
    - name: Running yapf
      run: |
        yapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \
            --exclude 'sky/skylet/providers/aws/**' \
            --exclude 'sky/skylet/providers/gcp/**' \
            --exclude 'sky/skylet/providers/azure/**' \
            --exclude 'sky/skylet/providers/ibm/**'
    - name: Running black
      run: |
        black --diff --check sky/skylet/providers/aws/ \
            sky/skylet/providers/gcp/ \
            sky/skylet/providers/azure/ \
            sky/skylet/providers/ibm/
    - name: Running isort for black formatted files
      run: |
        isort --diff --check --profile black -l 88 -m 3 \
            sky/skylet/providers/ibm/
    - name: Running isort for yapf formatted files
      run: |
        isort --diff --check ./ --sg 'sky/skylet/ray_patches/**' \
            --sg 'sky/skylet/providers/aws/**' \
            --sg 'sky/skylet/providers/gcp/**' \
            --sg 'sky/skylet/providers/azure/**' \
            --sg 'sky/skylet/providers/ibm/**'

env:
  PIP_INDEX_URL: http://localhost:8629/2023-11-09
  UV_INDEX_URL: http://localhost:8629/2023-11-09


Failed build logs:
step_name: format (3.8)/5_Running yapf.txt
log: ##[group]Run yapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \
[36;1myapf --diff --recursive ./ --exclude 'sky/skylet/ray_patches/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/aws/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/gcp/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/azure/**' \[0m
[36;1m    --exclude 'sky/skylet/providers/ibm/**'[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
##[endgroup]
--- ./sky/data/storage.py	(original)
+++ ./sky/data/storage.py	(reformatted)
@@ -819,7 +819,7 @@
         source = override_args.get('source', metadata.source)
         name = override_args.get('name', metadata.storage_name)
         # If the source is a list, it consists of local paths
-        if not isinstance(source, list): 
+        if not isinstance(source, list):
             if data_utils.is_cloud_store_url(source):
                 name = None
 
##[error]Process completed with exit code 1.


Changed files:
sky/backends/cloud_vm_ray_backend.py
sky/data/sky_csync.py
sky/data/storage.py

Fix diff:
diff --git a/sky/backends/cloud_vm_ray_backend.py b/sky/backends/cloud_vm_ray_backend.py
index 8a93b58c..08bc7ffb 100644
--- a/sky/backends/cloud_vm_ray_backend.py
+++ b/sky/backends/cloud_vm_ray_backend.py
@@ -4557,14 +4557,15 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
         end = time.time()
         logger.debug(f'File mount sync took {end - start} seconds.')
 
-    def _execute_storage_mounts(self, handle: CloudVmRayResourceHandle,
-                                storage_mounts: Dict[Path, storage_lib.Storage],
-                                mount_mode: storage_utils.StorageMode):
+    def _execute_storage_mounts(
+            self, handle: CloudVmRayResourceHandle,
+            storage_mounts: Optional[Dict[Path, storage_lib.Storage]],
+            mount_mode: storage_utils.StorageMode):
         """Executes storage mounts: installing mounting tools and mounting."""
         # Handle cases where `storage_mounts` is None. This occurs when users
         # initiate a 'sky start' command from a Skypilot version that predates
         # the introduction of the `storage_mounts_metadata` feature.
-        if not storage_mounts:
+        if storage_mounts is None:
             return
 
         # Process only mount mode objects here. COPY mode objects have been
@@ -4674,7 +4675,7 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
 
     def _has_csync(self, cluster_name: str) -> bool:
         """Chekcs if there are CSYNC mode storages within the cluster."""
-        storage_mounts = self._get_storage_mounts_metadata(cluster_name)
+        storage_mounts = self.get_storage_mounts_metadata(cluster_name)
         if storage_mounts is not None:
             for _, storage_obj in storage_mounts.items():
                 if storage_obj.mode == storage_utils.StorageMode.CSYNC:
diff --git a/sky/data/sky_csync.py b/sky/data/sky_csync.py
index c0d521ff..c6c3f981 100644
--- a/sky/data/sky_csync.py
+++ b/sky/data/sky_csync.py
@@ -251,7 +251,7 @@ def csync(source: str, storetype: str, destination: str, num_threads: int,
     """Runs daemon to sync the source to the bucket every INTERVAL seconds.
 
     Creates an entry of pid of the sync process in local database while sync
-    command is runninng and removes it when completed.
+    command is running and removes it when completed.
 
     Args:
         source (str): The local path to the directory that you want to sync.
diff --git a/sky/data/storage.py b/sky/data/storage.py
index dea9b906..3f7c205f 100644
--- a/sky/data/storage.py
+++ b/sky/data/storage.py
@@ -819,7 +819,7 @@ class Storage(object):
         source = override_args.get('source', metadata.source)
         name = override_args.get('name', metadata.storage_name)
         # If the source is a list, it consists of local paths
-        if not isinstance(source, list): 
+        if not isinstance(source, list):
             if data_utils.is_cloud_store_url(source):
                 name = None