Skip to content

[WIP] cloudspades

[WIP] cloudspades #25

Workflow file for this run

# name: Qiita Plugin CI
on:
push:
branches: [dev]
pull_request:
jobs:
# derived from https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml
main:
runs-on: ubuntu-latest
services:
postgres:
# Docker Hub image
image: postgres:13.4
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
COVER_PACKAGE: ${{ matrix.cover_package }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# based on https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml#L44-L72
- 5432/tcp
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup for conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.6
- name: Basic dependencies install
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
shell: bash -l {0}
run: |
echo "Testing: " $COVER_PACKAGE
# we need to download qiita directly so we have "easy" access to
# all config files
wget https://github.com/biocore/qiita/archive/dev.zip
unzip dev.zip
# pull out the port so we can modify the configuration file easily
pgport=${{ job.services.postgres.ports[5432] }}
sed -i "s/PORT = 5432/PORT = $pgport/" qiita-dev/qiita_core/support_files/config_test.cfg
# PGPASSWORD is read by pg_restore, which is called by the build_db process.
export PGPASSWORD=postgres
# Setting up main qiita conda environment
conda config --add channels conda-forge
conda create -q --yes -n qiita python=3.6 pip libgfortran numpy nginx cython redis
conda activate qiita
pip install sphinx sphinx-bootstrap-theme nose-timer codecov Click
- name: Qiita install
shell: bash -l {0}
run: |
conda activate qiita
pip install qiita-dev/ --no-binary redbiom
mkdir ~/.qiita_plugins
- name: Install plugins
shell: bash -l {0}
run: |
conda config --add channels anaconda
conda config --add channels bioconda
# installing qtp-sequencing
# conda create -q --yes -n qtp-sequencing python=3.6 pip pigz quast
# conda activate qtp-sequencing
# pip --quiet install https://github.com/qiita-spots/qtp-sequencing/archive/master.zip
# export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
# export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
# configure_qtp_sequencing --env-script "source /home/runner/.profile; conda activate qtp-sequencing" --server-cert $QIITA_SERVER_CERT
# conda deactivate
# installing this plugin
conda create -q --yes -n qp-spades python=3.11 cmake clang zlib flash # spades=3.15.4
conda activate qp-spades
# installing cloudspades
wget https://github.com/ablab/spades/archive/refs/tags/cloudspades-0.1.tar.gz
tar zxvf cloudspades-0.1.tar.gz
cd spades-cloudspades-0.1/assembler/
sh spades_compile.sh
bin/spades.py --test
flash_version=`flash --version`
spades_version=`spades.py --version`
if [[ $flash_version != *"v1.2.11"* ]]; then echo "wrong flash version", $flash_version; exit 1; fi
if [[ $spades_version != *"v3.15.2"* ]]; then echo "wrong spades version", $spades_version; exit 1; fi
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-spades"
pip install -U pip
pip install .
configure_qp_spades --env-script 'source /home/runner/.profile; conda activate qp-spades; export ENVIRONMENT="source /home/runner/.profile; conda activate qp-spades"' --server-cert $QIITA_SERVER_CERT
- name: Starting services
shell: bash -l {0}
run: |
conda activate qiita
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" `pwd`/qiita-dev/qiita_core/support_files/config_test.cfg > ${QIITA_CONFIG_FP}
export REDBIOM_HOST="http://localhost:7379"
echo "1. Setting up redis"
redis-server --daemonize yes --port 7777
echo "2. Setting up nginx"
mkdir -p ${CONDA_PREFIX}/var/run/nginx/
export NGINX_FILE=`pwd`/qiita-dev/qiita_pet/nginx_example.conf
export NGINX_FILE_NEW=`pwd`/qiita-dev/qiita_pet/nginx_example_local.conf
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" ${NGINX_FILE} > ${NGINX_FILE_NEW}
nginx -c ${NGINX_FILE_NEW}
echo "3. Setting up qiita"
conda activate qiita
qiita-env make --no-load-ontologies
qiita-test-install
qiita plugins update
echo "4. Starting supervisord => multiple qiita instances"
supervisord -c ${PWD}/qiita-dev/qiita_pet/supervisor_example.conf
sleep 10
cat /tmp/supervisord.log
- name: Main tests
shell: bash -l {0}
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
run: |
conda activate qp-spades
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-spades"
nosetests $COVER_PACKAGE --with-doctest --with-coverage -vv --cover-package=$COVER_PACKAGE
# killing the qiita server to run the next commands
QIITA_PID=`cat /tmp/supervisord.pid`
kill $QIITA_PID
sleep 10
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: codecov.yml
lint:
runs-on: ubuntu-latest
steps:
- name: flake8
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: install dependencies
run: python -m pip install --upgrade pip
- name: Check out repository code
uses: actions/checkout@v2
- name: lint
run: |
pip install -q flake8
flake8 qp_spades setup.py scripts/*