Skip to content

Commit

Permalink
2021.03 (#3086)
Browse files Browse the repository at this point in the history
* adding creation and modification timestamps to prep_templates (#3066)

* adding creation and modification timestamps to prep_templates

* Apply suggestions from code review [skip ci]

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

* fix #3068 (#3069)

* minor improvements (#3067)

* minor improvements

* fix test

* adding @wasade suggestion

* minor fixes (#3073)

* fix #3072 (#3074)

* fix #3072

* flake8

* fix #3076 (#3077)

* fix #3076

* addressing @ElDeveloper comments

* fix #3070 (#3075)

* fix #3070

* Apply suggestions from code review

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

* flake8

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

* fix-3064 (#3080)

* Create qiita-ci.yml

* add passwd to psql

* nginx + redis

* redis via conda

* redis-server - -> redis-server --

* daemonize -> daemonize

* conda libevent

* apt-get libevent-dev

* adding multiple sections

* rm travis_retry

* add missing activagte

* onfig_test.cfg

* rm indent

* add 1 indent

* pgport

* add drop

* change db name

* redis version

* redis -> redbiom version

* split tests

* source .profile

* adding ssh command

* mkdir ~/.ssh/

* only ssh

* pushing to retrigger

* add run

* split ssh conf/run

* 60367309

* add bash

* fix ident

* rm ssh cmd

* strict=no

* localhost

* mod permissions

* user ssh

* rm keys

* echos

* start ssh service

* ssh -vvv

* split setup/test

* localhost -> 127

* localhost -> 127

* rm ssh setup

* -o StrictHostKeyChecking=no

* change key creation

* echo sshd_config

* readd ssh config

* cp sshd_config and then move

* rm echos

* extra qiita folder

* ls test_data

* rm qiita folder

* use key in .ssh

* more ssh params

* tee -> >

* chmod

* fullpath

* ls key

* rm localhost

* params

* rsa -> rsa-sha2-256

* rm root login

* readd -o StrictHostKeyChecking=no

* minimizing params

* permissions

* cleaning up

* comments => echo

* -o StrictHostKeyChecking=no

* export REDBIOM_HOST=http://127.0.0.1:7379

* localhost -> 127.0.0.1

* add runner

* cover package

* cleaning env vars

* renaming jobs

* redbiom host

* add env vars via export

* changing echo

* add env COVER_PACKAGE

* rm user sftp

* just qiita_db

* open_sftp -> SFTPClient

* +1 worker

* only SCPClient

* ssh.SCPClient -> SCPClient

* return sftp/ssh back

* just qiita_db

* rm sftp

* add all tests

* BASE_URL = https://127.0.0.1:8383

* bash -c

* start_biom

* start_biom 127

* populate QIITA_SERVER_CERT

* nginx 127

* adding ports to conf

* lowering ports

* service qiita

* 8383 postgres

* curl test

* mkdir nginx

* moving tests around

* moving curl up

* echos for curl

* sleep 10

* 127.0.0.1 -> localhost

* returning some localhost to 127...

* qiita_pet!

* final clean up

* kill qiita first

* addreesing @ElDeveloper comments

* checkout repo for flake8

* split cover_package

* Workflows GUI (#3078)

* fix #3076

* addressing @ElDeveloper comments

* adding workflows GUI

* improve HTML

* db changes and improvements

* comment out new db changes

* rm default_workflows from PluginHandler.get

* Apply suggestions from code review [skip ci]

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

* fix #3081 (#3082)

* fix #3081

* generate_analysis_list_per_study to speed up retrival

* minor modifications

* split sql

* addressing @ElDeveloper comments

* add Command.processing_jobs (#3085)

* add Command.processing_jobs

* Update qiita_db/software.py [skip ci]

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>

* Improve workflows (#3083)

* fix #3076

* addressing @ElDeveloper comments

* adding workflows GUI

* improve HTML

* db changes and improvements

* comment out new db changes

* rm default_workflows from PluginHandler.get

* improving workflows after deployment

* fix error

* clean up

* minor fixes

* improving html

* comments from @justinshaffer

* addressing @ElDeveloper comments

* 2021.03 (#3084)

* 2021.03

* add Command.processing_jobs to changelog

* codecov

* codecov required

* codecov token

Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>
  • Loading branch information
antgonza and ElDeveloper authored Mar 19, 2021
1 parent e6e5d80 commit 8f37b8a
Show file tree
Hide file tree
Showing 62 changed files with 2,997 additions and 1,952 deletions.
207 changes: 207 additions & 0 deletions .github/workflows/qiita-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# name: Qiita 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

strategy:
matrix:
include:
- cover_package: "qiita_db"
- cover_package: "qiita_pet qiita_core qiita_ware"

services:
postgres:
# Docker Hub image
image: postgres:9.5
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
# 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_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
# Configuring SSH
cp /etc/ssh/sshd_config sshd_config
echo "RSAAuthentication yes" > sshd_config
echo "PubkeyAuthentication yes" > sshd_config
echo "StrictModes no" > sshd_config
sudo mv sshd_config /etc/ssh/sshd_config
sudo systemctl restart ssh
- name: Webdis install
shell: bash -l {0}
run: |
sudo apt-get -y install libevent-dev
git clone https://github.com/nicolasff/webdis
cd webdis
make
- name: Main install
shell: bash -l {0}
run: |
conda activate qiita
export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
export REDBIOM_HOST="http://localhost:7379"
pip install . --no-binary redbiom
pwd
mkdir ~/.qiita_plugins
- name: Install plugins
shell: bash -l {0}
run: |
wget https://data.qiime2.org/distro/core/qiime2-2019.4-py36-linux-conda.yml
conda env create -q -n qtp-biom --file qiime2-2019.4-py36-linux-conda.yml
rm qiime2-2019.4-py36-linux-conda.yml
export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
export REDBIOM_HOST="http://localhost:7379"
conda activate qtp-biom
pip install -U pip
pip install https://github.com/qiita-spots/qiita_client/archive/master.zip
pip install https://github.com/qiita-spots/qtp-biom/archive/master.zip
configure_biom --env-script "source /home/runner/.profile; conda activate qtp-biom" --server-cert $QIITA_SERVER_CERT
- name: Starting services
shell: bash -l {0}
run: |
conda activate qiita
export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
export REDBIOM_HOST="http://localhost:7379"
echo "1. Setting up redis"
redis-server --daemonize yes --port 7777
redis-server --daemonize yes --port 6379
echo "2. Starting webdis"
pushd webdis
./webdis &
popd
echo "3. Starting redbiom: " $REDBIOM_HOST
curl -s http://localhost:7379/FLUSHALL > /dev/null
redbiom --version
redbiom admin scripts-writable
redbiom admin create-context --name "qiita-test" --description "qiita-test context"
redbiom admin load-sample-metadata --metadata `pwd`/qiita_db/support_files/test_data/templates/1_19700101-000000.txt
redbiom admin load-sample-metadata-search --metadata `pwd`/qiita_db/support_files/test_data/templates/1_19700101-000000.txt
redbiom admin load-sample-data --table `pwd`/qiita_db/support_files/test_data/processed_data/1_study_1001_closed_reference_otu_table.biom --context qiita-test --tag 4
redbiom admin load-sample-data --table `pwd`/qiita_db/support_files/test_data/processed_data/1_study_1001_closed_reference_otu_table-for_redbiom_tests.biom --context qiita-test --tag 5
echo "4. Setting up nginx"
mkdir -p /usr/share/miniconda/envs/qiita/var/run/nginx/
nginx -c ${PWD}/qiita_pet/nginx_example.conf
echo "5. Setting up qiita"
conda activate qiita
qiita-env make --no-load-ontologies
qiita-test-install
qiita plugins update
echo "6. Starting supervisord => multiple qiita instances"
supervisord -c ${PWD}/qiita_pet/supervisor_example.conf
sleep 10
cat /tmp/supervisord.log
echo "7. Starting plugins"
conda deactivate
conda activate qtp-biom
export QIITA_CLIENT_DEBUG_LEVEL=DEBUG
start_biom https://localhost:8383 register ignored
conda deactivate
echo "8. Setting up SSH"
ssh-keygen -t rsa-sha2-256 -b 4096 -N '' -f $PWD/qiita_ware/test/test_data/test_key
mkdir ~/.ssh/
cp $PWD/qiita_ware/test/test_data/test_key* ~/.ssh/
cat ~/.ssh/test_key.pub > ~/.ssh/authorized_keys
chmod 600 $PWD/qiita_ware/test/test_data/test_key*
chmod 600 ~/.ssh/*
chmod 700 ~/.ssh/
scp -o StrictHostKeyChecking=no -i $PWD/qiita_ware/test/test_data/test_key $USER@localhost:$PWD/qiita_ware/test/test_data/random_key $PWD/qiita_ware/test/test_data/random_key_copy
- name: Main tests
shell: bash -l {0}
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
run: |
conda activate qiita
export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
export REDBIOM_HOST="http://localhost:7379"
nosetests $COVER_PACKAGE --with-doctest --with-coverage --with-timer -v --cover-package=$COVER_PACKAGE -e 'test_submit_EBI_parse_EBI_reply_failure' -e 'test_full_submission'
# killing the qiita server to run the next commands
QIITA_PID=`cat /tmp/supervisord.pid`
kill $QIITA_PID
sleep 10
if [[ "$COVER_PACKAGE" == *"qiita_db"* ]]; then test_data_studies/commands.sh; all-qiita-cron-job; fi
- 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.6
- 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 qiita_* setup.py scripts/qiita*
108 changes: 0 additions & 108 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Qiita changelog


Version 2021.03
---------------

* Fixed [issue](https://github.com/qiita-spots/qtp-target-gene/issues/32) that left behind non gz per sample FASTQ files.
* [Recommended Workflows](https://qiita-rc.ucsd.edu/workflows/) are now stored in the database.
* Added a new button only for owners and admins within the Study page to display a list of all the Analyses generated with that study; helpful to clean up Studies and for general information.
* The Qiita CI now runs as [GitHub Actions](https://github.com/qiita-spots/qiita/actions); moving away from Travis CI.
* Prep information file object now stores its creation and modification timestamps.
* Improved creation time for all information files via the to_dataframe() method.
* Split the "other" category of the storage stats plot (https://qiita.ucsd.edu/stats/) into "other" and "biom" so biom can be its own category.
* Added a processing_jobs property to qiita_db.software.Command to easily retrieve all jobs in the system that have ran the given command.
* Fixed the following issues: [#3068](https://github.com/qiita-spots/qiita/issues/3068), [#3072](https://github.com/qiita-spots/qiita/issues/3072), [#3076](https://github.com/qiita-spots/qiita/issues/3076), and [#3070](https://github.com/qiita-spots/qiita/issues/3070).

Version 2021.01
---------------

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ future.
existing studies by submitting a fix proposals to the authors of the study.


.. |Build Status| image:: https://travis-ci.org/qiita-spots/qiita.png?branch=master
:target: https://travis-ci.org/qiita-spots/qiita
.. |Build Status| image:: https://github.com/qiita-spots/qiita/actions/workflows/qiita-ci.yml/badge.svg
:target: https://github.com/qiita-spots/qiita/actions/workflows/qiita-ci.yml
.. |Coverage Status| image:: https://codecov.io/gh/qiita-spots/qiita/branch/master/graph/badge.svg
:target: https://codecov.io/gh/qiita-spots/qiita
6 changes: 5 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
ignore:
- "qiita_db/support_files/**/*"
- "qiita_db/support_files/**/*"

codecov:
max_report_age: off
require_ci_to_pass: yes
2 changes: 1 addition & 1 deletion qiita_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

__version__ = "2021.01"
__version__ = "2021.03"
10 changes: 5 additions & 5 deletions qiita_core/support_files/config_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ REQUIRE_APPROVAL = True
BASE_URL = https://localhost:8383

# Download path files
UPLOAD_DATA_DIR = /home/travis/miniconda3/envs/qiita/lib/python3.6/site-packages/qiita_db/support_files/test_data/uploads/
UPLOAD_DATA_DIR = /home/runner/work/qiita/qiita/qiita_db/support_files/test_data/uploads/

# Working directory path
WORKING_DIR = /home/travis/miniconda3/envs/qiita/lib/python3.6/site-packages/qiita_db/support_files/test_data/working_dir/
WORKING_DIR = /home/runner/work/qiita/qiita/qiita_db/support_files/test_data/working_dir/

# Maximum upload size (in Gb)
MAX_UPLOAD_SIZE = 100

# Path to the base directory where the data files are going to be stored
BASE_DATA_DIR = /home/travis/miniconda3/envs/qiita/lib/python3.6/site-packages/qiita_db/support_files/test_data/
BASE_DATA_DIR = /home/runner/work/qiita/qiita/qiita_db/support_files/test_data/

# Valid upload extension, comma separated. Empty for no uploads
VALID_UPLOAD_EXTENSION = fastq,fastq.gz,txt,tsv,sff,fna,qual
Expand Down Expand Up @@ -118,10 +118,10 @@ HOST = localhost
PORT = 5432

# The password to use to connect to the database
PASSWORD =
PASSWORD = postgres

# The postgres password for the admin_user
ADMIN_PASSWORD =
ADMIN_PASSWORD = postgres

# ----------------------------- Torque settings -----------------------------
[torque]
Expand Down
Loading

0 comments on commit 8f37b8a

Please sign in to comment.