Add docker compose file

This makes it a lot easier to use locally on docker, and a lot easier to
move files in/out, as well as save notebooks.
This commit is contained in:
Kelvie Wong 2023-05-28 11:17:57 -07:00
parent 803cadfd53
commit 249065f127
5 changed files with 42 additions and 5 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@
.ssh_config
*inference*.yaml
.idea
/.cache
/models

View File

@ -48,6 +48,18 @@ Double check your python version again after setup by running these two commands
Again, this should show 3.10.x
## Docker container
## Local docker container
`docker run -it -p 8888:8888 -p 6006:6006 --gpus all -e JUPYTER_PASSWORD=test1234 -t ghcr.io/victorchall/everydream2trainer:nightly`
```sh
docker compose up
```
And you can either get a shell via:
```sh
docker exec -it everydream2trainer-docker-everydream2trainer-1 /bin/bash
```
Or go to your browser and hit `http://localhost:8888`. The web password is
`test1234` but you can change that in `docker-compose.yml`.
Your current source directory will be moutned to the Jupyter notebook.

19
docker-compose.yml Normal file
View File

@ -0,0 +1,19 @@
version: '3.8'
services:
everydream2trainer:
image: ghcr.io/victorchall/everydream2trainer:nightly
ports:
- "127.0.0.1:8888:8888"
- "127.0.0.1:6006:6006"
environment:
- JUPYTER_PASSWORD=test1234
volumes:
- .:/workspace/EveryDream2trainer
- ./.cache:/root/.cache
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]

View File

@ -87,10 +87,8 @@ ARG CACHEBUST=1
RUN git clone https://github.com/victorchall/EveryDream2trainer
WORKDIR /workspace/EveryDream2trainer
RUN python utils/get_yamls.py && \
mkdir -p logs && mkdir -p input
ADD welcome.txt /
ADD start.sh /
RUN chmod +x /start.sh
CMD [ "/start.sh" ]
CMD [ "/start.sh" ]

View File

@ -2,6 +2,12 @@
cat /welcome.txt
export PYTHONUNBUFFERED=1
if [[ ! -f "v2-inference-v.yaml" ]]; then
python utils/get_yamls.py
fi
mkdir -p logs input
# RunPod SSH
if [[ -v "PUBLIC_KEY" ]] && [[ ! -d "${HOME}/.ssh" ]]
then