Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Images/nginx/nginx_qiita.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ http {
# ports to redirect for mainqiita
upstream mainqiita {
server qiita:21174;
server qiita-container-anna-qiita-worker-1:21175;
server qiita-container-anna-qiita-worker-2:21175;
server qiita-container-anna-qiita-worker-3:21175;
server tinqiita-qiita-worker-1:21175;
server tinqiita-qiita-worker-2:21175;
server tinqiita-qiita-worker-3:21175;
}

# define variables for the actions that shall be taken for websocket handshake
Expand Down
2 changes: 1 addition & 1 deletion Images/plugin_collector/collect_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if container == "":
continue
print(' (%i/%i) %s' % (i+1, len(containers), container), end="", file=sys.stderr)
url = 'http://qiita-container-anna-%s-1:%s/%s' % (container, PORT, API_ENDPOINT)
url = 'http://%s%s-1:%s/%s' % ('tinqiita-', container, PORT, API_ENDPOINT)
print(" '%s'" % url, end="", file=sys.stderr)

req = requests.get(url)
Expand Down
10 changes: 5 additions & 5 deletions Images/plugin_collector/stefan_cert.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
DNS.2 = qiita-container-anna-qiita-1
DNS.3 = qiita-container-anna-qiita-worker-1
DNS.4 = qiita-container-anna-qiita-worker-2
DNS.5 = qiita-container-anna-qiita-worker-3
DNS.6 = qiita-container-anna-nginx-1
DNS.2 = tinqiita-qiita-1
DNS.3 = tinqiita-qiita-worker-1
DNS.4 = tinqiita-qiita-worker-2
DNS.5 = tinqiita-qiita-worker-3
DNS.6 = tinqiita-nginx-1
10 changes: 5 additions & 5 deletions Images/plugin_collector/stefan_csr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ subjectAltName = @alt_names
[ alt_names ]
DNS.1 = localhost
IP.1 = 127.0.0.1
DNS.2 = qiita-container-anna-qiita-1
DNS.3 = qiita-container-anna-qiita-worker-1
DNS.4 = qiita-container-anna-qiita-worker-2
DNS.5 = qiita-container-anna-qiita-worker-3
DNS.6 = qiita-container-anna-nginx-1
DNS.2 = tinqiita-qiita-1
DNS.3 = tinqiita-qiita-worker-1
DNS.4 = tinqiita-qiita-worker-2
DNS.5 = tinqiita-qiita-worker-3
DNS.6 = tinqiita-nginx-1
2 changes: 1 addition & 1 deletion Images/qiita/config_qiita_oidc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LOG_DIR = /logs/
REQUIRE_APPROVAL = True

# Base URL: DO NOT ADD TRAILING SLASH
BASE_URL = https://qiita-container-anna-nginx-1:8383
BASE_URL = https://tinqiita-nginx-1:8383

# Download path files
UPLOAD_DATA_DIR = /qiita_data/uploads/
Expand Down
67 changes: 67 additions & 0 deletions Images/qiita/drop_workflows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import qiita_db as qdb
import sys


def remove(self):
# store for later, after table entry is dropped
workflow_name = self.name

def _get_workflow_id(name):
with qdb.sql_connection.TRN:
sql = """SELECT default_workflow_id
FROM qiita.default_workflow
WHERE name = %s"""
qdb.sql_connection.TRN.add(sql, [name])
return qdb.sql_connection.TRN.execute_fetchlast()
def _get_node_ids(workflow_id):
with qdb.sql_connection.TRN:
sql = """SELECT default_workflow_node_id
FROM qiita.default_workflow_node
WHERE default_workflow_id = %s"""
qdb.sql_connection.TRN.add(sql, [workflow_id])
return qdb.sql_connection.TRN.execute_fetchflatten()
def _get_edge_ids(node_ids):
if len(node_ids) > 0:
with qdb.sql_connection.TRN:
sql = """SELECT default_workflow_edge_id
FROM qiita.default_workflow_edge
WHERE parent_id in %s OR child_id in %s"""
qdb.sql_connection.TRN.add(sql, [tuple(node_ids), tuple(node_ids)])
return qdb.sql_connection.TRN.execute_fetchflatten()
else:
return []

workflow_id = _get_workflow_id(self.name)
node_ids = _get_node_ids(workflow_id)
edge_ids = _get_edge_ids(node_ids)
with qdb.sql_connection.TRN:
if len(edge_ids) > 0:
sql = """DELETE FROM qiita.default_workflow_edge_connections
WHERE default_workflow_edge_id in %s"""
qdb.sql_connection.TRN.add(sql, [tuple(edge_ids)])

sql = """DELETE FROM qiita.default_workflow_edge
WHERE default_workflow_edge_id in %s"""
qdb.sql_connection.TRN.add(sql, [tuple(edge_ids)])

if workflow_id is not None:
sql = """DELETE FROM qiita.default_workflow_node
WHERE default_workflow_id = %s"""
qdb.sql_connection.TRN.add(sql, [workflow_id])

sql = """DELETE FROM qiita.default_workflow_data_type
WHERE default_workflow_id = %s"""
qdb.sql_connection.TRN.add(sql, [workflow_id])

sql = """DELETE FROM qiita.default_workflow
WHERE default_workflow_id = %s"""
qdb.sql_connection.TRN.add(sql, [workflow_id])
print("removed workflow '%s': ID=%i with %i nodes and %i edges" % (workflow_name, workflow_id, len(node_ids), len(edge_ids)), file=sys.stderr)

def remove_workflows():
for w in qdb.software.DefaultWorkflow.iter():
w.remove = remove
w.remove(w)


remove_workflows()
3 changes: 3 additions & 0 deletions Images/qiita/qiita.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ RUN rm -f /qiita/qiita_pet/nginx_example.conf /qiita/qiita_pet/supervisor_exampl

COPY drop_workflows.py /drop_workflows.py

# install aspera client for ENA submission
RUN conda install hcc::aspera-cli

# CMD ["conda", "run", "-n", "qiita"]
2 changes: 1 addition & 1 deletion Images/qiita/start_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

pluginname, qiita_server_url, job_id, output_dir = sys.argv[1:]

req = requests.post('http://qiita-container-anna-%s-1:%s/run' % (pluginname, PORT),
req = requests.post('http://%s%s-1:%s/run' % ('tinqiita-', pluginname, PORT),
json={'url': qiita_server_url,
'job_id': job_id,
'output_dir': output_dir})
Expand Down
12 changes: 0 additions & 12 deletions Images/qp-deblur/start_qp-deblur.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qp-deblur

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py deblur start_deblur /qp-deblur

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qp-qiime2/start_qp-qiime2.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qp-qiime2

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qiime2 start_qiime2 /qp-qiime2

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qp-target-gene/start_qp-target-gene.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qp-target-gene

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qp-target-gene start_target_gene /qp-target-gene

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qtp-biom/start_qtp-biom.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qtp-biom

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qtp-biom start_biom /qtp-biom

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qtp-diversity/start_qtp-diversity.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qtp-sequencing

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qiime2 start_diversity_types /qtp-diversity

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qtp-job-output-folder/start_qtp-job-output-folder.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qtp-sequencing

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qtp-job-output-folder start_qtp_job_output_folder /qtp-job-output-folder

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qtp-sequencing/start_qtp-sequencing.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qtp-sequencing

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qtp-sequencing start_qtp_sequencing /qtp-sequencing

tail -f /dev/null
12 changes: 0 additions & 12 deletions Images/qtp-visualization/start_qtp-visualization.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

#export QIITA_ROOTCA_CERT=/qiita/qiita_core/support_files/ci_server.crt
export QIITA_CONFIG_FP=/qiita_configurations/qiita_server.cfg
CONDA_DIR=/opt/conda
ENV_NAME=qtp-sequencing

# Commented out because I wanted to jump onto the container to crawl into the code (it crashes during the start_biom step)

#configure_biom --env-script "source /opt/conda/bin/activate ; conda activate qtp-biom" --server-cert $QIITA_ROOTCA_CERT

#start_biom https://localhost:8383 register ignored
#start_biom http://qiita:8383 register ignored
#source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd / && python trigger.py
cd / && python trigger.py qtp-visualization start_visualization_types /qtp-visualization

tail -f /dev/null
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PODMAN_FLAGS =
PODMAN_BIN = docker buildx
CERTNAME=stefan
OPENSSL=/bin/openssl
# docker compose prepends name of directory to containers

TMPDIR := $(shell mktemp -d)
ifeq ($(origin tmpdir), undefined)
Expand All @@ -12,13 +13,14 @@ Certificates/: Images/plugin_collector/stefan_csr.conf Images/plugin_collector/s
# === create own certificates ===
mkdir -p Certificates/
# Generate a new root CA private key and certificate
cd $@/ && $(OPENSSL) req -x509 -sha256 -days 356 -nodes -newkey rsa:2048 -subj "/CN=qiita-container-anna-qiita-1/C=DE/L=Giessen" -keyout $(CERTNAME)_rootca.key -out $(CERTNAME)_rootca.crt
cd $@/ && $(OPENSSL) req -x509 -sha256 -days 356 -nodes -newkey rsa:2048 -subj "/CN=tinqiita-nginx-1/C=DE/L=Giessen" -keyout $(CERTNAME)_rootca.key -out $(CERTNAME)_rootca.crt
# Generate a new server private key
cd $@/ && $(OPENSSL) genrsa -out $(CERTNAME)_server.key 2048
# Copy the following to a new file named csr.conf and modify to suit your needs
# Copy the following to a new file named cert.conf and modify to suit your needs
# Nils: alt_names is the important aspect. Make entries for all valid hostnames with which services shall be addressed
cp $^ $@/
for f in `echo "$^"`; do cat $$f > $@/`basename $$f`; done
#cp $^ $@/
# Generate a certificate signing request
cd $@/ && $(OPENSSL) req -new -key $(CERTNAME)_server.key -out $(CERTNAME)_server.csr -config $(CERTNAME)_csr.conf
# Generate a new signed server.crt to use with your server.key
Expand Down Expand Up @@ -88,13 +90,14 @@ plugin: Images/qtp-biom/trigger.py Certificates/
test -d src/qiita || git clone -b auth_oidc https://github.com/jlab/qiita.git src/qiita
# remove configuration and certificate files from upstream qiita repo
rm -rf src/qiita/qiita_core/support_files
cd Images/qiita && $(PODMAN_BIN) build . -f `basename $<` $(PODMAN_FLAGS) -t local-qiita
cd Images/qiita && $(PODMAN_BIN) build . -f `basename $<` $(PODMAN_FLAGS) -t local-qiita --no-cache
touch .built_image_qiita

.built_image_plugin_collector: Images/plugin_collector/plugin_collector.dockerfile Images/plugin_collector/fix_test_db.py Images/plugin_collector/collect_configs.py Images/plugin_collector/startup_plugin_collector.sh
tmpdir=$(TMPDIR) $(MAKE) plugin
cp -r Certificates/ Images/plugin_collector/
cd Images/plugin_collector && $(PODMAN_BIN) build . -f `basename $<` $(PODMAN_FLAGS) -t local-plugin_collector
cp $^ $(TMPDIR)
cp -r Certificates/ $(tmpdir)/
$(PODMAN_BIN) build $(TMPDIR)/ -f $(TMPDIR)/`basename $<` $(PODMAN_FLAGS) -t local-plugin_collector
touch .built_image_plugin_collector

images: .built_image_qtp-biom .built_image_nginx .built_image_qiita .built_image_plugin_collector .built_image_qtp-sequencing .built_image_qp-target-gene .built_image_qtp-visualization .built_image_qtp-diversity .built_image_qp-deblur .built_image_qp-qiime2 .built_image_qp-qiime2 .built_image_qtp-job-output-folder
Expand All @@ -108,4 +111,10 @@ environments/qiita.env: environments/qiita.env.example

config: environments/qiita_db.env environments/qiita.env

make clean:
rm .built_image_*
rm -rf Certificates
rm -rf /var/lib/docker/volumes/tinqiita_server-certificates/_data/*
rm -rf /var/lib/docker/volumes/tinqiita_server-plugin-configs/_data/*

all: config images
Loading