Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions sky/data/mounting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def get_rclone_install_cmd() -> str:
f' && curl -O https://downloads.rclone.org/{RCLONE_VERSION}/rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.deb'
f' && sudo dpkg -i rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.deb'
f' && rm -f rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.deb)))'
f' || (which rclone > /dev/null || (cd ~ > /dev/null'
f' || (which yum > /dev/null 2>&1 && (which rclone > /dev/null || (cd ~ > /dev/null'
f' && curl -O https://downloads.rclone.org/{RCLONE_VERSION}/rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.rpm'
f' && sudo yum --nogpgcheck install rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.rpm -y'
f' && rm -f rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.rpm))')
f' && rm -f rclone-{RCLONE_VERSION}-linux-${{ARCH_SUFFIX}}.rpm)))')
return install_cmd


Expand Down
68 changes: 68 additions & 0 deletions tests/smoke_tests/test_mount_and_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,74 @@ def test_aws_storage_mounts_arm64():
smoke_tests_utils.run_one_test(test)


@pytest.mark.aws
def test_aws_dpkg_storage_mounts_cached():
name = smoke_tests_utils.get_cluster_name()
cloud = 'aws'
storage_name = f'sky-test-{int(time.time())}'
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f1:
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f2:
test_commands, clean_command = _storage_mount_cached_test_command_generator(
f1, f2, name, storage_name, cloud)

for i, cmd in enumerate(test_commands):
if cmd.startswith('sky launch') and '--infra aws' in cmd:
test_commands[i] = cmd.replace(
'--infra aws',
# The image ID is retrieved with:

# aws ec2 describe-images \
# --owners 099720109477 \
# --filters "Name=name,Values=ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" \
# --query 'Images | sort_by(@, &CreationDate) | [-1].[ImageId,Name,CreationDate]' \
# --output text --region us-east-2
'--infra aws/us-east-2 --image-id ami-0f5fcdfbd140e4ab7'
)
break

test = smoke_tests_utils.Test(
'aws_dpkg_storage_mount_cached',
test_commands,
clean_command,
timeout=20 * 60, # 20 mins
)
smoke_tests_utils.run_one_test(test)


@pytest.mark.aws
def test_aws_yum_storage_mounts_cached():
name = smoke_tests_utils.get_cluster_name()
cloud = 'aws'
storage_name = f'sky-test-{int(time.time())}'
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f1:
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f2:
test_commands, clean_command = _storage_mount_cached_test_command_generator(
f1, f2, name, storage_name, cloud)

for i, cmd in enumerate(test_commands):
if cmd.startswith('sky launch') and '--infra aws' in cmd:
test_commands[i] = cmd.replace(
'--infra aws',
# The image ID is retrieved with:

# aws ec2 describe-images \
# --owners amazon \
# --filters "Name=name,Values=al2023-ami-2023.*-x86_64" \
# --query 'Images | sort_by(@, &CreationDate) | [-1].[ImageId,Name]' \
# --output text --region us-east-2
'--infra aws/us-east-2 --image-id ami-0a5a5b7e2278263e5'
)
break

test = smoke_tests_utils.Test(
'aws_yum_storage_mount_cached',
test_commands,
clean_command,
timeout=20 * 60, # 20 mins
)
smoke_tests_utils.run_one_test(test)


@pytest.mark.aws
def test_aws_storage_mounts_with_stop():
name = smoke_tests_utils.get_cluster_name()
Expand Down