Skip to content

Commit

Permalink
refactor: upgrade FOCA & major app rewrite (#248)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Kanitz <alexander.kanitz@alumni.ethz.ch>
Co-authored-by: Alex Kanitz <alexander.kanitz@unibas.ch>
  • Loading branch information
3 people authored Jan 11, 2024
1 parent 00b7c46 commit b4958f8
Show file tree
Hide file tree
Showing 70 changed files with 2,541 additions and 3,302 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: cwl-WES checks

on:
push:
branches: [dev]
pull_request:
branches: [dev]

jobs:
lint:
name: Run linting
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install requirements
run: |
pip install .
pip install -r requirements_dev.txt
- name: Lint with Flake8
run: flake8 cwl_wes/ setup.py
- name: Lint with Pylint
run: pylint cwl_wes/ setup.py
test:
name: Run tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Deploy app
run: docker-compose up -d --build
- name: Wait for app startup
shell: bash
run: sleep 20
- name: Run integration tests
shell: bash
run: bash tests/integration_tests.sh
- name: Tear down app
run: docker-compose down
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@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.0.0
with:
dockerfile: .
image-name: "cwl-wes"
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"
56 changes: 0 additions & 56 deletions .github/workflows/docker-image.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/pr-test.yaml

This file was deleted.

51 changes: 12 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,51 +1,24 @@
##### BASE IMAGE #####
FROM python:3.7-slim-stretch
FROM elixircloud/foca:20221110-py3.7

##### METADATA #####
LABEL base.image="python:3.6-slim-stretch"
LABEL version="1.1"
LABEL version="2.0"
LABEL software="cwl-WES"
LABEL software.version="1.0"
LABEL software.description="Flask microservice implementing the Global Alliance for Genomics and Health (GA4GH) Workflow Execution Service (WES) API specification."
LABEL software.description="Trigger CWL workflows via GA4GH WES and TES"
LABEL software.website="https://github.com/elixir-cloud-aai/cwl-WES"
LABEL software.documentation="https://github.com/elixir-cloud-aai/cwl-WES"
LABEL software.license="https://github.com/elixir-cloud-aai/cwl-WES/blob/master/LICENSE"
LABEL software.tags="General"
LABEL maintainer="alexander.kanitz@alumni.ethz.ch"
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="cloud-service@elixir-europe.org"
LABEL maintainer.organisation="ELIXIR Cloud & AAI"

# Python UserID workaround for OpenShift/K8S
ENV LOGNAME=ipython
ENV USER=ipython
ENV HOME=/tmp/user

# Install general dependencies
RUN apt-get update && apt-get install -y nodejs openssl git build-essential python3-dev curl jq

## Set working directory
WORKDIR /app

## Copy Python requirements
COPY ./requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
COPY ./ .
RUN pip install -e .

## Install Python dependencies
RUN cd /app \
&& pip install -r requirements.txt \
&& cd /app/src/cwl-tes \
&& python setup.py develop \
&& cd / \
&& mkdir -p /tmp/user

## Copy remaining app files
COPY ./ /app

## Install app & set write permissions for specs directory
RUN cd /app \
&& python setup.py develop \
&& cd / \
&& chmod g+w /app/cwl_wes/api/ \
&& chmod g+w -R /tmp/user

## Add permissions for storing updated API specification
## (required by FOCA)
RUN chmod -R a+rwx /app/cwl_wes/api
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cd app
* Via the **app configuration file**

```bash
vi cwl_wes/config/app_config.yaml
vi cwl_wes/config.yaml
```

* Via **environment variables**
Expand Down Expand Up @@ -253,7 +253,7 @@ question etc.
[badge-url-ci]: <https://travis-ci.com/elixir-cloud-aai/cwl-WES>
[badge-url-health]: <https://csc-wes.rahtiapp.fi/ga4gh/wes/v1/ui/>
[badge-url-license]: <http://www.apache.org/licenses/LICENSE-2.0>
[config-app]: cwl_wes/config/app_config.yaml
[config-app]: cwl_wes/config.yaml
[docs-kubernetes]: deployment/README.md
[elixir-aai]: https://perun.elixir-czech.cz/
[elixir-user-group-apply]: https://perun.elixir-czech.cz/fed/registrar/?vo=elixir&group=ECP_CLN:OSS
Expand Down
2 changes: 1 addition & 1 deletion cwl_wes/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.15.0'
"""cwl-WES package."""
Empty file removed cwl_wes/api/__init__.py
Empty file.
96 changes: 0 additions & 96 deletions cwl_wes/api/register_openapi.py

This file was deleted.

Loading

0 comments on commit b4958f8

Please sign in to comment.