Skip to content

Commit fe00a24

Browse files
Fix sky start for AMI without conda (skypilot-org#1532)
* fix no conda img * fix tpu yaml * add yaml * rename * rename * Update examples/tests/test_yamls/no_conda_ami.yaml Co-authored-by: Zhanghao Wu <[email protected]> Co-authored-by: Zhanghao Wu <[email protected]>
1 parent 309ecb0 commit fe00a24

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resources:
2+
cloud: aws
3+
instance_type: g4dn.xlarge
4+
region: us-west-2
5+
image_id: ami-0fe5af21074ad2a10 # Deep learning AMI with CUDA 11.6 without conda installed
6+
7+
run: |
8+
nvidia-smi
9+

examples/tpu/tpuvm_mnist.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ setup: |
2020
pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
2121
pip install --upgrade clu
2222
pip install -e flax
23+
pip install tensorflow tensorflow-datasets
2324
fi
2425
2526

sky/templates/aws-ray.yml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ setup_commands:
120120
pip3 --version > /dev/null 2>&1 || (curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && echo "PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc);
121121
(type -a python | grep -q python3) || echo 'alias python=python3' >> ~/.bashrc;
122122
(type -a pip | grep -q pip3) || echo 'alias pip=pip3' >> ~/.bashrc;
123-
(which conda > /dev/null 2>&1 && conda init > /dev/null && conda config --set auto_activate_base false) || (wget -nc https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b && eval "$(~/miniconda3/bin/conda shell.bash hook)" && conda init && conda config --set auto_activate_base true);
123+
(which conda > /dev/null 2>&1 && conda init > /dev/null) || (wget -nc https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b && eval "$(~/miniconda3/bin/conda shell.bash hook)" && conda init && conda config --set auto_activate_base true);
124124
source ~/.bashrc;
125125
(pip3 list | grep ray | grep {{ray_version}} 2>&1 > /dev/null || pip3 install -U ray[default]=={{ray_version}}) && mkdir -p ~/sky_workdir && mkdir -p ~/.sky/sky_app;
126126
(pip3 list | grep skypilot && [ "$(cat {{sky_remote_path}}/current_sky_wheel_hash)" == "{{sky_wheel_hash}}" ]) || (pip3 uninstall skypilot -y; pip3 install "$(echo {{sky_remote_path}}/{{sky_wheel_hash}}/skypilot-{{sky_version}}*.whl)[aws]" && echo "{{sky_wheel_hash}}" > {{sky_remote_path}}/current_sky_wheel_hash || exit 1);

tests/test_smoke.py

+18
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,24 @@ def test_image_id_dict_with_zone():
271271
run_one_test(test)
272272

273273

274+
def test_image_no_conda():
275+
name = _get_cluster_name()
276+
test = Test(
277+
'image_no_conda',
278+
[
279+
# Use image id dict.
280+
f'sky launch -y -c {name} examples/tests/test_yamls/no_conda_ami.yaml',
281+
f'sky logs {name} 1 --status',
282+
f'sky stop {name} -y',
283+
f'sky start {name} -y',
284+
f'sky exec {name} examples/tests/test_yamls/no_conda_ami.yaml',
285+
f'sky logs {name} 2 --status',
286+
],
287+
f'sky down -y {name}',
288+
)
289+
run_one_test(test)
290+
291+
274292
def test_stale_job():
275293
name = _get_cluster_name()
276294
test = Test(

0 commit comments

Comments
 (0)