Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sky spot launch TPU #1249

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sky/clouds/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'access_tokens.db',
'configurations',
'legacy_credentials',
'active_config',
]

_IMAGE_ID_PREFIX = ('projects/deeplearning-platform-release/global/images/')
Expand Down
18 changes: 18 additions & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,24 @@ def test_spot_storage():
run_one_test(test)


# ---------- Testing spot TPU ----------
def test_spot_tpu():
"""Test managed spot on TPU."""
name = _get_cluster_name()
test = Test(
'test-spot-tpu',
[
f'sky spot launch -n {name} examples/tpu/tpuvm_mnist.yaml -y -d',
'sleep 5',
f's=$(sky spot status); printf "$s"; echo; echo; printf "$s" | grep {name} | head -n1 | grep STARTING',
'sleep 600', # TPU takes a while to launch
f's=$(sky spot status); printf "$s"; echo; echo; printf "$s" | grep {name} | head -n1 | grep "RUNNING\|SUCCEEDED"',
],
f'sky spot cancel -y -n {name}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a tear down command for managed spot jobs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this smoke test will pass if the job changed from STARTING to RUNNING. In this case, we can actually kill the job to save some costs. But we can remove it if we want as the job is short.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought it was short - let's still keep it then.

)
run_one_test(test)


# ---------- Testing env ----------
def test_inline_env():
"""Test env"""
Expand Down