Project Repository: https://github.com/SimonLeeGit/Docker4ML
Useful docker scripts for ML developement. You can integrated to your project in the docker folder.
You can build your development docker image as below.
bash docker/build.sh
You can run built development docker container as your development environment as below.
bash docker/run.sh
Config setup_env.sh
You can modify this file to custom your settings.
# Docker tag for new build image
TAG=ml:dev
CI_TAG=ml:ci
# Base docker image tag used by docker build
BASE_IMG=nvcr.io/nvidia/pytorch:24.01-py3
# User password used in docker container
USER_PASSWD=666666
Your built docker image tag, you can set it as what you what.
Your bult docker image tag for ci usage, you can set it as what you what.
The base docker image tag for your built docker image, here we use nvidia pytorch images. You can check it from https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch/tags
Your user password used in docker container, your user name will keep according with your host user name.
Config requriements.txt
You can add your default installed python libraries here.
transformers==4.27.1
By default, it has some libs installed, you can check it from https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-01.html
Config packages.txt
You can add your default apt-get installed packages here.
wget
curl
Config ports.txt
You can add some ports enabled for docker container here.
-p 6006:6006
-p 8080:8080
- preinstallscript.sh: executed before pip installation
- postinstallscript.sh: executed after pip installation
You can add your custom script to run when build docker image.
Config entryscript.sh
You can add your custom script to run when docker container run.
You can add github workflow by copy docker_build_ci.yaml to the path .github/workflows/ in your github repo.
Then, you should set DOCKER_USERNAME and DOCKER_ACCESS_TOKEN in GitHub settings.
Finally, you can check the actions for the workflow result.
Alos, you can build your CI docker image in local machine.
You can also build a CI docker image for your app to be runned at cloud environment.
bash docker/ci/build_ci.sh -d <project_dir>
bash docker/ci/run_ci.sh <cmd>
# <cmd> is your custom command to be runned in CI docker container, such as:
#
# bash docker/ci/run_ci.sh echo "hello world"
# bash docker/ci/run_ci.sh bash main.sh
# bash docker/ci/run_ci.sh python main.py
If you have any use problems, please contact to simonlee235@gmail.com.