Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
mjibril committed Aug 5, 2024
1 parent 38e0230 commit e341c22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
12 changes: 12 additions & 0 deletions sky/clouds/fluidstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ def check_credentials(cls) -> Tuple[bool, Optional[str]]:
try:
assert os.path.exists(
os.path.expanduser(fluidstack_utils.FLUIDSTACK_API_KEY_PATH))

with open(os.path.expanduser(
fluidstack_utils.FLUIDSTACK_API_KEY_PATH),
encoding='UTF-8') as f:
api_key = f.read().strip()
if not api_key.startswith('api_key'):
return False, ('Invalid FluidStack API key format. '
'To configure credentials, go to:\n '
' https://dashboard.fluidstack.io \n '
'to obtain an API key, '
'then add save the contents '
'to ~/.fluidstack/api_key \n')
except AssertionError:
return False, ('Failed to access FluidStack Cloud'
' with credentials. '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def create_catalog(output_dir: str) -> None:
mem = vcpus_mem['min_memory']
except IndexError:
continue

price = float(plan['price_per_gpu_hr']) * gpu_cnt
gpuinfo = {
'Gpus': [{
Expand Down
24 changes: 8 additions & 16 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ def test_env_check(generic_cloud: str):


# ---------- file_mounts ----------
@pytest.mark.no_fluidstack # Requires other clouds to be enabled
@pytest.mark.no_scp # SCP does not support num_nodes > 1 yet. Run test_scp_file_mounts instead.
def test_file_mounts(generic_cloud: str):
name = _get_cluster_name()
Expand Down Expand Up @@ -1170,7 +1169,6 @@ def test_kubernetes_storage_mounts():
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support docker for now
@pytest.mark.parametrize(
'image_id',
[
Expand Down Expand Up @@ -2420,7 +2418,6 @@ def test_stop_gcp_spot():


# ---------- Testing managed job ----------
@pytest.mark.no_fluidstack
@pytest.mark.managed_jobs
def test_managed_jobs(generic_cloud: str):
"""Test the managed jobs yaml."""
Expand Down Expand Up @@ -3044,7 +3041,6 @@ def test_managed_jobs_tpu():


# ---------- Testing env for managed jobs ----------
@pytest.mark.no_fluidstack
@pytest.mark.managed_jobs
def test_managed_jobs_inline_env(generic_cloud: str):
"""Test managed jobs env"""
Expand Down Expand Up @@ -3148,7 +3144,6 @@ def test_kubernetes_custom_image(image_id):
run_one_test(test)



@pytest.mark.azure
def test_azure_start_stop_two_nodes():
name = _get_cluster_name()
Expand Down Expand Up @@ -3606,7 +3601,8 @@ def test_skyserve_dynamic_ondemand_fallback():
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not cloud storage
# TODO: fluidstack does not support `--cpus 2`, but the check for services in this test is based on CPUs
@pytest.mark.no_fluidstack
@pytest.mark.serve
def test_skyserve_user_bug_restart(generic_cloud: str):
"""Tests that we restart the service after user bug."""
Expand Down Expand Up @@ -3640,7 +3636,6 @@ def test_skyserve_user_bug_restart(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack
@pytest.mark.serve
@pytest.mark.no_kubernetes # Replicas on k8s may be running on the same node and have the same public IP
def test_skyserve_load_balancer(generic_cloud: str):
Expand Down Expand Up @@ -3707,7 +3702,6 @@ def test_skyserve_auto_restart():
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
@pytest.mark.serve
def test_skyserve_cancel(generic_cloud: str):
"""Test skyserve with cancel"""
Expand All @@ -3733,7 +3727,6 @@ def test_skyserve_cancel(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
@pytest.mark.serve
def test_skyserve_streaming(generic_cloud: str):
"""Test skyserve with streaming"""
Expand All @@ -3753,7 +3746,6 @@ def test_skyserve_streaming(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
@pytest.mark.serve
def test_skyserve_readiness_timeout_fail(generic_cloud: str):
"""Test skyserve with large readiness probe latency, expected to fail"""
Expand All @@ -3777,7 +3769,6 @@ def test_skyserve_readiness_timeout_fail(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
@pytest.mark.serve
def test_skyserve_large_readiness_timeout(generic_cloud: str):
"""Test skyserve with customized large readiness timeout"""
Expand All @@ -3796,7 +3787,8 @@ def test_skyserve_large_readiness_timeout(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
# TODO: fluidstack does not support `--cpus 2`, but the check for services in this test is based on CPUs
@pytest.mark.no_fluidstack
@pytest.mark.serve
def test_skyserve_update(generic_cloud: str):
"""Test skyserve with update"""
Expand Down Expand Up @@ -3825,7 +3817,8 @@ def test_skyserve_update(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
# TODO: fluidstack does not support `--cpus 2`, but the check for services in this test is based on CPUs
pytest.mark.no_fluidstack
@pytest.mark.serve
def test_skyserve_rolling_update(generic_cloud: str):
"""Test skyserve with rolling update"""
Expand Down Expand Up @@ -3903,7 +3896,6 @@ def test_skyserve_fast_update(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack # FluidStack does not support cloud storage
@pytest.mark.serve
def test_skyserve_update_autoscale(generic_cloud: str):
"""Test skyserve update with autoscale"""
Expand Down Expand Up @@ -3940,7 +3932,7 @@ def test_skyserve_update_autoscale(generic_cloud: str):
run_one_test(test)


@pytest.mark.no_fluidstack
@pytest.mark.no_fluidstack # Spot instances are note supported by Fluidstack
@pytest.mark.serve
@pytest.mark.no_kubernetes # Spot instances are not supported in Kubernetes
@pytest.mark.parametrize('mode', ['rolling', 'blue_green'])
Expand Down Expand Up @@ -4004,6 +3996,7 @@ def test_skyserve_new_autoscaler_update(mode: str, generic_cloud: str):
run_one_test(test)


# TODO: fluidstack does not support `--cpus 2`, but the check for services in this test is based on CPUs
@pytest.mark.no_fluidstack
@pytest.mark.serve
def test_skyserve_failures(generic_cloud: str):
Expand Down Expand Up @@ -5070,7 +5063,6 @@ def test_excluded_file_cloud_storage_upload_copy(self, gitignore_structure,
assert '4' in cnt_output.decode('utf-8'), \
'Some items listed in .gitignore and .git/info/exclude are not excluded.'

@pytest.mark.no_fluidstack
@pytest.mark.parametrize('ext_bucket_fixture, store_type',
[('tmp_awscli_bucket', storage_lib.StoreType.S3),
('tmp_gsutil_bucket', storage_lib.StoreType.GCS),
Expand Down

0 comments on commit e341c22

Please sign in to comment.