Skip to content
Snippets Groups Projects
Commit 6c89b5b6 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'update-frontend' into newmain

parents c160f46c 7ee31ca6
No related branches found
No related tags found
2 merge requests!98Draft: Newmaster,!96Draft: Newmain
Showing with 5 additions and 375 deletions
......@@ -66,7 +66,7 @@ data/project_*
.idea/
# ignore this datafile, now too big
data/initTable.hdf5
data/initTable*.hdf5
data/workTable.hdf5
# ignore the data
......@@ -78,6 +78,7 @@ data/meta_table.csv
data/out/
data/rawGWASfiles/
projects/project_*
projects/celery_results
# Ignore MacOS Files
**/.DS_Store
......@@ -23,7 +23,7 @@ test-python:
# '3.9',
'3.10',
# '3.11',
]
]
test-docker-compose:
......
# JASS ansible playbooks
This repository contains the playbooks to manage a JASS instance with ansible
- `system.yaml`: install system requirements
- `deploy.yaml`: download/update JASS and perform required procedures to migrate and restart
## how to use these ?
```
ansible-playbook -v -i ./hosts_system system.yaml --ask-become-pass --extra-vars "deploy_user_name=jass repo_api_token=XXXXXX"
ansible-playbook -v -i ./hosts_deploy deploy.yaml --ask-become-pass --extra-vars "deploy_user_name=jass repo_api_token=XXXXXX"
```
[Unit]
Description=Celery Service
After=network.target
[Service]
Type=forking
User=jass
Group=nginx
EnvironmentFile=-/etc/default/celeryd
WorkingDirectory=/var/jass_data
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]
WantedBy=multi-user.target
CELERYD_NODES="worker"
CELERY_BIN="celery"
CELERY_APP="jass"
CELERYD_CHDIR="/var/jass_data"
CELERYD_OPTS="--time-limit=3000 --concurrency=1 --max-tasks-per-child=1"
CELERYD_LOG_FILE="/var/jass_data/celery%N.log"
CELERYD_PID_FILE="/var/jass_data/celery%N.pid"
CELERYD_LOG_LEVEL="DEBUG"
CELERYD_USER="jass"
CELERYD_GROUP="nginx"
CELERY_CREATE_DIRS=1
---
- hosts: all
become: yes
gather_facts: yes
tasks:
# stop uwsgi service
- name: stop JASS service
systemd: state=stopped name=jass-uwsgi enabled=true
ignore_errors: yes
when: not docker
# stop nginx service
- name: stop nginx service
systemd: state=stopped name=nginx enabled=true
ignore_errors: yes
when: not docker
# stop celery service
- name: stop celery service
systemd: state=stopped name=celery enabled=true
ignore_errors: yes
when: not docker
- name: update yum
become: true
yum: name=* state=latest
- name: install yum utils
become: true
yum: name=yum-utils state=latest
- name: install the 'Development tools' package group
become: true
yum:
name: "@Development tools"
state: present
- name: add repo IUS
become: true
yum:
name: https://repo.ius.io/ius-release-el7.rpm
state: present
- name: install git
become: true
yum: name=git state=latest
- name: install python
become: true
yum: name=python36u state=latest
- name: install pip
become: true
yum: name=python36u-pip state=latest
- name: install python36u-devel
become: true
yum: name=python36u-devel state=latest
- name: pcre
become: true
yum: name=pcre state=latest
- name: pcre-devel
become: true
yum: name=pcre-devel state=latest
- name: install git
yum: name=git state=latest
become: true
- name: epel-release
become: true
yum: name=epel-release state=latest
- name: nginx
become: true
yum: name=nginx state=latest
- name: zlib-devel # required by Pillow
become: true
yum: name=zlib-devel state=latest
- name: libjpeg-turbo-devel # required by Pillow
become: true
yum: name=libjpeg-turbo-devel state=latest
- pip:
name: wheel
executable: pip3.6
# install jass on server
- name: install jass from gitlab
pip:
name: git+https://gitlab.pasteur.fr/statistical-genetics/jass.git
state: forcereinstall
executable: pip3.6
when: not docker
- name: download JASS frozen requirements file
get_url:
url: https://gitlab.pasteur.fr/statistical-genetics/jass/raw/master/requirements.txt
dest: /tmp/requirements.txt
force: yes
when: not docker
- pip:
requirements: /tmp/requirements.txt
state: forcereinstall
executable: pip3.6
when: not docker
# install jass on docker
- name: install jass from local
pip:
editable: true
name: file:///code/
state: forcereinstall
executable: pip3.6
when: docker
- name: install jass deps from local
pip:
requirements: /code/ansible/reqs-docker.txt
state: forcereinstall
executable: pip3.6
when: docker
# install python web deps
- name: install uwsgi
pip:
name: uwsgi
executable: pip3.6
become: true
- name: copy nginx config
become: true
copy:
src: nginx.conf
dest: /etc/nginx/nginx.conf
- name: copy systemd service file for JASS-web
copy:
src: jass-uwsgi.service
dest: /lib/systemd/system/jass-uwsgi.service
owner: root
group: root
- name: copy JASS uwsgi configuration file
copy:
src: jass_uwsgi.ini
dest: /var/jass_data
owner: '{{ deploy_user_name }}'
group: nginx
- name: copy celeryd configuration file
copy:
src: celeryd
dest: /etc/default
owner: root
group: root
- name: copy celery systemd service
copy:
src: celery.service
dest: /lib/systemd/system/celery.service
owner: root
group: root
# start uwsgi service
- name: start JASS service if relevant
systemd: state=started name=jass-uwsgi enabled=true daemon_reload=true
when: not docker
# start nginx service
- name: start NGINX service if relevant
systemd: state=started name=nginx enabled=true daemon_reload=true
when: not docker
# start celery service
- name: start celery service if relevant
systemd: state=started name=celery enabled=true daemon_reload=true
when: not docker
hub17.hosting.pasteur.fr ansible_user=jass
127.0.0.1 ansible_connection=local
jass.pasteur.fr
[Unit]
Description=uWSGI instance to serve JASS
After=network.target
[Service]
User=jass
Group=nginx
WorkingDirectory=/var/jass_data
ExecStart=/bin/uwsgi --ini jass_uwsgi.ini
[Install]
WantedBy=multi-user.target
[Unit]
Description=JASS Web Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/jass/apachectl start
ExecStop=/etc/jass/apachectl stop
[Install]
WantedBy=multi-user.target
[uwsgi]
env = JASS_DATA_DIR=/var/jass_data
module = jass.wsgi
master = true
processes = 5
socket = jass_web.sock
chmod-socket = 660
vacuum = true
die-on-term = true
logto = /var/jass_data/uwsgi_error_log
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
include uwsgi_params;
uwsgi_pass unix:/var/jass_data/jass_web.sock;
uwsgi_read_timeout 3600;
uwsgi_max_temp_file_size 10240m;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
{
"deploy_user_name":"root",
"docker":true,
}
{
"deploy_user_name":"jass",
"docker":false,
"repo_api_token":"$REPO_API_TOKEN"
}
-r ../requirements.txt
{"id": "Statistical-Genetics/jass","title" : "jass_deploy_key","key": "{{ key_value.stdout }}"}
jass.pasteur.fr
---
- hosts: all
gather_facts: no
tasks:
#
# User and Group configuration
#
# application user ({{deploy_user_name}}) is created
# in the wheel group, which has to be passwordless sudo
# and upload the key as a deploy key to gitlab
- name: Make sure we have a 'wheel' group
become: true
group:
name: wheel
state: present
- name: Allow 'wheel' group to have passwordless sudo
become: true
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
- name: Create {{ deploy_user_name }} user
user: name={{ deploy_user_name }} groups=wheel,nginx append=yes state=present createhome=yes generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa
become: true
- name: Cat deployer's user public key
shell: "cat /home/{{ deploy_user_name }}/.ssh/id_rsa.pub"
register: key_value
become: true
- name: Create ssh_key json
template: src=ssh_key.json.j2 dest=/home/{{ deploy_user_name }}/ssh_key.json group={{ deploy_user_name }} owner={{ deploy_user_name }} force=yes
become: true
- name: Cat deployer's user public key
shell: "cat /home/{{ deploy_user_name }}/ssh_key.json"
become: true
- name: Upload deploy keys to gitlab
shell: "curl -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -H 'PRIVATE-TOKEN: {{ repo_api_token }}' --data-binary @/home/{{ deploy_user_name }}/ssh_key.json https://gitlab.pasteur.fr/api/v3/projects/251/keys"
become: true
#
# Security configuration
#
# disable SELinux, and open firewall to incoming http
- name: disable SELinux
become: true
selinux:
state: disabled
- name: Open firewall to HTTP traffic
firewalld:
service: http
permanent: true
state: enabled
become: true
......@@ -18,6 +18,7 @@ module.exports = {
// add your custom rules here
rules: {
"no-unused-vars": "off",
'no-console': 'off'
'no-console': 'off',
'vue/valid-v-slot': 'off'
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment