Skip to content

Commit

Permalink
Reorder and fix installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
jakki-amd committed Nov 26, 2024
1 parent be29ac7 commit b592621
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
18 changes: 15 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ RUN \
elif echo "${BASE_IMAGE}" | grep -q "rocm/"; then \
# Install ROCm version specific binary when ROCm version is specified as a build arg
if [ "$USE_ROCM_VERSION" ]; then \
python ./ts_scripts/install_dependencies.py --rocm $USE_ROCM_VERSION\
python ./ts_scripts/install_dependencies.py --rocm $USE_ROCM_VERSION;\
# Install the binary with the latest CPU image on a ROCm base image
else \
python ./ts_scripts/install_dependencies.py;\
python ./ts_scripts/install_dependencies.py; \
fi; \
# Install the CPU binary
else \
Expand Down Expand Up @@ -192,7 +192,6 @@ RUN --mount=type=cache,target=/var/cache/apt \
&& rm -rf /var/lib/apt/lists/* \
&& cd /tmp


COPY --from=compile-image /home/venv /home/venv

ENV PATH="/home/venv/bin:$PATH"
Expand All @@ -211,6 +210,7 @@ FROM ${BASE_IMAGE} as dev-image
ARG PYTHON_VERSION
ARG BRANCH_NAME
ARG BUILD_FROM_SRC
ARG USE_ROCM_VERSION
ARG LOCAL_CHANGES
ARG BUILD_WITH_IPEX
ARG IPEX_VERSION=1.11.0
Expand All @@ -236,9 +236,15 @@ RUN --mount=type=cache,target=/var/cache/apt \
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009905
openjdk-17-jdk \
build-essential \
wget \
curl \
vim \
numactl \
nodejs \
npm \
zip \
unzip \
&& npm install -g [email protected] newman-reporter-htmlextra markdown-link-check \
&& if [ "$BUILD_WITH_IPEX" = "true" ]; then apt-get update && apt-get install -y libjemalloc-dev libgoogle-perftools-dev libomp-dev && ln -s /usr/lib/x86_64-linux-gnu/libjemalloc.so /usr/lib/libjemalloc.so && ln -s /usr/lib/x86_64-linux-gnu/libtcmalloc.so /usr/lib/libtcmalloc.so && ln -s /usr/lib/x86_64-linux-gnu/libiomp5.so /usr/lib/libiomp5.so; fi \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -253,6 +259,12 @@ RUN \
COPY --from=compile-image /home/venv /home/venv
ENV PATH="/home/venv/bin:$PATH"
WORKDIR "serve"

RUN \
if [ "$USE_ROCM_VERSION" ]; then \
python -m pip install /opt/rocm/share/amd_smi; \
fi

RUN python -m pip install -U pip setuptools \
&& python -m pip install --no-cache-dir -r requirements/developer.txt \
&& python ts_scripts/install_from_src.py \
Expand Down
8 changes: 2 additions & 6 deletions docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,12 @@ WORKDIR "/serve"

RUN \
if [ "$USE_ROCM_VERSION" ]; then \
python ts_scripts/install_dependencies.py --environment=dev --rocm $USE_ROCM_VERSION \
&& cd /opt/rocm/share/amd_smi \
&& python -m pip install . ; \
# Install the binary with the latest CPU image on a ROCm base image
else \
python ts_scripts/install_dependencies.py --environment=dev;\
python -m pip install /opt/rocm/share/amd_smi ; \
fi;

RUN python -m pip install -U pip setuptools \
&& python -m pip install --no-cache-dir -r requirements/developer.txt \
&& python ts_scripts/install_dependencies.py --environment dev \
&& python ts_scripts/install_from_src.py --environment=dev \
&& useradd -m model-server \
&& mkdir -p /home/model-server/tmp \
Expand Down
2 changes: 1 addition & 1 deletion docker/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ if [ "${BUILD_TYPE}" == "production" ]; then
fi
elif [ "${BUILD_TYPE}" == "ci" ];
then
DOCKER_BUILDKIT=1 docker build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
DOCKER_BUILDKIT=1 docker build --file Dockerfile --build-arg BASE_IMAGE="${BASE_IMAGE}" --build-arg USE_CUDA_VERSION="${CUDA_VERSION}" --build-arg USE_ROCM_VERSION="${ROCM_VERSION}" --build-arg PYTHON_VERSION="${PYTHON_VERSION}"\
--build-arg BUILD_NIGHTLY="${BUILD_NIGHTLY}" --build-arg BRANCH_NAME="${BRANCH_NAME}" --build-arg REPO_URL="${REPO_URL}" --build-arg BUILD_FROM_SRC="${BUILD_FROM_SRC}"\
--build-arg LOCAL_CHANGES="${LOCAL_CHANGES}" -t "${DOCKER_TAG}" --target ci-image ../
else
Expand Down

0 comments on commit b592621

Please sign in to comment.