Skip to content

Commit f6296c5

Browse files
committed
Added docker folder with Dockerfile for local development
1 parent b25945f commit f6296c5

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docker/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM continuumio/miniconda3:23.3.1-0
2+
3+
# Install nodejs v18
4+
RUN apt-get update && \
5+
apt-get install -y curl && \
6+
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
7+
apt-get install -y nodejs
8+
9+
# Install pnpm and few python code-generator deps
10+
# Taken from .github/workflows/ci.yml
11+
RUN pip install wheel setuptools pip -Uqq && \
12+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && \
13+
pip install pytorch-ignite pyyaml albumentations image_dataset_viz pytest transformers datasets tensorboard && \
14+
npm i -g pnpm && \
15+
npx playwright install

docker/readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Docker image for local development
2+
3+
## Build development docker image
4+
5+
```bash
6+
# Assuming the current folder to be code-generator source root folder
7+
cd docker
8+
docker build --tag pytorchignite/codegenerator:dev .
9+
cd ../
10+
```
11+
12+
## Run the image as a container
13+
14+
Assumptions:
15+
- `$PWD` is code-generator source root folder
16+
- To replace `/host/path/to/data` with a path to the input data (for example CIFAR10 and/or VOCdevkit etc), e.g. `/mnt/data`
17+
18+
```bash
19+
# Assuming the current folder to be code-generator source root folder
20+
docker run --name=codegen-dev -it -v $PWD:/code -w /code -v /data:/host/path/to/data --network=host --ipc=host pytorchignite/codegenerator:dev /bin/bash
21+
```
22+
23+
Inside the container we can install all other project related dependencies:
24+
```bash
25+
git config --global --add safe.directory /code
26+
27+
pnpm i --frozen-lockfile --color
28+
pnpm build
29+
pnpm test:ci
30+
```

0 commit comments

Comments
 (0)