-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from daisybio/development
New version including DIPK
- Loading branch information
Showing
88 changed files
with
5,677 additions
and
3,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Create and publish a Docker image | ||
|
||
# Configures this workflow to run every time a release is published | ||
on: | ||
release: | ||
types: [published] | ||
|
||
# Defines two custom environment variables for the workflow. | ||
# These are used for the Container registry domain, and a name for the Docker image that this workflow builds. | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. | ||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
# Necessary for buildx | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# Set up BuildKit Docker container builder to be able to build | ||
# multi-platform images and export cache | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. | ||
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. | ||
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ name: Run drevalpy Tests | |
on: | ||
push: | ||
branches: | ||
- development | ||
- main | ||
- "release/*" | ||
pull_request: | ||
branches: | ||
|
@@ -23,7 +21,6 @@ jobs: | |
- { python-version: "3.10", os: ubuntu-latest, session: "mypy" } | ||
- { python-version: "3.10", os: ubuntu-latest, session: "tests" } | ||
- { python-version: "3.10", os: windows-latest, session: "tests" } | ||
- { python-version: "3.10", os: macos-latest, session: "tests" } | ||
- { python-version: "3.10", os: ubuntu-latest, session: "typeguard" } | ||
- { python-version: "3.10", os: ubuntu-latest, session: "xdoctest" } | ||
- { python-version: "3.10", os: ubuntu-latest, session: "docs-build" } | ||
|
@@ -130,4 +127,6 @@ jobs: | |
run: nox --force-color --session=coverage -- xml -i | ||
|
||
- name: Upload coverage report | ||
uses: codecov/[email protected] | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# I followed this article's recommendations | ||
# https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0 | ||
|
||
# The builder image, used to build the virtual environment | ||
FROM python:3.10-buster as builder | ||
|
||
RUN pip install poetry==1.8.4 | ||
|
||
# POETRY_VIRTUALENVS_CREATE=1: Makes sure that environment will be as isolated as possible and above all that | ||
# installation will not mess up with the system Python or, even worse, with Poetry itself. | ||
# POETRY_CACHE_DIR: When removing the cache folder, make sure this is done in the same RUN command. If it’s done in a | ||
# separate RUN command, the cache will still be part of the previous Docker layer (the one containing poetry install ) | ||
# effectively rendering your optimization useless. | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /root | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
|
||
# First, we install only the dependencies. This way, we can cache this layer and avoid re-installing dependencies | ||
# every time we change our application code. | ||
# Because poetry will complain if a README.md is not found, we create a dummy one. | ||
RUN touch README.md | ||
|
||
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR | ||
|
||
# The runtime image, used to run the code | ||
FROM python:3.10-slim-buster as runtime | ||
|
||
LABEL image.author.name="Judith Bernett" | ||
LABEL image.author.email="[email protected]" | ||
|
||
ENV VIRTUAL_ENV=/root/.venv \ | ||
PATH="/root/.venv/bin:$PATH" | ||
|
||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
# Copy all relevant code | ||
|
||
COPY drevalpy ./drevalpy | ||
COPY create_report.py ./ | ||
COPY README.md ./ | ||
COPY run_suite.py ./ | ||
COPY setup.py ./ | ||
COPY pyproject.toml ./ | ||
COPY poetry.lock ./ | ||
|
||
# Install drevalpy | ||
RUN pip install . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.