Skip to content

Commit 7416314

Browse files
authored
Deployment fixes (#3423)
* Update CHANGELOG.md * general fixes after deployment * some updates * some minor changes
1 parent 0387611 commit 7416314

File tree

5 files changed

+42
-32
lines changed

5 files changed

+42
-32
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Qiita changelog
22

3+
Version 2024.07
4+
---------------
5+
6+
Deployed on July 15th, 2024
7+
8+
* On June 14th, 2024 we modified the SPP to use ["fastp & minimap2 against GRCh38.p14 + Phi X 174 + T2T-CHM13v2.0, then Movi against GRCh38.p14, T2T-CHM13v2.0 + Human Pangenome Reference Consortium release 2023"](https://github.com/cguccione/human_host_filtration) to filter human-reads.
9+
* Full refactor of the [DB patching system](https://github.com/qiita-spots/qiita/blob/master/CONTRIBUTING.md#patch-91sql) to make sure that a new production deployment has a fully empty database.
10+
* Fully removed Qiimp from Qiita.
11+
* Users can now add `ORCID`, `ResearchGate` and/or `GoogleScholar` information to their profile and the creation (registration) timestamp is kept in the database. Thank you @jlab.
12+
* Admins can now track and purge non-confirmed users from the database via the GUI (`/admin/purge_users/`). Thank you @jlab.
13+
* Added `qiita.slurm_resource_allocations` to store general job resource usage, which can be populated by `qiita_db.util.update_resource_allocation_table`.
14+
* Added `qiita_db.util.resource_allocation_plot` to generate different models to allocate resources from a given software command based on previous jobs, thank you @Gossty !
15+
* The stats page map can be centered via the configuration file; additionally, the Help and Admin emails are defined also via the configuration files, thank you @jlab !
16+
* ``Sequel IIe``, ``Revio``, and ``Onso`` are now valid instruments for the ``PacBio_SMRT`` platform.
17+
* Added `current_human_filtering` to the prep-information and `human_reads_filter_method` to the artifact to keep track of the method that it was used to human reads filter the raw artifact and know if it's up to date with what is expected via the best practices.
18+
* Added `reprocess_job_id` to the prep-information so we keep track if a preparation has been reprocessed with another job.
19+
* Other general fixes, like [#3385](https://github.com/qiita-spots/qiita/pull/3385), [#3397](https://github.com/qiita-spots/qiita/pull/3397), [#3399](https://github.com/qiita-spots/qiita/pull/3399), [#3400](https://github.com/qiita-spots/qiita/pull/3400), [#3409](https://github.com/qiita-spots/qiita/pull/3409), [#3410](https://github.com/qiita-spots/qiita/pull/3410).
20+
21+
322
Version 2024.02
423
---------------
524

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Just an empty SQL to allow the changes implemented in
2+
-- https://github.com/qiita-spots/qiita/pull/3403 to take effect
3+
SELECT 1;

qiita_db/util.py

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
from bcrypt import hashpw, gensalt
5050
from functools import partial
5151
from os.path import join, basename, isdir, exists, getsize
52-
from os import walk, remove, listdir, rename, stat
52+
from os import walk, remove, listdir, rename, stat, makedirs
5353
from glob import glob
5454
from shutil import move, rmtree, copy as shutil_copy
5555
from openpyxl import load_workbook
5656
from tempfile import mkstemp
5757
from csv import writer as csv_writer
58-
from datetime import datetime
58+
from datetime import datetime, timedelta
5959
from time import time as now
6060
from itertools import chain
6161
from contextlib import contextmanager
@@ -64,18 +64,15 @@
6464
import hashlib
6565
from smtplib import SMTP, SMTP_SSL, SMTPException
6666

67-
from os import makedirs
6867
from errno import EEXIST
6968
from qiita_core.exceptions import IncompetentQiitaDeveloperError
7069
from qiita_core.qiita_settings import qiita_config
7170
from subprocess import check_output
7271
import qiita_db as qdb
7372

74-
7573
from email.mime.multipart import MIMEMultipart
7674
from email.mime.text import MIMEText
7775

78-
from datetime import timedelta
7976
import matplotlib.pyplot as plt
8077
import numpy as np
8178
import pandas as pd
@@ -2730,19 +2727,19 @@ def update_resource_allocation_table(weeks=1, test=None):
27302727

27312728
dates = ['', '']
27322729

2730+
slurm_external_id = 0
2731+
start_date = datetime.strptime('2023-04-28', '%Y-%m-%d')
27332732
with qdb.sql_connection.TRN:
27342733
sql = sql_timestamp
27352734
qdb.sql_connection.TRN.add(sql)
27362735
res = qdb.sql_connection.TRN.execute_fetchindex()
2737-
slurm_external_id, timestamp = res[0]
2738-
if slurm_external_id is None:
2739-
slurm_external_id = 0
2740-
if timestamp is None:
2741-
dates[0] = datetime.strptime('2023-04-28', '%Y-%m-%d')
2742-
else:
2743-
dates[0] = timestamp
2744-
date1 = dates[0] + timedelta(weeks)
2745-
dates[1] = date1.strftime('%Y-%m-%d')
2736+
if res:
2737+
sei, sd = res[0]
2738+
if sei is not None:
2739+
slurm_external_id = sei
2740+
if sd is not None:
2741+
start_date = sd
2742+
dates = [start_date, start_date + timedelta(weeks=weeks)]
27462743

27472744
sql_command = """
27482745
SELECT
@@ -2769,27 +2766,23 @@ def update_resource_allocation_table(weeks=1, test=None):
27692766
"""
27702767
df = pd.DataFrame()
27712768
with qdb.sql_connection.TRN:
2772-
sql = sql_command
2773-
qdb.sql_connection.TRN.add(sql, sql_args=[slurm_external_id])
2769+
qdb.sql_connection.TRN.add(sql_command, sql_args=[slurm_external_id])
27742770
res = qdb.sql_connection.TRN.execute_fetchindex()
2775-
columns = ["processing_job_id", 'external_id']
2776-
df = pd.DataFrame(res, columns=columns)
2771+
df = pd.DataFrame(res, columns=["processing_job_id", 'external_id'])
27772772
df['external_id'] = df['external_id'].astype(int)
27782773

27792774
data = []
27802775
sacct = [
27812776
'sacct', '-p',
27822777
'--format=JobID,ElapsedRaw,MaxRSS,Submit,Start,End,CPUTimeRAW,'
2783-
'ReqMem,AllocCPUs,AveVMSize', '--starttime', dates[0], '--endtime',
2784-
dates[1], '--user', 'qiita', '--state', 'CD']
2778+
'ReqMem,AllocCPUs,AveVMSize', '--starttime',
2779+
dates[0].strftime('%Y-%m-%d'), '--endtime',
2780+
dates[1].strftime('%Y-%m-%d'), '--user', 'qiita', '--state', 'CD']
27852781

27862782
if test is not None:
27872783
slurm_data = test
27882784
else:
2789-
try:
2790-
rvals = StringIO(check_output(sacct)).decode('ascii')
2791-
except TypeError as e:
2792-
raise e
2785+
rvals = check_output(sacct).decode('ascii')
27932786
slurm_data = pd.read_csv(StringIO(rvals), sep='|')
27942787

27952788
# In slurm, each JobID is represented by 3 rows in the dataframe:

qiita_pet/handlers/user_handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ def validator_rgate_id(form, field):
187187
"Receive Processing Job Emails?")
188188

189189
social_orcid = StringField(
190-
"ORCID", [validator_orcid_id], description="0000-0002-0975-9019")
190+
"ORCID", [validator_orcid_id], description="")
191191
social_googlescholar = StringField(
192-
"Google Scholar", [validator_gscholar_id], description="_e3QL94AAAAJ")
192+
"Google Scholar", [validator_gscholar_id], description="")
193193
social_researchgate = StringField(
194-
"ResearchGate", [validator_rgate_id], description="Rob-Knight")
194+
"ResearchGate", [validator_rgate_id], description="")
195195

196196

197197
class UserProfileHandler(BaseHandler):

qiita_pet/support_files/doc/source/gettingstartedguide/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ Editing a Study
7676

7777
.. _prepare-information-files:
7878

79-
Creating and Working With Sample information
80-
--------------------------------------------
81-
82-
* The :doc:`../qiimp` tab located at the top of the page is a useful tool for creating Qiita and EBI compatible metadata spreadsheets.
83-
8479
Example files
8580
~~~~~~~~~~~~~
8681

0 commit comments

Comments
 (0)