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/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5eb94..4dbe371 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 == format('refs/heads/{0}', github.event.repository.default_branch) + + steps: + + - name: check out repository + 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 + with: + dockerfile: . + image-name: "scrnasim-toolz" + tags: "latest ${{ env.TAG }}" + push-branches: "${{ github.event.repository.default_branch }}" + 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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..682bfbc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +###### 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 + +# 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 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/environment.yml b/environment.yml index 7d229b9..576a543 100644 --- a/environment.yml +++ b/environment.yml @@ -3,13 +3,13 @@ channels: - conda-forge - bioconda dependencies: + - pip>=20.2.3 - 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 - pip: 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 diff --git a/requirements.txt b/requirements.txt index 64f472d..92c62c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ pandas>=1.4.4 polars==0.16.17 gtfparse setuptools -cli_test_helpers pyarrow +cli_test_helpers