Skip to content

SimonLeeGit/Docker4ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker4ML

License Docker

Project Repository: https://github.com/SimonLeeGit/Docker4ML

Useful docker scripts for ML developement. You can integrated to your project in the docker folder.

integrate

Build Docker Image

You can build your development docker image as below.

bash docker/build.sh

build_docker

Run Docker Container as Development Envirnoment

You can run built development docker container as your development environment as below.

bash docker/run.sh

run_docker

Custom Docker Config

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

TAG

Your built docker image tag, you can set it as what you what.

CI_TAG

Your bult docker image tag for ci usage, you can set it as what you what.

BASE_IMG

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

USER_PASSWD

Your user password used in docker container, your user name will keep according with your host user name.

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

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

Config [*installscript.sh]

You can add your custom script to run when build docker image.

You can add your custom script to run when docker container run.

GitHub WorkFlow Support

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.

github_secrets

Finally, you can check the actions for the workflow result.

github_action

Alos, you can build your CI docker image in local machine.

Build CI Docker Image

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>

build_docker_ci

Run CI Docker Container at cloud envirnoment

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

run_docker_ci

Q&A

If you have any use problems, please contact to simonlee235@gmail.com.

About

Useful docker scripts for ML developement.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages