Skip to content
GitLab
Explore
Sign in
ExaCT
Rosetta
Compare revisions
654ce7bbab02225331e43fcb3f61ce67bef10bee to af8f51e76edcd36f90a6403ff7a6cdca0e28665d
Commits on Source (2)
Removed any conf files, now using only env vars.
· 47dd42e4
Stefano Alberto Russo
authored
May 29, 2022
47dd42e4
Fixes in setting up the task proxy connections.
· af8f51e7
Stefano Alberto Russo
authored
Jun 03, 2022
af8f51e7
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
af8f51e7
...
...
@@ -17,9 +17,9 @@ Requirements:
*
Windows not fully supported in development mode due to lack of support for symbolic links.
Setup
Inizialize
$
rosetta/setup
$
cp docker-compose-dev.yml docker-compose.yml
Build
...
...
@@ -46,6 +46,12 @@ Clean
Webapp service configuraion parameters and their defaults:
- SAFEMODE=false
- DJANGO_DB_ENGINE="django.db.backends.postgresql_psycopg2"
- DJANGO_DB_NAME="rosetta"
- DJANGO_DB_USER="rosetta_master"
- DJANGO_DB_PASSWORD="949fa84a"
- DJANGO_DB_HOST="postgres"
- DJANGO_DB_PORT=5432
- DJANGO_DEV_SERVER=true
- DJANGO_DEBUG=true
- DJANGO_LOG_LEVEL=ERROR
...
...
docker-compose-dev.yml
View file @
af8f51e7
...
...
@@ -10,7 +10,6 @@ services:
privileged
:
true
volumes
:
-
./data/shared:/shared
# - ./data/singularity_cache:/rosetta/.singularity/cache # Not working, check permissions...
slurmclusterworker
:
image
:
"
rosetta/slurmclusterworker"
...
...
@@ -54,6 +53,12 @@ services:
hostname
:
webapp
environment
:
-
SAFEMODE=False
-
DJANGO_DB_ENGINE="django.db.backends.postgresql_psycopg2"
-
DJANGO_DB_NAME="rosetta"
-
DJANGO_DB_USER="rosetta_master"
-
DJANGO_DB_PASSWORD="949fa84a"
-
DJANGO_DB_HOST="postgres"
-
DJANGO_DB_PORT=5432
-
DJANGO_DEV_SERVER=True
-
DJANGO_DEBUG=True
-
DJANGO_LOG_LEVEL=CRITICAL
...
...
@@ -68,6 +73,7 @@ services:
#- ROSETTA_TASKS_PROXY_HOST=
#- ROSETTA_TASKS_TUNNEL_HOST=
-
ROSETTA_HOST=localhost
ports
:
-
"
8080:8080"
-
"
7000-7020:7000-7020"
...
...
rosetta/setup
deleted
100755 → 0
View file @
22852136
#!/bin/bash
# Use dev (local) database for backend if not alredy set up
if
[
!
-f
services/webapp/db_conf.sh
]
;
then
echo
"Using dev webapp database settings."
cp
services/webapp/db_conf-dev.sh services/webapp/db_conf.sh
else
echo
"Not using dev webapp database settings as settings are already present."
fi
# Use dev docker-compose.yml if not already set up
if
[
!
-f
docker-compose.yml
]
;
then
echo
"Using dev docker-compose.yml"
cp
docker-compose-dev.yml docker-compose.yml
else
echo
"Not using dev docker-compose.yml as already present."
fi
services/webapp/Dockerfile
View file @
af8f51e7
...
...
@@ -60,9 +60,6 @@ COPY code /opt/code
# Fix permissions
RUN
chown
-R
rosetta:rosetta /opt/code
# Copy db conf
COPY
db_conf.sh /db_conf.sh
# Prepare for logs
RUN
mkdir
/var/log/webapp/
&&
chown
rosetta:rosetta /var/log/webapp/
...
...
services/webapp/code/rosetta/core_app/utils.py
View file @
af8f51e7
...
...
@@ -637,9 +637,9 @@ Listen '''+str(task.tcp_tunnel_port)+'''
<VirtualHost *:
'''
+
str
(
task
.
tcp_tunnel_port
)
+
'''
>
ServerAdmin admin@rosetta.platform
SSLEngine on
SSLCertificateFile /
root/certificates/rosetta_platform/rosetta_platform.crt
SSLCertificateKeyFile /
root/certificates/rosetta_platform/rosetta_platform.key
SSLCACertificateFile /
root/certificates/rosetta_platform/rosetta_platform.ca-bundle
SSLCertificateFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/cert.pem
SSLCertificateKeyFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/privkey.pem
SSLCACertificateFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/fullchain.pem
DocumentRoot /var/www/html
</VirtualHost>
...
...
@@ -649,10 +649,10 @@ Listen '''+str(task.tcp_tunnel_port)+'''
ServerAdmin admin@rosetta.platform
SSLEngine on
SSLCertificateFile /
root/certificates/rosetta_platform/rosetta_tasks.crt
SSLCertificateKeyFile /
root/certificates/rosetta_platform/rosetta_tasks.key
SSLCACertificateFile /
root/certificates/rosetta_platform/rosetta_tasks.ca-bundle
SSLCertificateFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/cert.pem
SSLCertificateKeyFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/privkey.pem
SSLCACertificateFile /
etc/letsencrypt/live/
'''
+
rosetta_tasks_proxy_host
+
'''
/fullchain.pem
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
...
...
@@ -700,13 +700,13 @@ Listen '''+str(task.tcp_tunnel_port)+'''
out
=
os_shell
(
'
ssh -o StrictHostKeyChecking=no proxy
"
sudo ln -s /shared/etc_apache2_sites_enabled/{0}.conf /etc/apache2/sites-enabled/{0}.conf
"'
.
format
(
task
.
uuid
),
capture
=
True
)
if
out
.
exit_code
!=
0
:
logger
.
error
(
out
.
stderr
)
raise
ErrorMessage
(
'
Somthing went wrong when activating the task proxy conf
'
)
raise
ErrorMessage
(
'
Som
e
thing went wrong when activating the task proxy conf
'
)
# Reload apache conf on Proxy
out
=
os_shell
(
'
ssh -o StrictHostKeyChecking=no proxy
"
sudo apache2ctl graceful
"'
,
capture
=
True
)
if
out
.
exit_code
!=
0
:
logger
.
error
(
out
.
stderr
)
raise
ErrorMessage
(
'
Somthing went wrong when loading the task proxy conf
'
)
raise
ErrorMessage
(
'
Som
e
thing went wrong when loading the task proxy conf
'
)
...
...
services/webapp/db_conf-dev.sh
deleted
100644 → 0
View file @
22852136
#!/bin/bash
# SQlite Django DB conf
#export DJANGO_DB_ENGINE="django.db.backends.sqlite3"
#export DJANGO_DB_NAME="/data/resources/database.sqlite3"
# Postgres Django DB conf
export
DJANGO_DB_ENGINE
=
"django.db.backends.postgresql_psycopg2"
export
DJANGO_DB_NAME
=
"rosetta"
export
DJANGO_DB_USER
=
"rosetta_master"
export
DJANGO_DB_PASSWORD
=
"949fa84a"
export
DJANGO_DB_HOST
=
"postgres"
export
DJANGO_DB_PORT
=
5432
services/webapp/run_webapp.sh
View file @
af8f51e7
...
...
@@ -14,9 +14,6 @@ echo ""
# Load env
source
/env.sh
# Database conf
source
/db_conf.sh
# Stay quiet on Python warnings
export
PYTHONWARNINGS
=
ignore
...
...