diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..549e63bad5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +# Ignore the following files/folders during docker build + +__pycache__/ +docs/ + +.coverage +.readthedocs.yml +*.md +*.toml + +!README.md + diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 4fc90ca520..d9ffdb7f5e 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -61,6 +61,7 @@ jobs: runs-on: [self-hosted, linux, x64, common] steps: - name: Run tests report coverage + # The docker image process has done the compilation. BUILD_MONAI=1 may not be necessary. run: | cd /opt/monai nvidia-smi diff --git a/Dockerfile b/Dockerfile index 60460fd1a5..9430db076b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ FROM ${PYTORCH_IMAGE} MAINTAINER MONAI Consortium WORKDIR /opt/monai -ENV PATH=/opt/tools:${PATH} # install full deps COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/ @@ -28,7 +27,11 @@ RUN cp /tmp/requirements.txt /tmp/req.bak \ # TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276) # please specify exact files and folders to be copied -- else, basically always, the Docker build process cannot cache # this or anything below it and always will build from at most here; one file change leads to no caching from here on... -COPY . . + +COPY LICENSE setup.py setup.cfg versioneer.py runtests.sh .gitignore .gitattributes README.md MANIFEST.in ./ +COPY tests ./tests +COPY monai ./monai +COPY .git ./.git RUN BUILD_MONAI=1 FORCE_CUDA=1 python setup.py develop \ && rm -rf build __pycache__