-
Notifications
You must be signed in to change notification settings - Fork 80
fix-3064 #3080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix-3064 #3080
Changes from all commits
987c6c1
393dcbb
6de0a09
3dc47b8
07f6aed
14b3713
94a839f
d058a33
74b99c0
e3abf08
421f40b
2ba53ce
c447bfa
d425d9e
ab7bd26
cb9903a
5ac15b2
e659e51
e733ae4
86ad303
5a34101
70b51cc
8bbbc45
1c3b8be
8fbd6f8
f8e4e34
d665766
1bf7a9d
a627559
04b7794
076036e
fad964b
041a744
0b464d5
6b3f3b8
ddf2d71
1f8ed84
4e2f29e
9f1ac42
accbaad
1d6c150
89bf700
e68af61
84107c1
617bb01
5dcf6e9
cd719ec
01c0116
9e7f8eb
cf378e8
a21bf29
ea8a403
6f480fb
45e9aae
f35a7e8
13b42f7
7a1194d
3156232
519cc1a
1f75f4e
4ce0a05
1af822a
febd980
a3f0b26
615becd
46615ec
4275503
797f089
7a262d4
c82457c
fdc784e
1fee15a
cc3a1ab
8ff823a
86bc7e4
2d1e4ac
8111edb
e84647e
23a1793
bc8599b
a3c68a4
6c01d08
1bcb11f
42b70f7
4393bdb
adbcd34
ca9c60f
5bceadc
851a528
cc3ba29
c6dcfa0
f54279a
a3f6d18
dac1750
60ad191
7d3d4be
b704d89
70b6d90
f92a0cf
3aa7f11
1128a05
9002cf4
84af8da
7a64717
ce1e30b
023c075
ba77bdd
3df0ca7
9c2c49c
317a650
f455ce6
25542f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,208 @@ | ||||||||||
# 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 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||||||||||
|
||||||||||
# 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" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using echo, another alternative is to put each of these sections under a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm OK with echos! :) |
||||||||||
redis-server --daemonize yes --port 7777 | ||||||||||
redis-server --daemonize yes --port 6379 | ||||||||||
|
||||||||||
echo "2. Starting webdis" | ||||||||||
pushd webdis | ||||||||||
./webdis & | ||||||||||
popd | ||||||||||
Comment on lines
+125
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my own experience the webdis expects and looks for files in the folder; if you run from outside the folder the expected files are not where they should be |
||||||||||
|
||||||||||
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 | ||||||||||
bash -c 'source /home/runner/.profile; conda activate qtp-biom; start_biom --help' | ||||||||||
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: | ||||||||||
file: codecov.yml | ||||||||||
fail_ci_if_error: true | ||||||||||
|
||||||||||
lint: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Up to you but maybe the |
||||||||||
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 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this missing the command that lints the code? |
||||||||||
flake8 qiita_* setup.py scripts/qiita* |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have the same effect, so just in case you are interested in containing everything in one line.