Skip to content

Commit 3dcb2dc

Browse files
authored
Merge pull request #62 from jlab/preview_merge_uncouple_clientpush
Preview merge uncouple clientpush
2 parents 7fc0355 + 7f0d974 commit 3dcb2dc

31 files changed

+238
-374
lines changed

.github/workflows/buildContainer.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ jobs:
4949
run: |
5050
VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ")
5151
echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV
52-
cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt .
52+
cp Images/start_plugin.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt Images/nginx/start_nginx.sh .
5353
cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh .
54-
cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf .
54+
cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf Images/plugin_collector/start_plugin_collector.sh .
5555
5656
- name: Download certificates from job build_main
5757
uses: actions/download-artifact@v4
@@ -119,7 +119,7 @@ jobs:
119119
run: |
120120
VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ")
121121
echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV
122-
cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt Images/trigger_noconda.py Images/trigger.py .
122+
cp Images/start_plugin.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt Images/trigger.py .
123123
124124
- name: Download certificates from job build_main
125125
uses: actions/download-artifact@v4
@@ -196,7 +196,7 @@ jobs:
196196
run: |
197197
VERSION=$(head -n 1 Images/${{ matrix.multiplugin }}/${{ matrix.multiplugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ")
198198
echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV
199-
cp Images/${{ matrix.multiplugin }}/start_${{ matrix.multiplugin }}.sh Images/test_plugin.sh Images/${{ matrix.multiplugin }}/requirements.txt Images/trigger_noconda.py Images/trigger.py .
199+
cp Images/start_plugin.sh Images/test_plugin.sh Images/${{ matrix.multiplugin }}/requirements.txt Images/trigger.py .
200200
201201
- name: Download certificates from job build_main
202202
uses: actions/download-artifact@v4
@@ -252,12 +252,6 @@ jobs:
252252
if: success()
253253
run: |
254254
docker push ghcr.io/${{ github.repository }}/${{ matrix.multiplugin }}:testcandidate
255-
#uses: docker/build-push-action@v6
256-
#with:
257-
# context: .
258-
# push: true
259-
# file: Images/${{ matrix.multiplugin }}/${{ matrix.multiplugin }}.dockerfile
260-
# tags: ghcr.io/${{ github.repository }}/${{ matrix.multiplugin }}:testcandidate
261255
262256
publish_images:
263257
needs:

Images/nginx/nginx.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ RUN chmod 777 start_nginx.sh
1010

1111
RUN mkdir -p /var/log/nginx
1212

13-
CMD ["nginx", "/start_nginx.sh"]
13+
CMD ["/start_nginx.sh"]

Images/nginx/start_nginx.sh

100644100755
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,19 @@
22
mkdir -p /var/run/nginx/ /usr/local/var/tmp/nginx/
33

44
nginx -t -c /qiita_configuration/nginx_qiita.conf
5-
nginx -c /qiita_configuration/nginx_qiita.conf
5+
6+
# proper listening and reacting to SIGTERM
7+
cleanup() {
8+
echo "Received SIGTERM, stopping..."
9+
kill "$PY_PID" 2>/dev/null
10+
wait "$PY_PID"
11+
exit 0
12+
}
13+
trap cleanup SIGTERM SIGINT
14+
15+
# start nginx and safe PID in variable
16+
nginx -c /qiita_configuration/nginx_qiita.conf &
17+
PY_PID=$!
18+
19+
# wait till nginx process is terminated
20+
wait "$PY_PID"

Images/qiita/qiita.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ RUN conda install hcc::aspera-cli
9898
# something is wired with permissions of the git repo?!
9999
RUN git config --global --add safe.directory /qiita
100100

101-
# CMD ["conda", "run", "-n", "qiita"]
101+
CMD ["/start_qiita.sh"]

Images/qiita/start_qiita.sh

100644100755
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,26 @@
22

33
CONDA_DIR=/opt/conda
44
ENV_NAME=qiita
5-
#PORT=21174
65

7-
#sleep 300000
8-
#export QIITA_CONFIG_FP="/qiita/config_qiita_oidc.cfg"
96
if [ -n "${MASTER}" ] && [ ! -d /qiita/qiita_db/__pycache__ ]; then
107
source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd /qiita; pip install -e . --no-binary redbiom;
118
fi
129

13-
# # We execute qiita-env make every time. We expect that it will fail always but the very first time, as the qiita DB should exist from then on
14-
# source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd /qiita; qiita-env make --no-load-ontologies 2> .env-make.err || true
15-
# # To avoid confusing the user, STDERR is written into a file and only reported if it does not contain the text that we expect to see if it just reports the existing DB
16-
# grep 'already present on the system. You can drop it by running' .env-make.err > /dev/null || cat .env-make.err
10+
# proper listening and reacting to SIGTERM
11+
cleanup() {
12+
echo "Received SIGTERM, stopping..."
13+
kill "$PY_PID" 2>/dev/null
14+
wait "$PY_PID"
15+
exit 0
16+
}
17+
trap cleanup SIGTERM SIGINT
1718

18-
# This was commented out bc it stopped working anymore and i was focusing on fixing something else, if you create the database for the first
19-
# time you will have to pick the appropriate options.
20-
#if [ "$( export PGPASSWORD='postgres'; psql -h qiita-db -U postgres -XtAc "SELECT 1 FROM postgres WHERE datname='qiita_test'" )" = '1' ]
21-
#then
22-
# qiita pet webserver --no-build-docs start --port 21174 --master
23-
#else
24-
# qiita-env make --no-load-ontologies
25-
# qiita pet webserver --no-build-docs start --port 21174 --master
26-
#fi
27-
#qiita-env make --no-load-ontologies; true
28-
#mkdir -p /qiita/plugins
29-
#sleep 3
30-
source $CONDA_DIR/etc/profile.d/conda.sh; conda activate $CONDA_DIR/envs/$ENV_NAME; cd /qiita && qiita pet webserver --no-build-docs start --port $PORT $MASTER 2> /logs/qiita_pet$MASTER.log 1>&2
19+
source $CONDA_DIR/etc/profile.d/conda.sh
20+
conda activate $CONDA_DIR/envs/$ENV_NAME
21+
cd /qiita
22+
# start Qiita and safe PID in variable
23+
qiita pet webserver --no-build-docs start --port $PORT $MASTER 2> /logs/qiita_pet$MASTER.log 1>&2 &
24+
PY_PID=$!
3125

32-
tail -f /dev/null
26+
# wait till Qiita process is terminated
27+
wait "$PY_PID"

Images/qp-deblur/qp-deblur.dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ RUN sed -i "s|/opt/conda/envs/deblur/share/fragment-insertion/sepp/.sepp/bundled
106106

107107
# install tornado based trigger layer in base environment
108108
RUN pip install -U --no-cache-dir tornado pip-system-certs
109-
COPY trigger_noconda.py /trigger.py
109+
COPY trigger.py /trigger.py
110110
# ^^ 848 MB
111111

112112
WORKDIR /
113113

114-
COPY start_qp-deblur.sh .
115-
RUN chmod 755 start_qp-deblur.sh
114+
COPY start_plugin.sh .
115+
RUN chmod 755 start_plugin.sh
116116

117117
RUN mkdir -p /unshared_plugins
118118
ENV QIITA_PLUGINS_DIR=/unshared_plugins/
@@ -140,5 +140,5 @@ RUN sed -i "s|source /opt/conda/etc/profile.d/conda.sh; conda activate /opt/cond
140140
# for testing
141141
COPY test_plugin.sh /test_plugin.sh
142142

143-
CMD ["./start_qp-deblur.sh"]
143+
CMD ["./start_plugin.sh"]
144144
# ^^ 848 MB

Images/qp-deblur/start_qp-deblur.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

Images/qp-qiime2/qp-qiime2.dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \
9696

9797
WORKDIR /
9898

99-
COPY start_qp-qiime2.sh .
100-
RUN chmod 755 start_qp-qiime2.sh
99+
COPY start_plugin.sh .
100+
RUN chmod 755 start_plugin.sh
101101

102102
RUN mkdir -p /unshared_plugins
103103
ENV QIITA_PLUGINS_DIR=/unshared_plugins/
@@ -118,4 +118,4 @@ RUN /qp-qiime2/scripts/configure_qiime2 --env-script 'true' --server-cert `find
118118
# for testing
119119
COPY test_plugin.sh /test_plugin.sh
120120

121-
CMD ["./start_qp-qiime2.sh"]
121+
CMD ["./start_plugin.sh"]

Images/qp-qiime2/start_qp-qiime2.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

Images/qp-target-gene/qp-target-gene.dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ COPY --from=builder /opt/conda/envs/qp-target-gene/lib/libpython2.7.so.1.0 /usr/
107107
# "install" pigz
108108
COPY --from=builder /opt/conda/envs/qp-target-gene/bin/pigz /usr/local/bin/
109109

110-
COPY start_qp-target-gene.sh .
111-
RUN chmod 755 start_qp-target-gene.sh
110+
COPY start_plugin.sh .
111+
RUN chmod 755 start_plugin.sh
112112

113113
RUN mkdir -p /unshared_plugins
114114
ENV QIITA_PLUGINS_DIR=/unshared_plugins/
115115

116116
RUN pip3 install tornado
117-
COPY trigger_noconda.py /trigger.py
117+
COPY trigger.py /trigger.py
118118

119119
# copy sortmerna binaries
120120
COPY --from=builder /sortmerna-2.0/sortmerna /usr/local/bin/sortmerna
@@ -135,4 +135,4 @@ RUN sed -i -E "s/^START_SCRIPT = .+/START_SCRIPT = python \/start_plugin.py qp-t
135135
# for testing
136136
COPY test_plugin.sh /test_plugin.sh
137137

138-
CMD ["./start_qp-target-gene.sh"]
138+
CMD ["./start_plugin.sh"]

0 commit comments

Comments
 (0)