Skip to content

Commit

Permalink
fixup! feat: improve Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
SdgJlbl committed Aug 13, 2024
1 parent bca83e1 commit a07ca4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
13 changes: 7 additions & 6 deletions substrafl/remote/register/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
# update image & install Python
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get -y upgrade && \
apt-get install -y python{python_version} python{python_version}-venv python3-pip && \
apt-get clean
RUN apt-get update -y\
&& apt-get install -y software-properties-common\
&& add-apt-repository -y ppa:deadsnakes/ppa\
&& apt-get -y upgrade\
&& apt-get install -y python{python_version} python{python_version}-venv python3-pip\
&& apt-get clean\
&& rm -rf /var/lib/apt/lists/*
"""

Expand Down
15 changes: 8 additions & 7 deletions tests/remote/register/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ def test_get_base_docker_image_gpu():
expected_dockerfile = """
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
# update image
# update image & install Python
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get -y upgrade && \
apt-get install -y python{python_version} python{python_version}-venv python3-pip && \
apt-get clean
RUN apt-get update -y\
&& apt-get install -y software-properties-common\
&& add-apt-repository -y ppa:deadsnakes/ppa\
&& apt-get -y upgrade\
&& apt-get install -y python3.11 python3.11-venv python3-pip\
&& apt-get clean\
&& rm -rf /var/lib/apt/lists/*
"""
assert expected_dockerfile == _get_base_docker_image("3.11", use_gpu=True)
Expand Down

0 comments on commit a07ca4d

Please sign in to comment.