Ddocker
No description available
Install / Use
/learn @jsikyoon/DdockerREADME
Distributed Docker (ddocker)
To manage multiple machines docker, we implemented simple and light-weight version of distributed docker.
It supports commited image sharing between machines and creates container on a machine having available resource.
Pre-requisites
- Install nvidia-docker on every machine.
- Install netstat on every machine to search available port number for allocation to containers.
Installation
- git clone this repository.
- Write
info.jsonbased oninfo_template.json- master and workers information
- instance type that want to use
- The type value format is
[cpu num, memory size(GB), 'gpu_model1,gpu_model2']
- The type value format is
- The number of CPU and memory size in
bufferare not used anytime. - Port number is allocated from
start_port_num. - Additional options to create container can be added in
additional_optionslike shared volumn.
{
"master":{"host":,"user":},
"workers":[
{"host":,"user":},
{"host":,"user":}
],
"type":{
"12 CPUS, 64 GB": [12, 64, ""],
"12 CPUS, 64 GB, 1 TITAN XP": [12, 64, "TITAN Xp"],
"24 CPUS, 128 GB, 2 TITAN XP": [24, 128, "TITAN Xp,TITAN Xp"],
},
"buffer":{
"cpu": 5,
"mem": 10
},
"start_port_num": 25000,
"additional_options":[
"-v /home/jsikyoon:/home/jsikyoon"
]
}
- Install by
python setup.pysetup.pydoes- Sharing public keys
- Merging the images on master
- It requires that every image name is distinct.
- Checking containers
- Every container need to be removed before starting.
- Add the installed location to PATH
export PATH=<ddocker_LOCATION>:$PATHexport DIST_DOCKER_PATH=<ddocker_LOCATION> - If you are user, please ask administrator to share authorized_keys to connect other machines.
- If you want to usr ddocker on other machines including master or one of workers, please do
- Git clone this repository
- Copy info.json from where you installed
- Copy authorized_keys to connect
- Add the location to PATH
export PATH=<ddocker_LOCATION>:$PATHexport DIST_DOCKER_PATH=<ddocker_LOCATION>
Commands
- It doesn't cover every command of docker, but we tried out to implement the useful commands for ML developments.
$ddocker --help
Usage: ddocker COMMAND [ARGUMENTS]
Commands:
ddocker ps List-up running containers
ddocker ps [-a,--all] List-up every container
ddocker images List-up images
ddocker inspect <CONTAINER_NAME> Container details
ddocker exec <CONTAINER_NAME> Access in container
ddocker start <CONTAINER_NAME> Start container
ddocker stop <CONTAINER_NAME> Stop container
ddocker rm <CONTAINER_NAME> Remove container
ddocker rmi <IMAGE_NAME> Remove image
ddocker nvidia-smi <HOST_NAME> Show GPU usage
ddocker create Create/start container with selected types
ddocker commit <CONTAINER_NAME> <IMAGE_NAME> Commit container
- Almost commands on above list work similar to docker, but
createmakes container by searching not used resources on the cluster. Bellowed is an example.
$ddocker create
Service types.
0 : 12 CPUS, 64 GB
1 : 12 CPUS, 64 GB, 1 TITAN XP
2 : 24 CPUS, 128 GB, 1 TITAN XP
3 : 24 CPUS, 128 GB, 2 TITAN XP
Select one of types (default: 0):
Input the number of ports (default: 1):
Docker Images.
0 : ubuntu:latest
1 : python3_cuda:latest
2 : nvidia/cuda:10.2-base
Select one of types (default: 0): 1
Input Container name (default: jsikyoon_20200530-003533): abc
Start to create
abc
Successfully created!
ddocker ps -aexample
$ddocker ps -a
NAME PORT IMAGE CREATED HOST TYPE RUNNING
abc 0.0.0.0:25000->25000/tcp python3_cuda:latest 20-05-29T15:35:39 jsik-server 12 cpus,64g mem True
Contact
Any feedback is welcome! If you have an issue, please don't hesitate to make issue on this repository.
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
