Skip to content

Commit 9eaf674

Browse files
committed
Merge branch 'dev' of github.com:biocore/qiita
2 parents f39ea7c + 17f25ed commit 9eaf674

29 files changed

+299
-310
lines changed

Diff for: .github/workflows/qiita-ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ jobs:
9696
export REDBIOM_HOST="http://localhost:7379"
9797
9898
pip install . --no-binary redbiom
99-
conda install -c conda-forge --yes biom-format
99+
# 10.2022
100+
# this is for redbiom / biom-format (so fine to delete in the future)
101+
pip install future
100102
pwd
101103
mkdir ~/.qiita_plugins
102104
@@ -182,6 +184,8 @@ jobs:
182184
conda activate qiita
183185
export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
184186
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
187+
# for testing we only need to have this set, not actually exist
188+
export QIITA_JOB_SCHEDULER_EPILOGUE=`/path/to/epilogue/file`
185189
export REDBIOM_HOST="http://localhost:7379"
186190
187191
nosetests $COVER_PACKAGE --with-doctest --with-coverage --with-timer -v --cover-package=${COVER_PACKAGE// / --cover-package=} -e 'test_submit_EBI_parse_EBI_reply_failure' -e 'test_full_submission'

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Qiita changelog
22

3+
Version 2022.09
4+
---------------
5+
6+
* Moved Qiita's code base and plugins to SLURM (from Torque). The plugins updated are: qiita-spots/qp-woltka, biocore/mg-scripts, qiita-spots/qp-spades, qiita-spots/qp-meta, qiita-spots/qp-fastp-minimap2.
7+
* Pinned the paramiko version to < 2.9 [as newer versions were causing issues with older systems](https://github.com/paramiko/paramiko/issues/1961#issuecomment-1008119073).
8+
* Pinned the scipy version to < 1.8 to avoid issues with the biom-format library.
9+
* Updates to the INSTALL instructions (thank you @aliu104 !)
10+
311
Version 2022.07
412
---------------
513

Diff for: INSTALL.md

+59-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Qiita is pip installable, but depends on specific versions of python and non-pyt
66

77
## Install and setup miniconda
88

9-
Download the appropriate installer [here](http://conda.pydata.org/docs/install/quick.html) corresponding to your operating system and execute it.
9+
Download the appropriate installer [here](https://repo.anaconda.com/miniconda/) corresponding to your operating system and execute it.
1010

1111
Next, ensure conda is up-to-date.
1212

@@ -19,6 +19,7 @@ conda update conda
1919
Setup a virtual environment in conda named `qiita` by executing the following:
2020

2121
```bash
22+
conda config --add channels conda-forge
2223
conda create -q --yes -n qiita python=3.6 pip libgfortran numpy nginx
2324
```
2425

@@ -40,7 +41,7 @@ $ which python
4041
(qiita)
4142
```
4243

43-
If you don't see this output, your `$PATH` variable was setup incorrectly or you haven't restarted your shell. Consult the [conda documentation](http://conda.pydata.org/docs/install/quick.html).
44+
If you don't see this output, your `$PATH` variable was setup incorrectly or you haven't restarted your shell. Consult the [conda documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html).
4445

4546
As long as you are in the active qiita environment, commands such as `pip install` or `python` will refer to and be contained within this virtual environment.
4647

@@ -54,7 +55,7 @@ source deactivate
5455
Install the non-python dependencies
5556
-----------------------------------
5657

57-
* [PostgreSQL](http://www.postgresql.org/download/) (minimum required version 9.5.14, we have tested most extensively with 9.5.15)
58+
* [PostgreSQL](http://www.postgresql.org/download/) (currently using v13)
5859
* [redis-server](http://redis.io) (we have tested most extensively with 2.8.17)
5960
* [webdis] (https://github.com/nicolasff/webdis) (latest version should be fine but we have tested the most with 9ee6fe2 - Feb 6, 2016)
6061

@@ -64,9 +65,43 @@ There are several options to install these dependencies depending on your needs:
6465
- Alternatively, you could install them via conda. However, the conda repository may not have the exact versions of these dependencies that you want.
6566
- You could setup a full development environment with [Vagrant](https://www.vagrantup.com/), and continue using conda under it to primarily manage python dependencies. Note that we don't cover Vagrant in these instructions.
6667

68+
### PostgreSQL installation on Linux
69+
The following instructions have been adapted from [this site](https://computingforgeeks.com/how-to-install-postgresql-13-on-ubuntu/) and tested on Ubuntu v20.04.4 for Postgres v13.
70+
71+
First, ensure that you have updated packages and reboot the system with:
72+
```bash
73+
sudo apt update && sudo apt -y full-upgrade
74+
[ -f /var/run/reboot-required ] && sudo reboot -f
75+
```
76+
You can reboot the system with `sudo reboot` in case any packages were updated.
77+
78+
Next, we need to add the Postgres repository to our system:
79+
```bash
80+
sudo apt update
81+
sudo apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates
82+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
83+
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list
84+
```
85+
Adding the repository has added many different packages, which allows us to now install Postgres v13 with the following commands:
86+
```bash
87+
sudo apt update
88+
sudo apt install postgresql-13 postgresql-client-13
89+
```
90+
Now, we need to reconfigure the `pg_hba.conf` file and change all occurrences of `md5` and `peer` to `trust`. You can access the file with:
91+
```bash
92+
sudo vim /etc/postgresql/13/main/pg_hba.conf
93+
```
94+
To make sure all changes have been reflected, restart the Postgres server:
95+
```bash
96+
sudo service postgresql restart
97+
```
98+
Installing Postgres is now complete. Note that you will need to start the Postgres server every time you start the Qiita server. You can do this with the following command:
99+
```bash
100+
sudo service postgresql start
101+
```
67102
### PostgreSQL installation on Mac OS X
68103

69-
For Mac OS X, you can either install postgres through the [Postgres.app](https://postgresapp.com/downloads.html). These instructions were tested with the Postgres.app v9.5.
104+
For Mac OS X, you can either install postgres through the [Postgres.app](https://postgresapp.com/downloads.html). These instructions were tested with the Postgres.app v9.5, v13.
70105

71106
You'll then need to ensure that the postgres binaries (for example, ``psql``) are in your executable search path (``$PATH`` environment variable). If you are using Postgres.app on OS X, you can do this by running the following, though you may have to replace`~/.bash_profile`with `~/.zshrc` if you're using zshell rather than the built-in bash, and you may have to change the version number `Versions/9.3/` to the exact one that you are installing:
72107

@@ -75,14 +110,20 @@ echo 'export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/9.5/bin/"'
75110
source ~/.bash_profile
76111
```
77112

78-
### Redis-server installation on Mac OS X
113+
### Redis-server installation using Homebrew (Mac OS X, Linux)
79114

80-
Assuming you have [homebrew](http://www.brew.sh) installed, you can install redis-server v2.8.x as follows:
115+
Assuming you have [homebrew](http://brew.sh) installed, you can install the latest version of the redis-server as follows:
81116

82117
```bash
83118
brew update
84119
brew install homebrew/versions/redis28
85120
```
121+
### Redis-server installation using apt-get (Linux)
122+
123+
Alternatively, you can sudo install redis:
124+
```bash
125+
sudo apt-get install redis-server
126+
```
86127

87128
### webdis
88129

@@ -112,7 +153,7 @@ Install Qiita development version and its python dependencies
112153
Clone the git repository with the development version of Qiita into your current directory:
113154

114155
```bash
115-
git clone https://github.com/biocore/qiita.git
156+
git clone https://github.com/qiita-spots/qiita.git
116157
```
117158

118159
Navigate to the cloned directory and ensure your conda environment is active:
@@ -121,12 +162,17 @@ Navigate to the cloned directory and ensure your conda environment is active:
121162
cd qiita
122163
source activate qiita
123164
```
124-
165+
If you are using Ubuntu or a Windows Subsystem for Linux (WSL), you will need to ensure that you have a C++ compiler and that development libraries and include files for PostgreSQL are available. Type `cc` into your system to ensure that it doesn't result in `program not found`. The following commands will install a C++ compiler and `libpq-dev`:
166+
```bash
167+
sudo apt install gcc # alternatively, you can install clang instead
168+
sudo apt-get install libpq-dev
169+
```
125170
Install Qiita (this occurs through setuptools' `setup.py` file in the qiita directory):
126171

127172
```bash
128173
pip install . --no-binary redbiom
129174
```
175+
Note that if you get any errors or warnings with 'certifi', you can add the `--ignore-installed` tag to the command above.
130176

131177
At this point, Qiita will be installed and the system will start. However,
132178
you will need to install plugins in order to process any kind of data. For a list
@@ -148,7 +194,7 @@ Move the Qiita sample configuration file to a different directory by executing:
148194
cp ./qiita_core/support_files/config_test.cfg ~/.qiita_config_test.cfg
149195
```
150196

151-
Note that you will need to change `BASE_URL = https://localhost:8383` to `BASE_URL = https://localhost:21174` if you are not using NGINX.
197+
Note that you will need to change `BASE_URL = https://localhost:8383` to `BASE_URL = https://localhost:21174` in the new copy of the configuration file if you are not using NGINX. Additionally, you will also need to change all URLs that start with `/home/runner/work/qiita/qiita/...` into wherever your qiita directory is (e.g. `/home/<username>/qiita/...`).
152198

153199

154200
Set your `QIITA_CONFIG_FP` environment variable to point to that file (into `.bashrc` if using bash; `.zshrc` if using zshell):
@@ -162,6 +208,10 @@ Set your `QIITA_CONFIG_FP` environment variable to point to that file (into `.ba
162208

163209
Update paths in the newly copied configuration file to match your settings, e.g. replace /home/travis/ with your user home directory.
164210

211+
If you are working on WSL, you will need to start the redis server with the following command before making a test environment:
212+
```bash
213+
redis-server --daemonize yes --port 7777
214+
```
165215
Next, make a test environment:
166216

167217
```bash

Diff for: qiita_core/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
__version__ = "2022.07"
9+
__version__ = "2022.09"

Diff for: qiita_core/configuration_manager.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class ConfigurationManager(object):
4242
Max upload size
4343
valid_upload_extension : str
4444
The extensions that are valid to upload, comma separated
45-
trq_owner : str
46-
Email address of submitter of Torque jobs
47-
trq_poll_val : int
48-
Interval (in seconds) to wait between calls to Torque's qstat program
49-
trq_dependency_q_cnt : int
45+
job_scheduler_owner : str
46+
Email address of submitter of jobs
47+
job_scheduler_poll_val : int
48+
Interval (in seconds) to wait between calls to job_scheduler program
49+
job_scheduler_dependency_q_cnt : int
5050
Hard upper-limit on the number of an artifact's concurrent validation
5151
processes.
5252
user : str
@@ -145,7 +145,7 @@ def __init__(self):
145145

146146
self._get_main(config)
147147
self._get_smtp(config)
148-
self._get_torque(config)
148+
self._get_job_scheduler(config)
149149
self._get_postgres(config)
150150
self._get_redis(config)
151151
self._get_ebi(config)
@@ -234,22 +234,22 @@ def _get_main(self, config):
234234
self.key_file = join(install_dir, 'qiita_core', 'support_files',
235235
'server.key')
236236

237-
def _get_torque(self, config):
238-
"""Get the configuration of the torque section"""
239-
self.trq_owner = config.get('torque', 'TORQUE_JOB_OWNER')
240-
self.trq_poll_val = int(config.get('torque', 'TORQUE_POLLING_VALUE'))
241-
self.trq_dependency_q_cnt = config.get('torque',
242-
'TORQUE_PROCESSING_QUEUE_COUNT')
243-
self.trq_dependency_q_cnt = int(self.trq_dependency_q_cnt)
244-
245-
if not self.trq_owner:
246-
self.trq_owner = None
247-
248-
if not self.trq_poll_val:
249-
self.trq_poll_val = None
250-
251-
if not self.trq_dependency_q_cnt:
252-
self.trq_dependency_q_cnt = None
237+
def _get_job_scheduler(self, config):
238+
"""Get the configuration of the job_scheduler section"""
239+
self.job_scheduler_owner = config.get(
240+
'job_scheduler', 'JOB_SCHEDULER_JOB_OWNER', fallback=None)
241+
self.job_scheduler_poll_val = config.get(
242+
'job_scheduler', 'JOB_SCHEDULER_POLLING_VALUE', fallback=None)
243+
self.job_scheduler_dependency_q_cnt = config.get(
244+
'job_scheduler', 'JOB_SCHEDULER_PROCESSING_QUEUE_COUNT',
245+
fallback=None)
246+
247+
if self.job_scheduler_poll_val is not None:
248+
self.job_scheduler_poll_val = int(self.job_scheduler_poll_val)
249+
250+
if self.job_scheduler_dependency_q_cnt is not None:
251+
self.job_scheduler_dependency_q_cnt = int(
252+
self.job_scheduler_dependency_q_cnt)
253253

254254
def _get_postgres(self, config):
255255
"""Get the configuration of the postgres section"""

Diff for: qiita_core/support_files/config_test.cfg

+7-7
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ PASSWORD = postgres
123123
# The postgres password for the admin_user
124124
ADMIN_PASSWORD = postgres
125125

126-
# ----------------------------- Torque settings -----------------------------
127-
[torque]
128-
# The email address of the submitter of Torque jobs
129-
TORQUE_JOB_OWNER = torque_user@somewhere.org
126+
# ----------------------------- Job Scheduler Settings -----------------------------
127+
[job_scheduler]
128+
# The email address of the submitter of jobs
129+
JOB_SCHEDULER_JOB_OWNER = user@somewhere.org
130130

131-
# The number of seconds to wait between successive qstat calls
132-
TORQUE_POLLING_VALUE = 15
131+
# The number of seconds to wait between successive calls
132+
JOB_SCHEDULER__POLLING_VALUE = 15
133133

134134
# Hard upper-limit on concurrently running validator jobs
135-
TORQUE_PROCESSING_QUEUE_COUNT = 2
135+
JOB_SCHEDULER_PROCESSING_QUEUE_COUNT = 2
136136

137137
# ----------------------------- EBI settings -----------------------------
138138
[ebi]

Diff for: qiita_core/tests/test_configuration_manager.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def test_init(self):
5959
self.assertEqual(obs.cookie_secret, "SECRET")
6060
self.assertEqual(obs.key_file, "/tmp/server.key")
6161

62-
# Torque section
63-
self.assertEqual(obs.trq_owner, "torque_user@somewhere.org")
64-
self.assertEqual(obs.trq_poll_val, 15)
65-
self.assertEqual(obs.trq_dependency_q_cnt, 2)
62+
# job_scheduler section
63+
self.assertEqual(obs.job_scheduler_owner, "user@somewhere.org")
64+
self.assertEqual(obs.job_scheduler_poll_val, 15)
65+
self.assertEqual(obs.job_scheduler_dependency_q_cnt, 2)
6666

6767
# Postgres section
6868
self.assertEqual(obs.user, "postgres")
@@ -180,13 +180,13 @@ def test_get_main(self):
180180

181181
self.assertEqual(obs.qiita_env, "")
182182

183-
def test_get_torque(self):
183+
def test_get_job_scheduler(self):
184184
obs = ConfigurationManager()
185185

186-
conf_setter = partial(self.conf.set, 'torque')
187-
conf_setter('TORQUE_JOB_OWNER', '')
188-
obs._get_torque(self.conf)
189-
self.assertIsNone(obs.trq_owner)
186+
conf_setter = partial(self.conf.set, 'job_scheduler')
187+
conf_setter('JOB_SCHEDULER_JOB_OWNER', '')
188+
obs._get_job_scheduler(self.conf)
189+
self.assertEqual('', obs.job_scheduler_owner)
190190

191191
def test_get_postgres(self):
192192
obs = ConfigurationManager()
@@ -329,16 +329,16 @@ def test_get_portal(self):
329329
# The postgres password for the admin_user
330330
ADMIN_PASSWORD = thishastobesecure
331331
332-
# ----------------------------- Torque settings -----------------------------
333-
[torque]
334-
# The email address of the submitter of Torque jobs
335-
TORQUE_JOB_OWNER = torque_user@somewhere.org
332+
# ------------------------- job_scheduler settings -------------------------
333+
[job_scheduler]
334+
# The email address of the submitter of jobs
335+
JOB_SCHEDULER_JOB_OWNER = user@somewhere.org
336336
337-
# The number of seconds to wait between successive qstat calls
338-
TORQUE_POLLING_VALUE = 15
337+
# The number of seconds to wait between successive calls
338+
JOB_SCHEDULER_POLLING_VALUE = 15
339339
340340
# Hard upper-limit on concurrently running validator jobs
341-
TORQUE_PROCESSING_QUEUE_COUNT = 2
341+
JOB_SCHEDULER_PROCESSING_QUEUE_COUNT = 2
342342
343343
# ----------------------------- EBI settings -----------------------------
344344
[ebi]

Diff for: qiita_db/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from . import user
2828
from . import processing_job
2929

30-
__version__ = "2022.07"
30+
__version__ = "2022.09"
3131

3232
__all__ = ["analysis", "artifact", "archive", "base", "commands",
3333
"environment_manager", "exceptions", "investigation", "logger",

Diff for: qiita_db/environment_manager.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,12 @@ def make_environment(load_ontologies, download_reference, add_demo_user):
203203

204204
# Insert the settings values to the database
205205
sql = """INSERT INTO settings
206-
(test, base_data_dir, base_work_dir, trq_owner,
207-
trq_poll_val, trq_dependency_q_cnt)
208-
VALUES (%s, %s, %s, %s, %s, %s)"""
206+
(test, base_data_dir, base_work_dir)
207+
VALUES (%s, %s, %s)"""
209208
qdb.sql_connection.TRN.add(
210209
sql, [test,
211210
qiita_config.base_data_dir,
212-
qiita_config.working_dir,
213-
qiita_config.trq_owner,
214-
qiita_config.trq_poll_val,
215-
qiita_config.trq_dependency_q_cnt])
211+
qiita_config.working_dir])
216212
qdb.sql_connection.TRN.execute()
217213
create_layout(test=test, verbose=verbose)
218214

Diff for: qiita_db/metadata_template/base_metadata_template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ def _get_accession_numbers(self, column):
15371537
return result
15381538

15391539
def _update_accession_numbers(self, column, values):
1540-
"""Update accession numbers stored in `column` with the ones in `values`
1540+
"""Update accession numbers stored in `column` with `values`
15411541
15421542
Parameters
15431543
----------

0 commit comments

Comments
 (0)