-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from aisingapore/0.3.1-cvgpu
[Fix] 0.3.1 - Get GPU image to use GPU resources
- Loading branch information
Showing
6 changed files
with
106 additions
and
17 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
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
53 changes: 53 additions & 0 deletions
53
...ecutter.repo_name}}/problem-templates/cv/docker/{{cookiecutter.repo_name}}-gpu.Dockerfile
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND="noninteractive" | ||
|
||
ARG NON_ROOT_USER="aisg" | ||
ARG NON_ROOT_UID="2222" | ||
ARG NON_ROOT_GID="2222" | ||
ARG HOME_DIR="/home/${NON_ROOT_USER}" | ||
|
||
ARG REPO_DIR="." | ||
ARG CONDA_ENV_FILE="{{cookiecutter.repo_name}}-conda-env-gpu.yaml" | ||
ARG CONDA_ENV_NAME="{{cookiecutter.repo_name}}" | ||
|
||
# Miniconda arguments | ||
ARG CONDA_HOME="/miniconda3" | ||
ARG CONDA_BIN="${CONDA_HOME}/bin/conda" | ||
ARG CONDA_VER="py310_23.5.2-0" | ||
ARG CONDA_ARCH="Linux-x86_64" | ||
ARG MINICONDA_SH="Miniconda3-${CONDA_VER}-${CONDA_ARCH}.sh" | ||
|
||
RUN useradd -l -m -s /bin/bash -u ${NON_ROOT_UID} ${NON_ROOT_USER} && \ | ||
mkdir -p ${CONDA_HOME} && \ | ||
chown -R ${NON_ROOT_USER}:${NON_ROOT_GID} ${CONDA_HOME} | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install bzip2 curl wget gcc rsync git vim locales && \ | ||
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
locale-gen && \ | ||
dpkg-reconfigure --frontend=noninteractive locales && \ | ||
update-locale LANG=en_US.UTF-8 && \ | ||
apt-get clean | ||
|
||
ENV PYTHONIOENCODING utf8 | ||
ENV LANG "C.UTF-8" | ||
ENV LC_ALL "C.UTF-8" | ||
|
||
USER ${NON_ROOT_USER} | ||
WORKDIR ${HOME_DIR} | ||
|
||
COPY --chown=${NON_ROOT_USER}:${NON_ROOT_GID} ${REPO_DIR} {{cookiecutter.repo_name}} | ||
|
||
# Install Miniconda | ||
RUN curl -O https://repo.anaconda.com/miniconda/$MINICONDA_SH && \ | ||
chmod +x ${MINICONDA_SH} && \ | ||
./${MINICONDA_SH} -u -b -p ${CONDA_HOME} && \ | ||
rm ${MINICONDA_SH} | ||
ENV PATH ${CONDA_HOME}/bin:${HOME_DIR}/.local/bin:$PATH | ||
|
||
# Install conda environment | ||
RUN ${CONDA_BIN} env create -f {{cookiecutter.repo_name}}/${CONDA_ENV_FILE} && \ | ||
${CONDA_BIN} init bash && \ | ||
${CONDA_BIN} clean -a -y && \ | ||
echo "source activate ${CONDA_ENV_NAME}" >> "${HOME_DIR}/.bashrc" |
26 changes: 26 additions & 0 deletions
26
...okiecutter.repo_name}}/problem-templates/cv/{{cookiecutter.repo_name}}-conda-env-gpu.yaml
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: {{cookiecutter.repo_name}} | ||
channels: | ||
- defaults | ||
- pytorch | ||
- nvidia | ||
- conda-forge | ||
dependencies: | ||
- pytorch=2.1.2 | ||
- torchvision=0.16.2 | ||
- pytorch-cuda=12.1 | ||
- python=3.11.7 | ||
- pip=23.3.2 | ||
- pip: | ||
- mlflow-skinny==2.9.2 | ||
- hydra-core==1.3.2 | ||
- hydra-optuna-sweeper==1.2.0 | ||
- python-json-logger==2.0.7 | ||
- fastapi==0.109.0 | ||
- uvicorn[standard]==0.25.0 | ||
- python-multipart==0.0.6 | ||
- jsonlines==4.0.0 | ||
- pandas==2.1.4 | ||
- gunicorn==21.2.0 | ||
- pydantic==2.5.3 | ||
- pydantic-settings==2.1.0 | ||
- ipykernel==6.25.0 |