-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
284 additions
and
247 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,86 @@ | ||
--- | ||
name: Test with docker compose | ||
name: proWES checks | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
pull_request: | ||
branches: [ dev ] | ||
|
||
|
||
jobs: | ||
build: | ||
lint: | ||
name: Run linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install requirements | ||
run: | | ||
pip install -r requirements_dev.txt | ||
pip install . | ||
- name: Lint with Flake8 | ||
run: flake8 | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
env: | ||
PROBE_ENDPOINT: localhost:8080/ga4gh/wes/v1/ui/ | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: ["3.7", "3.8","3.9", "3.10"] | ||
|
||
PROBE_ENDPOINT: localhost:8090/ga4gh/wes/v1/service-info | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: pip install docker-compose | ||
- name: Create data directories | ||
run: mkdir -p ${HOME}/data/{db,output,tmp} | ||
- name: Docker compose up | ||
run: docker-compose up -d | ||
- name: Sleep 30 | ||
run: sleep 30 | ||
- name: PROBE | ||
run: echo "${PROBE_ENDPOINT}" | ||
- name: Test | ||
run: | | ||
test $( \ | ||
curl \ | ||
-sL \ | ||
-v \ | ||
-o /dev/null \ | ||
-w '%{http_code}' \ | ||
-X GET \ | ||
--header 'Accept: application/json' \ | ||
"${PROBE_ENDPOINT}" \ | ||
) == '200' || exit 1 | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Deploy app | ||
run: docker-compose up -d --build | ||
- name: Wait for app startup | ||
run: sleep 20 | ||
- name: Probe endpoint | ||
run: | | ||
test $( \ | ||
curl \ | ||
-sL \ | ||
-v \ | ||
-o /dev/null \ | ||
-w '%{http_code}' \ | ||
-X GET \ | ||
--header 'Accept: application/json' \ | ||
"${PROBE_ENDPOINT}" \ | ||
) == '200' || exit 1 | ||
publish: | ||
name: Build and publish app image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'push' }} | ||
needs: [lint, test] | ||
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/[email protected] | ||
with: | ||
dockerfile: . | ||
image-name: "prowes" | ||
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" |
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 |
---|---|---|
@@ -1,43 +1,24 @@ | ||
##### BASE IMAGE ##### | ||
FROM elixircloud/foca:20220524-py3.7 | ||
FROM elixircloud/foca:20230818-py3.10 | ||
|
||
##### METADATA ##### | ||
LABEL base.image="elixircloud/foca:20220524-py3.7" | ||
LABEL version="2.0" | ||
LABEL version="3.0" | ||
LABEL software="proWES" | ||
LABEL software.version="0.15.0" | ||
LABEL software.description="Flask microservice implementing the Global Alliance for Genomics and Health (GA4GH) Workflow Execution Service (WES) API specification." | ||
LABEL software.description="Flask microservice implementing the Global Alliance for Genomics and Health (GA4GH) Workflow Execution Service (WES) API specification as a proxy for middleware injection (e.g., workflow distribution logic)." | ||
LABEL software.website="https://github.com/elixir-europe/proWES" | ||
LABEL software.documentation="https://github.com/elixir-europe/proWES" | ||
LABEL software.license="https://github.com/elixir-europe/proWES/blob/master/LICENSE" | ||
LABEL software.tags="General" | ||
LABEL maintainer="[email protected]" | ||
LABEL maintainer.organisation="Biozentrum, University of Basel" | ||
LABEL maintainer.location="Klingelbergstrasse 50/70, CH-4056 Basel, Switzerland" | ||
LABEL maintainer.lab="ELIXIR Cloud & AAI" | ||
LABEL maintainer.license="https://spdx.org/licenses/Apache-2.0" | ||
LABEL software.license="https://spdx.org/licenses/Apache-2.0" | ||
LABEL maintainer="[email protected]" | ||
LABEL maintainer.organisation="ELIXIR Cloud & AAI" | ||
|
||
# Python UserID workaround for OpenShift/K8S | ||
ENV LOGNAME=ipython | ||
ENV USER=ipython | ||
|
||
## Set working directory | ||
WORKDIR /app | ||
COPY ./ . | ||
RUN pip install -e . | ||
|
||
## Copy Python requirements | ||
COPY ./requirements.txt /app/requirements.txt | ||
COPY ./requirements_dev.txt /app/requirements_dev.txt | ||
|
||
## Install Python dependencies | ||
RUN cd /app \ | ||
&& pip install -r requirements.txt \ | ||
&& pip install -r requirements_dev.txt \ | ||
&& cd / | ||
|
||
## Copy remaining app files | ||
COPY ./ /app | ||
|
||
## Install app | ||
RUN cd /app \ | ||
&& python setup.py develop \ | ||
&& cd / | ||
## Add permissions for storing updated API specification | ||
## (required by FOCA) | ||
RUN chmod -R a+rwx /app/pro_wes/api |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.17.0' | ||
"""proWES app package root.""" |
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,12 @@ | ||
"""Celery worker entry point.""" | ||
|
||
from pathlib import Path | ||
|
||
from celery import Celery | ||
from foca import Foca # type: ignore | ||
|
||
foca = Foca( | ||
config_file=Path(__file__).resolve().parent / "config.yaml", | ||
custom_config_model="pro_wes.config_models.CustomConfig", | ||
) | ||
celery: Celery = foca.create_celery_app() |
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.