feat: apt clean

This commit is contained in:
2024-09-10 14:19:34 -07:00
parent 2eddbb0557
commit 476aa7391c
3 changed files with 10 additions and 14 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ EOF
# Install ROCm
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends rocm-dev rocblas-dev
apt-get install -y --no-install-recommends rocm-dev rocm-libs
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
+4 -4
View File
@@ -6,8 +6,8 @@ ARG HIP_ARCH="gfx803;gfx900"
ARG BLENDER_BRANCH="v3.6.15"
ARG DEBIAN_FRONTEND="noninteractive"
RUN sudo apt update && \
sudo apt install -y python3 git git-lfs
RUN sudo apt-get update && \
sudo apt-get install -y python3 git git-lfs
WORKDIR /home/rocm
RUN git clone --depth 1 https://projects.blender.org/blender/blender.git -b ${BLENDER_BRANCH} && \
@@ -17,7 +17,7 @@ WORKDIR /home/rocm/blender
RUN ./build_files/build_environment/install_linux_packages.py
RUN ./build_files/utils/make_update.py --use-linux-libraries
RUN sudo apt clean && sudo rm -rf /var/lib/apt/lists/*
RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*
# > Ref: https://github.com/xuhuisheng/rocm-gfx803/blob/master/blender.md
RUN sed -i 's/__noinline__/__inline__/g' intern/cycles/kernel/device/hip/compat.h
@@ -31,6 +31,6 @@ RUN cmake \
RUN make -j$(nproc)
RUN cpack -G TXZ
RUN cp $(ls -l blender*.tar.xz | cut -d' ' -f9 | tr -d '\n') /home/rocm/blender.tar.xz
RUN cp $(ls -l blender*.tar.xz | awk '{ print $9 }' | tail -n1 | tr -d '\n') /home/rocm/blender.tar.xz
CMD ["bash", "-l"]
+5 -9
View File
@@ -7,31 +7,27 @@ ARG PYTHON_VERSION="3.11"
ARG NUMPY_VERSION="1.22.4"
ARG DEBIAN_FRONTEND="noninteractive"
RUN sudo apt-get update && \
sudo apt-get install -y rocm-libs && \
sudo rm -rf /var/lib/apt/lists/*
WORKDIR /home/rocm
# Add GPU target
RUN bash -c 'echo -e "gfx803\ngfx900" | sudo tee /opt/rocm/bin/target.lst'
# Install bazelisk
RUN sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.21.0/bazelisk-linux-amd64 && sudo chmod 755 /usr/local/bin/bazel
WORKDIR /home/rocm
RUN git clone --depth 1 https://github.com/ROCm/tensorflow-upstream.git -b ${TENSORFLOW_BRANCH} tensorflow
WORKDIR /home/rocm/tensorflow
RUN <<EOF
sudo apt-get update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
EOF
WORKDIR /home/rocm/tensorflow
# TODO: simplify dependencies
# > Ref: https://github.com/ROCm/ROCm/issues/1880
RUN python${PYTHON_VERSION} -m pip install -U --user pip numpy==${NUMPY_VERSION} wheel packaging requests opt_einsum patchelf
@@ -43,7 +39,7 @@ RUN sudo ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python
RUN ./build_rocm_python3 /opt/rocm
WORKDIR /tmp/tensorflow_pkg
RUN cp (ls -l tensorflow*.whl | cut -d' ' -f9 | tr -d '\n') /home/rocm/tensorflow-rocm.whl
RUN cp (ls -l tensorflow*.whl | awk '{ print $9 }' | tail -n1 | tr -d '\n') /home/rocm/tensorflow-rocm.whl
WORKDIR /home/rocm
CMD [ "/bin/bash", "-l" ]