Skip to content

Commit

Permalink
feat: Added Dockerfile for ubuntu image (#108)
Browse files Browse the repository at this point in the history
* feat: Added Dockerfile for ubuntu image

* chore: Added a CI job to build docker

* docs: Added docker instructions in README

* chore: Fixed CI job to run on Windows
  • Loading branch information
frgfm authored Feb 28, 2021
1 parent 57730be commit 217d461
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,13 @@ jobs:
- name: Build documentation
run: |
sphinx-build docs/source docs/build -a
docker-ready:
runs-on: ubuntu-latest
needs: pkg-install
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker build . -t pyrovision-py3.8.1-torch1.7-slim
- name: Run docker container
run: docker run pyrovision-py3.8.1-torch1.7-slim python -c "import pyrovision; print(pyrovision.__version__)"
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.8.1-slim

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1


COPY ./requirements.txt /tmp/requirements.txt
COPY ./README.md /tmp/README.md
COPY ./setup.py /tmp/setup.py
COPY ./pyrovision /tmp/pyrovision

RUN pip install --upgrade pip setuptools wheel \
&& pip install -e /tmp/. \
&& pip cache purge \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/pip
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ pip install pyronear

## Usage

### datasets
### Python package

Access all pyrovision datasets just like any `torchvision.datasets.VisionDataset`:
You can use the library like any other python package to analyze your documents as follows:

```python
from pyrovision.datasets import OpenFire
Expand All @@ -71,6 +71,16 @@ dataset = OpenFire('./data', download=True)



### Docker container

If you wish to deploy containerized environments, a Dockerfile is provided for you build a docker image:

```shell
docker build . -t <YOUR_IMAGE_TAG>
```



## References

You are free to use any training script, but some are already provided for reference. In order to use them, install the specific requirements and check script options as follows:
Expand Down

0 comments on commit 217d461

Please sign in to comment.