Commit ff24f235 authored by Ryan Herbert's avatar Ryan Herbert

docker* add test build environment

allows the use of the 'build_env' build arg which will build the docker
image in "test" mode.
This has two consequences. The first is that all ocnfigurations files
are set to run the env over HTTP for ease of use. The second is the
installation of the necessary packages and programs required to run
watir functional tests in headless mode.

See #2881
parent e2223220
......@@ -242,7 +242,7 @@ test_server_unit:
test_server_functional:
stage: test_functional
script:
- docker build --build-args git_branch=$CI_BUILD_REF_SLUG -t $CI_BUILD_REF_SLUG docker/vidjil
- docker build --build-arg git_branch=$CI_BUILD_REF_SLUG --build-arg build_env=TEST -t $CI_BUILD_REF_SLUG docker/vidjil
- docker run $CI_BUILD_REF_SLUG HEADLESS=1 /usr/share/vidjil/server/web2py/vidjil/test/functional/launch_functional_tests test_*.rb
only:
- /^feature-.*s.*\/.*$/
......
......@@ -31,15 +31,24 @@ run cd /usr/share/vidjil/germline && make
copy ./conf/nginx_gzip_static.conf /etc/nginx/conf.d/web2py/gzip_static.conf
copy ./conf/nginx_gzip.conf /etc/nginx/conf.d/web2py/gzip.conf
copy ./conf/uwsgi.conf /etc/nginx/conf.d/web2py/uwsgi.conf
copy ./conf/nginx_web2py /etc/nginx/sites-enabled/web2py
copy ./conf/nginx_web2py /etc/nginx/sites-available/web2py
add ./scripts/install.sh /opt/install_scripts/install.sh
copy ./conf/defs.py /opt/vidjil_conf/defs.py
copy ./conf/defs_http.py /opt/vidjil_conf/defs_http.py
copy ./conf/conf.js /opt/vidjil_conf/conf.js
copy ./conf/conf_http.js /opt/vidjil_conf/conf_http.js
copy ./conf/nginx_web2py /opt/vidjil_conf/web2py
copy ./conf/nginx_web2py_http /opt/vidjil_conf/web2py_http
copy ./conf/Gemfile /usr/share/vidjil/Gemfile
arg build_env='PRODUCTION'
env BUILD_ENV $build_env
copy ./conf/uwsgi.ini /etc/uwsgi/apps-enabled/web2py.ini
run mkdir /etc/vidjil
copy ./conf/defs.py /etc/vidjil/defs.py
copy ./conf/conf.js /etc/vidjil/conf.js
run chmod +x /opt/install_scripts/install.sh && /opt/install_scripts/install.sh
run ln -s /etc/vidjil/defs.py /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py
run ln -s /etc/vidjil/conf.js /usr/share/vidjil/browser/js/conf.js
copy ./scripts/nginx-entrypoint.sh /entrypoints/nginx-entrypoint.sh
copy ./scripts/uwsgi-entrypoint.sh /entrypoints/uwsgi-entrypoint.sh
copy ./scripts/fuse-entrypoint.sh /entrypoints/fuse-entrypoint.sh
......
source 'http://rubygems.org'
gem 'minitest'
gem 'minitest-ci'
gem 'watir'
gem 'watir-webdriver'
gem 'test-unit'
gem 'headless'
/*
* Vidjil browser, main configuration file
* This file must be named 'js/conf.js' to be taken into account
* */
var config = {
/* Used for the 'align' script
* If this is not defined, the 'align' button is not available
*/
"cgi_address" : "http://localhost/cgi/", // Public test server
// "cgi_address" : "http://127.0.1.1/cgi-bin/",
/* The following options control how the user may have access to .vidjil files.
* Any combination of 1), 2) and 3) should work
*/
/* 1) Patient database */
"use_database" : true,
"db_address" : "http://localhost/vidjil/", // Public test server
"login" : "",
"password" : "",
/* 2) and 3) Static files
/* - relative paths if Vidjil browser is online on the same server
* - absolute paths to a CORS active server only if browser is offline or on another server
*/
/* 2) Menu with a list of static files */
"file_menu" : {
"path" : "/browser/data/",
"file" : [
"Stanford-S22.vidjil",
"L2-LIL-2.vidjil"
]
},
/* 3) Static file autoload, possibly with an .analysis file */
// "autoload" : "data/Stanford-S22.vidjil",
// "autoload_analysis" : "data/Stanford-S22.analysis"
// Proxy config for IMGT querying
"proxy": "http://localhost/vidjil/proxy/imgt"
}
###
### Vidjil server, main configuration file
### This file must be named 'modules/defs.py' to be taken into account
###
### Email notifications for server errors
SMTP_SERVER = 'localhost'
# SMTP_SERVER = 'logging' # no mail
FROM_EMAIL = 'notifications@vidjil.org'
ADMIN_EMAILS = ['notifications@vidjil.org']
### address for the sql database
###
DB_ADDRESS = 'sqlite://storage.sqlite'
DB_ADDRESS = 'mysql://vidjil:rootpass@mysql/vidjil'
DB_POOL_SIZE = 4
### Backup file
DB_BACKUP_FILE = 'backup.csv'
### Upload directory for .fasta/.fastq.
### Old sequences files could be thrown away.
### No regular backup.
DIR_SEQUENCES = '/mnt/upload/uploads/'
### Upload directory for .vidjil/.fused/.analysis
### Regularly backuped
DIR_RESULTS = '/mnt/result/results/'
### Temporary directory to store vidjil results, and basename of files in this directory
### Formatted with 'data_id' in models/task.py
DIR_OUT_VIDJIL_ID = '/mnt/result/tmp/out-%06d/'
DIR_PRE_VIDJIL_ID = '/mnt/result/tmp/pre/out-%06d/'
BASENAME_OUT_VIDJIL_ID = '%06d'
### Directory for program used in task.py
### relative path start from server/web2py
DIR_VIDJIL = '/usr/bin/'
DIR_FUSE = '../../tools'
DIR_MIXCR = '/usr/bin'
DIR_IGREC = '/usr/local/bin/'
DIR_GERMLINE = '/usr/share/vidjil/germline'
### Port on which to run the fuse server
### Used in models/task.py and in /server/fuse_server.py
FUSE_SERVER = 'fuse'
PORT_FUSE_SERVER = 12789
### Log files
DIR_LOG = '/var/vidjil/'
LOG_INFO = DIR_LOG + 'vidjil.log'
LOG_DEBUG = DIR_LOG + 'vidjil-debug.log'
### Timeouts
# Delay in seconds before a task is considered in timeout
TASK_TIMEOUT = 2 * 60 * 60
### Reverse IP file
REVERSE_IP = '/home/vidjil/ips.txt'
### Locus (should be parsed from germlines.data)
LOCUS = ['TRA', 'TRA+D', 'TRB', 'TRG', 'TRD', 'TRD+',
'IGH', 'IGH+', 'IGK', 'IGK+', 'IGL']
# Preventu upload and run when 1% space is left in target disk
FS_LOCK_THRESHHOLD = 1
SCHEDULER_HEARTBEAT = 5
# Directory to search for files
FILE_SOURCE = '/mnt/data/src'
FILE_TYPES = ['fasta', 'fastq', 'fastq.gz']
SET_TYPE_PATIENT = 'patient'
SET_TYPE_RUN= 'run'
SET_TYPE_GENERIC = 'generic'
REQUIRE_HTTPS = False
upstream uwsgi {
server localhost:8000;
}
server {
listen 80 default_server;
server_name $hostname;
keepalive_timeout 70;
uwsgi_max_temp_file_size 20480m;
location / {
include /etc/nginx/conf.d/web2py/uwsgi.conf;
proxy_read_timeout 600;
client_max_body_size 20G;
###
}
## if you serve static files through https, copy here the section
## from the previous server instance to manage static files
location /browser {
root /usr/share/vidjil;
expires 1h;
add_header Cache-Control must-revalidate;
error_page 405 = $uri;
}
location /germline {
root /usr/share/vidjil/;
expires 1h;
add_header Cache-Control must-revalidate;
error_page 405 = $uri;
}
###to enable correct use of response.static_version
#location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
# alias /usr/share/vidjil/server/web2py/applications/$1/static/$2;
# expires max;
#
#}
###
client_max_body_size 20G;
location /cgi/ {
gzip off;
root /usr/share/vidjil/browser/;
# Fastcgi socket
fastcgi_pass unix:/var/run/fcgiwrap.socket;
# Fastcgi parameters, include the standard ones
include /etc/nginx/fastcgi_params;
# Adjust non standard parameters (SCRIPT_FILENAME)
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location /vidjil/file/upload {
include /etc/nginx/conf.d/web2py/uwsgi.conf;
uwsgi_read_timeout 10m;
client_max_body_size 20G;
}
}
#!/bin/bash
echo "${BUILD_ENV}"
if [ "${BUILD_ENV}" = "TEST" ]; then
cp -avr /opt/vidjil_conf/defs_http.py /etc/vidjil/defs.py
cp -avr /opt/vidjil_conf/conf_http.js /etc/vidjil/conf.js
cp -avr /opt/vidjil_conf/web2py_http /etc/nginx/sites-enabled/web2py
apt-get update
apt-get install -y gcc make ruby-full firefox xvfb
gem install bundler
cd /usr/share/vidjil
bundle install
cd /usr/bin
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux32.tar.gz
tar -xvzf geckodriver-v0.20.1-linux32.tar.gz
unlink geckodriver-v0.20.1-linux32.tar.gz
chmod +x geckodriver
else
cp -avr /opt/vidjil_conf/defs.py /etc/vidjil/defs.py
cp -avr /opt/vidjil_conf/conf.js /etc/vidjil/conf.js
cp -avr /opt/vidjil_conf/web2py /etc/nginx/sites-enabled/web2py
fi;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment