From d47d4f07fe8f8e7e94219ae3f0b195e270125b70 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 13 Aug 2024 09:25:53 +0200 Subject: [PATCH 1/4] update docker ignore --- .dockerignore | 155 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 136 insertions(+), 19 deletions(-) diff --git a/.dockerignore b/.dockerignore index a7dd8dd..04538e5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,19 +1,136 @@ -# python cache -.cache/ -__pycache__/**/* -__pycache__ -*.pyc - -# python distribution -build/**/* -build -dist/**/* -dist -*.egg-info/**/* -*.egg-info -.eggs/**/* -.eggs - -docs - -Makefile +*/_version.py +*/data/test_data/ +output/ +work/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +*.code-workspace From 2fe0049721fbbd7df69e7bf6f8c1687e0b2b8072 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 13 Aug 2024 09:39:25 +0200 Subject: [PATCH 2/4] update docker ingore --- .dockerignore | 2 +- docs/source/changes.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 04538e5..0149aa6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ */_version.py -*/data/test_data/ +ds000017-fmriprep22.0.1-downsampled-nosurface output/ work/ diff --git a/docs/source/changes.md b/docs/source/changes.md index 6fc2728..733a163 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -12,6 +12,7 @@ ### Fixes +- [FIX] Make sure version docker images matches version of package in the image (@Remi-Gau) [#169](https://github.com/bids-apps/giga_connectome/issues/169) - [MAINT] Remove recurrsive import. (@htwangtw) [#135](https://github.com/bids-apps/giga_connectome/issues/135) - [DOCS] Remove`meas` entity in timeseries outputs in the documentation. (@htwangtw) [#136](https://github.com/bids-apps/giga_connectome/issues/136) From b66e91c551fe4b3a62f5bdb5576b13850769fea6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 13 Aug 2024 09:46:44 +0200 Subject: [PATCH 3/4] speed up CLI --- giga_connectome/run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/giga_connectome/run.py b/giga_connectome/run.py index 156594e..660d7b3 100644 --- a/giga_connectome/run.py +++ b/giga_connectome/run.py @@ -5,7 +5,6 @@ from typing import Sequence from giga_connectome import __version__ -from giga_connectome.workflow import workflow from giga_connectome.atlas import get_atlas_labels from giga_connectome.logger import gc_logger @@ -157,6 +156,10 @@ def main(argv: None | Sequence[str] = None) -> None: args = parser.parse_args(argv) + # local import to speed up CLI response + # when just askig for --help or --version + from giga_connectome.workflow import workflow + workflow(args) From df40338ca87e79e09dbcb770950bb5e60cd10ba5 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 13 Aug 2024 12:13:08 +0200 Subject: [PATCH 4/4] print version in CI --- .github/workflows/docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 276b879..58ac604 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,7 +59,10 @@ jobs: docker build . --file Dockerfile --tag ${{env.USER_NAME}}/${{env.REPO_NAME}} mkdir -p ${{ env.IMAGE }} docker save "${{env.USER_NAME}}/${{env.REPO_NAME}}" > "${{ env.IMAGE }}/image.tar" + - name: Check image size and version + run: | docker images + docker run --rm ${{env.USER_NAME}}/${{env.REPO_NAME}} --version - name: Upload docker artifacts uses: actions/upload-artifact@v4 with: