From 8cf2494cb6b5a29b237627d7413495cdcdb45bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sat, 14 Oct 2023 23:09:15 +0200 Subject: [PATCH 01/23] feat: add Dockerfile (#6) --- .dockerignore | 8 ++++++++ Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c4be99c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +* +!scRNAsim_toolz/ +!tests/ +!setup.py +!requirements.txt +!environment.yml +!LICENSE +!README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..00df920 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +###### BASE IMAGE ###### +FROM continuumio/miniconda3:4.12.0 + +####### METADATA ####### +LABEL base_image="continuumio/miniconda3:4.12.0" +LABEL version="1.0" +LABEL software="scRNAsim-toolz" +LABEL software.version="v0.1.1" +LABEL about.home="https://github.com/zavolanlab/scRNAsim-toolz" + +###### MAINTAINER ###### +LABEL maintainer="Máté Balajti " + +##### INSTALLATION ##### + +# COPY THE YAML & INSTALL SOFTWARE WITH CONDA +WORKDIR /usr/src/app +COPY ./ ./ +RUN conda env create --file environment.yml \ + && conda clean --all + +# VARIABLES +ARG WORKDIR="/home/USER" +ARG USER="USER" +ARG GROUP="GROUP" +ENV PATH="${WORKDIR}:${PATH}" + +# CREATE USER +RUN groupadd -r ${GROUP} && useradd --no-log-init -r -g ${GROUP} ${USER} + +# SET ENVIRONMENT +WORKDIR ${WORKDIR} +RUN chown -R ${USER}:${GROUP} ${WORKDIR} && chmod 700 ${WORKDIR} +USER ${USER} +RUN echo "source activate scrnasim" > ~/.bashrc +ENV PATH /opt/conda/envs/scrnasim/bin:$PATH + +# SET ENTRYPOINT +ENTRYPOINT ["transcript-sampler"] +CMD ["-v"] \ No newline at end of file From 16624e8cea2f8f7b22c7bb75bfad8a108e7c7ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sat, 14 Oct 2023 23:13:01 +0200 Subject: [PATCH 02/23] update requirements, dev env --- environment-dev.yml | 2 -- requirements.txt | 1 - 2 files changed, 3 deletions(-) diff --git a/environment-dev.yml b/environment-dev.yml index 0f63933..0206f25 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -10,5 +10,3 @@ dependencies: - mypy - pylint - pytest - - pip: - - -e . diff --git a/requirements.txt b/requirements.txt index 64f472d..6ce01ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,4 @@ pandas>=1.4.4 polars==0.16.17 gtfparse setuptools -cli_test_helpers pyarrow From 1d873d259575c6a1fbadbce0ab9db9efc29a19dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sat, 14 Oct 2023 23:20:14 +0200 Subject: [PATCH 03/23] feat: add pr template --- pull_request_template.md | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..d4cfc14 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,43 @@ +### Description + +Please include a summarized description of the change(s) and which issue(s) +this pull request addresses, if any. Please include relevant motivation and +context, unless already duly described in an associated issue or resource. +Make sure to list any dependencies that are required for this change. + +Fixes # (issue) + +### Type of change + +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality + to not work as expected) +- [ ] Documentation update + +### Checklist + +Please carefully read these items and tick them off if the statements are true +_or do not apply_. + +- [ ] I have performed a self-review of my own code +- [ ] My code follows the existing coding style, lints and generates no new + warnings +- [ ] I have added type annotations to all function/method signatures, and I + have added type annotations for any local variables that are non-trivial, + potentially ambiguous or might otherwise benefit from explicit typing. +- [ ] I have commented my code in hard-to-understand areas +- [ ] I have added ["Google-style docstrings"] to all new modules, classes, + methods/functions or updated previously existing ones +- [ ] I have added tests that prove my fix is effective or that my feature + works +- [ ] New and existing unit tests pass locally with my changes and I have not + reduced the code coverage relative to the previous state +- [ ] I have updated any sections of the app's documentation that are affected + by the proposed changes + +If for some reason you are unable to tick off all boxes, please leave a +comment explaining the issue you are facing so that we can work on it +together. \ No newline at end of file From 941b165289e629625eea449e6cb381f46837961b Mon Sep 17 00:00:00 2001 From: balajtimate <51365402+balajtimate@users.noreply.github.com> Date: Sat, 14 Oct 2023 23:34:19 +0200 Subject: [PATCH 04/23] feat: add docker publish to ci (#8) --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5eb94..38148c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,4 +85,40 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml verbose: true - fail_ci_if_error: false \ No newline at end of file + fail_ci_if_error: false + + publish: + name: build and publish app image + runs-on: ubuntu-latest + if: | + github.event_name == 'push' && + github.ref == 'refs/heads/add_docker' + + steps: + + - name: check out repository + uses: actions/checkout@v3 + + - name: generate tag + run: | + echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV + + - name: build and publish image + id: docker + uses: philips-software/docker-ci-scripts@v5.1.0 + with: + dockerfile: . + image-name: "scrnasim-toolz" + tags: "latest ${{ env.TAG }}" + push-branches: 'refs/heads/add_docker' + env: + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} + REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" + DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} + GITHUB_ORGANIZATION: ${{ github.repository_owner }} + + - name: Verify that image was pushed + run: | + echo "Push indicator: ${{ steps.docker.outputs.push-indicator }}" + echo "# Set to 'true' if image was pushed, empty string otherwise" + test "${{ steps.docker.outputs.push-indicator }}" == "true" \ No newline at end of file From e7a250c6802a1d8bb5e6fb9d70ba21c3711db259 Mon Sep 17 00:00:00 2001 From: balajtimate <51365402+balajtimate@users.noreply.github.com> Date: Sun, 15 Oct 2023 10:38:21 +0200 Subject: [PATCH 05/23] test docker ci (#9) --- .github/workflows/ci.yml | 124 +++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38148c2..fbf446b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,82 +10,82 @@ on: jobs: - static-code-analysis: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} + # static-code-analysis: + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash -l {0} - steps: - - name: check out repository - uses: actions/checkout@v4 + # steps: + # - name: check out repository + # uses: actions/checkout@v4 - - name: Setup Conda/Mamba - uses: conda-incubator/setup-miniconda@v2 - with: - mamba-version: "*" - auto-update-conda: true - activate-environment: scrnasim - environment-file: environment.yml - auto-activate-base: false + # - name: Setup Conda/Mamba + # uses: conda-incubator/setup-miniconda@v2 + # with: + # mamba-version: "*" + # auto-update-conda: true + # activate-environment: scrnasim + # environment-file: environment.yml + # auto-activate-base: false - - name: Update scrnasim env with dev packages - run: mamba env update -n scrnasim -f environment-dev.yml + # - name: Update scrnasim env with dev packages + # run: mamba env update -n scrnasim -f environment-dev.yml - - name: display environment info - run: | - conda info -a - conda list + # - name: display environment info + # run: | + # conda info -a + # conda list - - name: flake8 - run: flake8 + # - name: flake8 + # run: flake8 - - name: pylint - run: pylint --rcfile pylint.cfg setup.py scRNAsim_toolz/ + # - name: pylint + # run: pylint --rcfile pylint.cfg setup.py scRNAsim_toolz/ - - name: mypy - run: mypy scRNAsim_toolz + # - name: mypy + # run: mypy scRNAsim_toolz - unit-testing: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} + # unit-testing: + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash -l {0} - steps: + # steps: - - name: checkout repository - uses: actions/checkout@v4 + # - name: checkout repository + # uses: actions/checkout@v4 - - name: setup Conda/Mamba - uses: conda-incubator/setup-miniconda@v2 - with: - mamba-version: "*" - auto-update-conda: true - activate-environment: scrnasim - environment-file: environment.yml - auto-activate-base: false + # - name: setup Conda/Mamba + # uses: conda-incubator/setup-miniconda@v2 + # with: + # mamba-version: "*" + # auto-update-conda: true + # activate-environment: scrnasim + # environment-file: environment.yml + # auto-activate-base: false - - name: update scrnasim env with dev packages - run: mamba env update -n scrnasim -f environment-dev.yml + # - name: update scrnasim env with dev packages + # run: mamba env update -n scrnasim -f environment-dev.yml - - name: display environment info - run: | - conda info -a - conda list + # - name: display environment info + # run: | + # conda info -a + # conda list - - name: run unit tests - run: | - coverage run --source scRNAsim_toolz -m pytest - coverage xml + # - name: run unit tests + # run: | + # coverage run --source scRNAsim_toolz -m pytest + # coverage xml - - name: submit coverage report - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - verbose: true - fail_ci_if_error: false + # - name: submit coverage report + # uses: codecov/codecov-action@v2 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # files: ./coverage.xml + # verbose: true + # fail_ci_if_error: false publish: name: build and publish app image @@ -108,7 +108,7 @@ jobs: uses: philips-software/docker-ci-scripts@v5.1.0 with: dockerfile: . - image-name: "scrnasim-toolz" + image-name: "balajtimate/scrnasim-toolz" tags: "latest ${{ env.TAG }}" push-branches: 'refs/heads/add_docker' env: From 69bd0d61d84a380a3872b32fbb28dc419eb6f95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 10:59:39 +0200 Subject: [PATCH 06/23] update github ci --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbf446b..2abab6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,8 +91,7 @@ jobs: name: build and publish app image runs-on: ubuntu-latest if: | - github.event_name == 'push' && - github.ref == 'refs/heads/add_docker' + github.event_name == 'push' steps: @@ -110,7 +109,7 @@ jobs: dockerfile: . image-name: "balajtimate/scrnasim-toolz" tags: "latest ${{ env.TAG }}" - push-branches: 'refs/heads/add_docker' + push-branches: 'add_docker' env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" From e3fe32bae43ac775c9897b8416c64a9dffc2f7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 11:11:40 +0200 Subject: [PATCH 07/23] fix docker ci --- .github/workflows/ci.yml | 1 - Dockerfile | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2abab6e..3c71767 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,6 @@ jobs: env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" - DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed diff --git a/Dockerfile b/Dockerfile index 00df920..682bfbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,7 @@ LABEL maintainer="Máté Balajti " # COPY THE YAML & INSTALL SOFTWARE WITH CONDA WORKDIR /usr/src/app COPY ./ ./ -RUN conda env create --file environment.yml \ - && conda clean --all +RUN conda env create --file environment.yml # VARIABLES ARG WORKDIR="/home/USER" From eddba5f3624bf2cf92867eed73fa7e482597cfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 11:30:09 +0200 Subject: [PATCH 08/23] fix docker ci --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c71767..a3827ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,6 +113,7 @@ jobs: env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" + DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_LOGIN }} GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed From 713060a636f1e7f374ffbcdeec11f44d74495257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 14:03:04 +0200 Subject: [PATCH 09/23] fix docker ci --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3827ed..9ed1e63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,12 +107,12 @@ jobs: uses: philips-software/docker-ci-scripts@v5.1.0 with: dockerfile: . - image-name: "balajtimate/scrnasim-toolz" - tags: "latest ${{ env.TAG }}" + image-name: "scrnasim-toolz" + tags: balajtimate/scrnasim-toolz:latest push-branches: 'add_docker' env: - REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} - REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" + REGISTRY_USERNAME: ${{ github.actor }} + REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_LOGIN }} GITHUB_ORGANIZATION: ${{ github.repository_owner }} From aba77f3f068d56b9a74ad322c09158f30aef57e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 14:07:01 +0200 Subject: [PATCH 10/23] fix docker ci --- .github/workflows/ci.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed1e63..8f54093 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,25 +96,29 @@ jobs: steps: - name: check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: generate tag run: | echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: build and publish image - id: docker - uses: philips-software/docker-ci-scripts@v5.1.0 + - name: Login to Docker Hub + uses: docker/login-action@v3 with: - dockerfile: . - image-name: "scrnasim-toolz" + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true tags: balajtimate/scrnasim-toolz:latest push-branches: 'add_docker' - env: - REGISTRY_USERNAME: ${{ github.actor }} - REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_LOGIN }} - GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed run: | From f7966745bfca113826498b0395392ee1394868d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 14:08:09 +0200 Subject: [PATCH 11/23] fix docker ci --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f54093..84d4499 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,12 +102,6 @@ jobs: run: | echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 6996d9691cb7312ac56914d5f1c3e78bae7da335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 16:55:08 +0200 Subject: [PATCH 12/23] fix docker ci --- .github/workflows/ci.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84d4499..e617c62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,17 +102,19 @@ jobs: run: | echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v5 + - name: build and publish image + id: docker + uses: philips-software/docker-ci-scripts@v5.1.0 with: - context: . - file: ./Dockerfile - push: true - tags: balajtimate/scrnasim-toolz:latest + dockerfile: . + image-name: "scrnasim-toolz" + tags: "latest ${{ env.TAG }}" push-branches: 'add_docker' + env: + REGISTRY_USERNAME: ${{ github.actor }} + REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_ORGANIZATION: balajtimate + GITHUB_ORGANIZATION: balajtimate - name: Verify that image was pushed run: | From 0e83a60b5d5a3a5a35774338f6f5f6b1864bcb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 17:10:57 +0200 Subject: [PATCH 13/23] fix docker ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e617c62..6c90070 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: - name: build and publish image id: docker - uses: philips-software/docker-ci-scripts@v5.1.0 + uses: docker/build-push-action@v5 with: dockerfile: . image-name: "scrnasim-toolz" From e132f9462eb9610d5bcfa467a791477f03337bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 17:16:35 +0200 Subject: [PATCH 14/23] fix docker ci --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c90070..7762c49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,8 @@ jobs: with: dockerfile: . image-name: "scrnasim-toolz" - tags: "latest ${{ env.TAG }}" + push: true + tags: balajtimate/scrnasim-toolz:latest push-branches: 'add_docker' env: REGISTRY_USERNAME: ${{ github.actor }} From e3fabe590bc597b3f5e73c6c388ec79f6fc7a4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Sun, 15 Oct 2023 17:27:03 +0200 Subject: [PATCH 15/23] fix docker ci --- .github/workflows/ci.yml | 13 ++++++------- environment.yml | 16 ++++++++-------- requirements.txt | 12 ++++++------ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7762c49..ce2e233 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,15 +107,14 @@ jobs: uses: docker/build-push-action@v5 with: dockerfile: . - image-name: "scrnasim-toolz" + image-name: "balajtimate/scrnasim-toolz" push: true - tags: balajtimate/scrnasim-toolz:latest + tags: "balajtimate/scrnasim-toolz:latest" push-branches: 'add_docker' - env: - REGISTRY_USERNAME: ${{ github.actor }} - REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCKER_ORGANIZATION: balajtimate - GITHUB_ORGANIZATION: balajtimate + # env: + # REGISTRY_USERNAME: ${{ github.actor }} + # REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # DOCKER_ORGANIZATION: balajtimate - name: Verify that image was pushed run: | diff --git a/environment.yml b/environment.yml index 7d229b9..9964f24 100644 --- a/environment.yml +++ b/environment.yml @@ -3,14 +3,14 @@ channels: - conda-forge - bioconda dependencies: - - biopython>=1.78 - - polars==0.16.17 - - gtfparse - - numpy>=1.23.3 - - nextflow - - pandas>=1.4.4 - pip>=20.2.3 - - python>=3.6, <=3.10 - - pyarrow + # - biopython>=1.78 + # - polars==0.16.17 + # - gtfparse + # - numpy>=1.23.3 + # - nextflow + # - pandas>=1.4.4 + # - python>=3.6, <=3.10 + # - pyarrow - pip: - -e . diff --git a/requirements.txt b/requirements.txt index 6ce01ec..8641e43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -biopython>=1.78 -numpy>=1.23.3 -pandas>=1.4.4 -polars==0.16.17 -gtfparse +# biopython>=1.78 +# numpy>=1.23.3 +# pandas>=1.4.4 +# polars==0.16.17 +# gtfparse setuptools -pyarrow +# pyarrow From 6972bae7e5e771013b98792b1b654552a2cd94fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 11:53:51 +0200 Subject: [PATCH 16/23] fix docker ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce2e233..be42a77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,7 +107,7 @@ jobs: uses: docker/build-push-action@v5 with: dockerfile: . - image-name: "balajtimate/scrnasim-toolz" + image-name: "scrnasim-toolz" push: true tags: "balajtimate/scrnasim-toolz:latest" push-branches: 'add_docker' From 90876ee5ced4529242dc773d7f936a68539077fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:05:23 +0200 Subject: [PATCH 17/23] fix docker ci --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be42a77..15c8892 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,12 @@ jobs: run: | echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: build and publish image id: docker uses: docker/build-push-action@v5 From ff9c6ba82b4ddbe016d698ab96e30736ccb82e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:22:44 +0200 Subject: [PATCH 18/23] fix docker ci --- .github/workflows/ci.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15c8892..998a8a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,25 +102,19 @@ jobs: run: | echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: build and publish image id: docker - uses: docker/build-push-action@v5 + uses: philips-software/docker-ci-scripts@v5.1.0 with: dockerfile: . image-name: "scrnasim-toolz" - push: true - tags: "balajtimate/scrnasim-toolz:latest" - push-branches: 'add_docker' - # env: - # REGISTRY_USERNAME: ${{ github.actor }} - # REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # DOCKER_ORGANIZATION: balajtimate + tags: "latest ${{ env.TAG }}" + push-branches: add_docker + env: + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} + REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" + DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} + GITHUB_ORGANIZATION: balajtimate - name: Verify that image was pushed run: | From dcace762712132d304ca732bc9a031fcfcc9e15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:30:48 +0200 Subject: [PATCH 19/23] fix docker ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 998a8a5..94cf96f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,7 @@ jobs: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} - GITHUB_ORGANIZATION: balajtimate + GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed run: | From fa70c318ac85ccac99d6a120f26a43387d907e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:35:01 +0200 Subject: [PATCH 20/23] fix docker ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94cf96f..8c1cdf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" - DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} + DOCKER_ORGANIZATION: balajtimate GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed From f75d46bd51a080d450f0ab5823bd0d5ca6fea753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:40:09 +0200 Subject: [PATCH 21/23] fix docker ci --- .github/workflows/ci.yml | 124 +++++++++++++++++++-------------------- environment.yml | 16 ++--- requirements.txt | 12 ++-- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c1cdf4..95fafb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,82 +10,82 @@ on: jobs: - # static-code-analysis: - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash -l {0} + static-code-analysis: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} - # steps: - # - name: check out repository - # uses: actions/checkout@v4 + steps: + - name: check out repository + uses: actions/checkout@v4 - # - name: Setup Conda/Mamba - # uses: conda-incubator/setup-miniconda@v2 - # with: - # mamba-version: "*" - # auto-update-conda: true - # activate-environment: scrnasim - # environment-file: environment.yml - # auto-activate-base: false + - name: Setup Conda/Mamba + uses: conda-incubator/setup-miniconda@v2 + with: + mamba-version: "*" + auto-update-conda: true + activate-environment: scrnasim + environment-file: environment.yml + auto-activate-base: false - # - name: Update scrnasim env with dev packages - # run: mamba env update -n scrnasim -f environment-dev.yml + - name: Update scrnasim env with dev packages + run: mamba env update -n scrnasim -f environment-dev.yml - # - name: display environment info - # run: | - # conda info -a - # conda list + - name: display environment info + run: | + conda info -a + conda list - # - name: flake8 - # run: flake8 + - name: flake8 + run: flake8 - # - name: pylint - # run: pylint --rcfile pylint.cfg setup.py scRNAsim_toolz/ + - name: pylint + run: pylint --rcfile pylint.cfg setup.py scRNAsim_toolz/ - # - name: mypy - # run: mypy scRNAsim_toolz + - name: mypy + run: mypy scRNAsim_toolz - # unit-testing: - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash -l {0} + unit-testing: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} - # steps: + steps: - # - name: checkout repository - # uses: actions/checkout@v4 + - name: checkout repository + uses: actions/checkout@v4 - # - name: setup Conda/Mamba - # uses: conda-incubator/setup-miniconda@v2 - # with: - # mamba-version: "*" - # auto-update-conda: true - # activate-environment: scrnasim - # environment-file: environment.yml - # auto-activate-base: false + - name: setup Conda/Mamba + uses: conda-incubator/setup-miniconda@v2 + with: + mamba-version: "*" + auto-update-conda: true + activate-environment: scrnasim + environment-file: environment.yml + auto-activate-base: false - # - name: update scrnasim env with dev packages - # run: mamba env update -n scrnasim -f environment-dev.yml + - name: update scrnasim env with dev packages + run: mamba env update -n scrnasim -f environment-dev.yml - # - name: display environment info - # run: | - # conda info -a - # conda list + - name: display environment info + run: | + conda info -a + conda list - # - name: run unit tests - # run: | - # coverage run --source scRNAsim_toolz -m pytest - # coverage xml + - name: run unit tests + run: | + coverage run --source scRNAsim_toolz -m pytest + coverage xml - # - name: submit coverage report - # uses: codecov/codecov-action@v2 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} - # files: ./coverage.xml - # verbose: true - # fail_ci_if_error: false + - name: submit coverage report + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + verbose: true + fail_ci_if_error: false publish: name: build and publish app image @@ -113,7 +113,7 @@ jobs: env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" - DOCKER_ORGANIZATION: balajtimate + DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} GITHUB_ORGANIZATION: ${{ github.repository_owner }} - name: Verify that image was pushed diff --git a/environment.yml b/environment.yml index 9964f24..576a543 100644 --- a/environment.yml +++ b/environment.yml @@ -4,13 +4,13 @@ channels: - bioconda dependencies: - pip>=20.2.3 - # - biopython>=1.78 - # - polars==0.16.17 - # - gtfparse - # - numpy>=1.23.3 - # - nextflow - # - pandas>=1.4.4 - # - python>=3.6, <=3.10 - # - pyarrow + - biopython>=1.78 + - polars==0.16.17 + - gtfparse + - numpy>=1.23.3 + - nextflow + - pandas>=1.4.4 + - python>=3.6, <=3.10 + - pyarrow - pip: - -e . diff --git a/requirements.txt b/requirements.txt index 8641e43..6ce01ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -# biopython>=1.78 -# numpy>=1.23.3 -# pandas>=1.4.4 -# polars==0.16.17 -# gtfparse +biopython>=1.78 +numpy>=1.23.3 +pandas>=1.4.4 +polars==0.16.17 +gtfparse setuptools -# pyarrow +pyarrow From 7b1290f92955156a7a004b5e801b182d8ca11bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:52:06 +0200 Subject: [PATCH 22/23] update req with cli_test_helpers --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 6ce01ec..92c62c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ polars==0.16.17 gtfparse setuptools pyarrow +cli_test_helpers From 1a8c7af5fa0f2612146eeeff2a2d0e035faf8b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Balajti?= Date: Mon, 16 Oct 2023 12:53:30 +0200 Subject: [PATCH 23/23] feat: update ci with docker #6 --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95fafb2..4dbe371 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,8 @@ jobs: name: build and publish app image runs-on: ubuntu-latest if: | - github.event_name == 'push' + github.event_name == 'push' && + github.ref == format('refs/heads/{0}', github.event.repository.default_branch) steps: @@ -109,7 +110,7 @@ jobs: dockerfile: . image-name: "scrnasim-toolz" tags: "latest ${{ env.TAG }}" - push-branches: add_docker + push-branches: "${{ github.event.repository.default_branch }}" env: REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"