-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,32 +2,38 @@ | |
# Author: Ryoichi Ando ([email protected]) | ||
# License: Apache v2.0 | ||
|
||
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 | ||
ARG IMAGE | ||
FROM $IMAGE | ||
|
||
ARG BUILD_MODE=base | ||
ARG MODE | ||
ENV NVIDIA_DRIVER_CAPABILITIES=utility,compute | ||
ENV LANG=en_US.UTF-8 | ||
ENV PROJ_NAME=ppf-contact-solver | ||
ENV BUILT_MODE=${BUILD_MODE} | ||
ENV BUILT_MODE=$MODE | ||
|
||
COPY . /root/${PROJ_NAME} | ||
WORKDIR /root/${PROJ_NAME} | ||
|
||
RUN apt update | ||
RUN apt install -y git python3 curl | ||
RUN python3 warmup.py | ||
RUN echo "building in ${MODE} mode" | ||
RUN sleep 5 | ||
|
||
RUN if [ "$BUILD_MODE" = "compiled" ]; then \ | ||
RUN if [ "$MODE" = "compiled" ]; then \ | ||
/root/.cargo/bin/cargo build --release; \ | ||
else \ | ||
elif [ "$MODE" = "base" ]; then \ | ||
apt update; \ | ||
apt install -y git python3 curl; \ | ||
python3 warmup.py; \ | ||
cd /root && rm -rf /root/${PROJ_NAME}; \ | ||
else \ | ||
echo "unknown build mode ${BUILT_MODE}"; \ | ||
exit 1; \ | ||
fi | ||
|
||
WORKDIR /root | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
CMD if [ "$BUILT_MODE" = "compiled" ]; then \ | ||
cd /root/${PROJ_NAME} && python3 warmup.py jupyter; \ | ||
else \ | ||
elif [ "$BUILT_MODE" = "base" ]; then \ | ||
bash; \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters