Skip to content

Commit 3b9c063

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

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
```
10+
11+
## Run the image as a container
12+
13+
Assumptions:
14+
- `$PWD` is code-generator source root folder
15+
- To replace `/host/path/to/data` with a path to the input data (for example CIFAR10 and/or VOCdevkit etc), e.g. `/mnt/data`
16+
17+
```bash
18+
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
19+
```
20+
21+
Inside the container we can install all other project related dependencies:
22+
```bash
23+
git config --global --add safe.directory /code
24+
25+
pnpm i --frozen-lockfile --color
26+
pnpm build
27+
pnpm test:ci
28+
```

0 commit comments

Comments
 (0)