Skip to content

Commit 44429c1

Browse files
authored
Merge pull request #269 from bgruening/16.10
Release 16.10
2 parents 4368d2f + 572cae0 commit 44429c1

18 files changed

+15610
-39
lines changed

.travis.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ services:
77
- docker
88

99
env:
10+
matrix:
11+
- TOX_ENV=py27
12+
- COMPOSE=True
1013
global:
11-
- TOX_ENV=py27
12-
- COMPOSE=True
13-
- secure: "PgEA6vDYZWAIZ3KyUTeA9SNSNR+eJU3kBkoEIsTnmnkyta0Z0VbIv98B9ApYeiC0VHpVzY1gblimmkXSY5+4oD9tUxpA630cUhE9iLNuo5o3MpRFun8nf8H6Jz2Y/PaPw3VPLKsH49LJYgJXeqgzoV7FHrpUP9Q3/5dycWybV2I="
14+
- secure: "PgEA6vDYZWAIZ3KyUTeA9SNSNR+eJU3kBkoEIsTnmnkyta0Z0VbIv98B9ApYeiC0VHpVzY1gblimmkXSY5+4oD9tUxpA630cUhE9iLNuo5o3MpRFun8nf8H6Jz2Y/PaPw3VPLKsH49LJYgJXeqgzoV7FHrpUP9Q3/5dycWybV2I="
1415

1516
git:
1617
submodules: false
@@ -41,8 +42,11 @@ before_install:
4142
cd compose
4243
docker build -t quay.io/galaxy/proftpd ./proftpd
4344
docker tag quay.io/galaxy/proftpd quay.io/galaxy/proftpd:compose
45+
docker build -t quay.io/galaxy/postgres ./postgres-galaxy
46+
docker tag quay.io/galaxy/postgres quay.io/galaxy/postgres:compose
4447
docker tag quay.io/bgruening/galaxy quay.io/bgruening/galaxy:compose
4548
docker-compose --project-name galaxy_compose up -d
49+
sleep 50
4650
else
4751
mkdir local_folder
4852
docker run -d -p 8080:80 -p 8021:21 -p 8022:22 \
@@ -69,12 +73,16 @@ script:
6973
# Test submitting jobs to an external gridengine cluster
7074
- cd $TRAVIS_BUILD_DIR/test/gridengine/ && bash test.sh && cd $TRAVIS_BUILD_DIR
7175
# Test FTP Server
72-
- curl --fail $BIOBLEND_GALAXY_URL/api/version
73-
- date > time.txt && curl --fail -T time.txt ftp://localhost:8021 --user $GALAXY_USER:$GALAXY_USER_PASSWD
74-
- curl --fail ftp://localhost:8021 --user $GALAXY_USER:$GALAXY_USER_PASSWD
76+
- curl -v --fail $BIOBLEND_GALAXY_URL/api/version
77+
- date > time.txt && curl -v --fail -T time.txt ftp://localhost:8021 --user $GALAXY_USER:$GALAXY_USER_PASSWD
78+
- curl -v --fail ftp://localhost:8021 --user $GALAXY_USER:$GALAXY_USER_PASSWD
7579

7680
# Test SFTP Server
7781
- sshpass -p $GALAXY_USER_PASSWD sftp -v -P 8022 -o User=$GALAXY_USER -o "StrictHostKeyChecking no" localhost <<< $'put time.txt'
82+
# Test self-signed HTTPS
83+
- docker run -d -p 443:443 -e "USE_HTTPS=True" quay.io/bgruening/galaxy
84+
- sleep 60s && curl -v -k --fail https://127.0.0.1:443/api/version
85+
- echo | openssl s_client -connect 127.0.0.1:443 2>/dev/null | openssl x509 -issuer -noout| grep selfsigned
7886

7987
- cd $TRAVIS_BUILD_DIR/test/bioblend/ && bash test.sh && cd $TRAVIS_BUILD_DIR/
8088
# Test the 'old' tool installation script

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The Galaxy welcome screen can be changed by providing a `welcome.html` page in `
233233

234234
## Deactivating services <a name="Deactivating-services" /> [[toc]](#toc)
235235

236-
Non-essential services can be deactivated during startup. Set the environment variable `NONUSE` to a comma separated list of services. Currently, `nodejs`, `proftp`, `reports`, `slurmd` and `slurmctld` are supported.
236+
Non-essential services can be deactivated during startup. Set the environment variable `NONUSE` to a comma separated list of services. Currently, `nodejs`, `postgres`, `proftp`, `reports`, `slurmd` and `slurmctld` are supported.
237237

238238
```sh
239239
docker run -d -p 8080:80 -p 9002:9002 \
@@ -578,6 +578,8 @@ git submodule update --init --recursive
578578
- documentation and tests updates for SLURM integration by @mvdbeek
579579
- first version with initial Docker compose support (proftpd ✔️)
580580
- SFTP support by @zfrenchee
581+
- 16.10:
582+
- [HTTPS support](https://github.com/bgruening/docker-galaxy-stable/pull/240 ) by @zfrenchee and @mvdbeek
581583

582584
# Support & Bug Reports <a name="Support-Bug-Reports" /> [[toc]](#toc)
583585

compose/Readme.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Galaxy Docker Compose
2+
=====================
3+
4+
# Table of Contents <a name="toc" />
5+
6+
- [Usage](#Usage)
7+
- [Build](#Build)
8+
- [Roadmap](#Roadmap)
9+
- [Advanced](#Advanced)
10+
- [postgres](#postgres)
11+
- [Configuration](#postgres-Configuration)
12+
- [proftpd](#proftpd)
13+
- [Configuration](#proftpd-Configuration)
14+
15+
# Usage <a name="Usage" /> [[toc]](#toc)
16+
17+
At first you need to install docker with compose.
18+
- [docker](https://docs.docker.com/installation/)
19+
- [docker-compose](https://docs.docker.com/compose/install/)
20+
21+
# Build <a name="Build" /> [[toc]](#toc)
22+
23+
Checkout the repository:
24+
```
25+
git checkout https://github.com/bgruening/docker-galaxy-stable.git
26+
cd docker-galaxy-stable/compose
27+
```
28+
29+
Build the compose containers:
30+
```sh
31+
./buildlocal.sh
32+
```
33+
After successful installation you can run the compose file:
34+
```sh
35+
docker-compose up -d
36+
```
37+
38+
39+
# Roadmap <a name="Roadmap" /> [[toc]](#toc)
40+
41+
We wish to split the monolithic container into its components, i.e. postgres, proftpd, slurm, nginx (more?)
42+
So far postgres and proftpd are working.
43+
44+
# Advanced <a name="Advanced" /> [[toc]](#toc)
45+
46+
## postgres <a name="postgres" /> [[toc]](#toc)
47+
You can theoretically use any external database. The included postgres build is based on the [official postgres container](https://hub.docker.com/_/postgres/) and adds an initialization script which loads a vanilla dump of the initial database state on first startup.
48+
49+
In case you want to generate an initial database dump yourself:
50+
```sh
51+
./dumpsql.sh
52+
./buildlocal.sh
53+
```
54+
55+
To manually initialize a database without the dump connected via docker-compose.yml, before starting the galaxy container you can run:
56+
```sh
57+
docker-compose run galaxy install_db.sh
58+
```
59+
which will perform database migration.
60+
61+
### Configuration <a name="postgres-Configuration" /> [[toc]](#toc)
62+
See [official postgres container](https://hub.docker.com/_/postgres/).
63+
64+
## proftpd <a name="proftpd" /> [[toc]](#toc)
65+
66+
Proftpd uses the [ansible galaxy extras project](https://github.com/galaxyproject/ansible-galaxy-extras) to configurate proftpd.
67+
68+
### Configuration <a name="proftpd-Configuration" /> [[toc]](#toc)
69+
70+
- *proftpd\_db\_connection*=_database@host_: Configurates the database name and hostname. Hostname can be a linked database container.
71+
- *proftpd\_db\_username*=_dbuser_: User in the database.
72+
- *proftpd\_db\_password*=_dbpass_: Password of the user in the database.
73+
- *proftpd\_files\_dir*=_/export/ftp_: Directory where the user files are to be placed. Should be synchronized with volumes.
74+
- *proftpd\_sql\_auth\_type*=_SHA1_: Authentication type used in the galaxy database (SHA1|PBKDF2).
75+
- *proftpd\_welcome*=_Public Galaxy FTP_: Welcome message.
76+
- *proftpd\_passive\_port\_low*=_30000_, *proftpd\_passive\_port\_high*=_40000_: Passive mode port range. This should be kept small for docker exposing the range (30000-30010 or so), because docker allocates each port separately which makes the process stale. Should be same as exposed ports.
77+
- *proftpd\_use\_sftp*=_false_: Enable sftp.
78+
- *proftpd\_nat\_masquerade*=_false_: Set masquearade to true if host is NAT'ed.
79+
- *proftpd\_masquerade\_address*=_ip_: Refers to the ip that clients use to establish an ftp connection. Can be a command that returns an IP or an IP address and applies only if proftpd\_nat\_masquerade is true. `\`ec2metadata --public-ipv4\`` returns the public ip for amazon's ec2 service.
80+

compose/buildlocal.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
docker build -t quay.io/bgruening/galaxy ../galaxy/
4+
docker tag quay.io/bgruening/galaxy quay.io/bgruening/galaxy:compose
5+
docker build -t quay.io/galaxy/proftpd ./proftpd
6+
docker tag quay.io/galaxy/proftpd quay.io/galaxy/proftpd:compose
7+
docker build -t quay.io/galaxy/postgres ./postgres-galaxy
8+
docker tag quay.io/galaxy/postgres quay.io/galaxy/postgres:compose

compose/docker-compose.yml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,76 @@
11
version: '2'
22
services:
33
# proftpd container
4-
proftp:
4+
proftpd:
5+
# build: proftpd
56
image: quay.io/galaxy/proftpd:compose
6-
container_name: galaxy-proftp
7+
environment:
8+
- proftpd_db_connection=galaxy@db
9+
- proftpd_db_username=galaxy
10+
- proftpd_db_password=chaopagoosaequuashie
11+
- proftpd_files_dir=/export/ftp
12+
- proftpd_use_sftp=True
13+
- proftpd_passive_port_low=30000
14+
- proftpd_passive_port_high=30010
15+
container_name: galaxy-proftpd
716
volumes:
8-
- ftp_config:/etc/proftpd/
917
- ftp_data:/export/ftp
1018
expose:
1119
- 21
1220
- 22
1321
ports:
1422
- "8021:21"
1523
- "8022:22"
16-
# proftpd config files from Galaxy are needed
17-
depends_on:
18-
- galaxy
24+
- "30000-30010:30000-30010"
1925
links:
20-
- galaxy:galaxy.local
26+
- postgres:db
2127
restart: always
22-
hostname: galaxy-proftp
28+
hostname: galaxy-proftpd
29+
30+
postgres:
31+
# Using the official postgres image. This needs to be populated by calling
32+
# docker-compose run galaxy install_db.sh
33+
# on first run
34+
# image: postgres
35+
# This comes with an initialization to quickly populate the database on first start
36+
# build: postgres-galaxy
37+
image: quay.io/galaxy/postgres:compose
38+
container_name: galaxy-postgres
39+
environment:
40+
- POSTGRES_PASSWORD=chaopagoosaequuashie
41+
- POSTGRES_USER=galaxy
42+
- POSTGRES_DB=galaxy
43+
volumes:
44+
- ./postgres-storage:/var/lib/postgresql/data
45+
hostname: galaxy-postgres
46+
2347

2448

2549
# Main Galaxy container
2650
galaxy:
51+
# build: ../galaxy
2752
image: quay.io/bgruening/galaxy:compose
2853
environment:
2954
# Insert here your environment variables to change Galaxy's behaviour.
3055
# For example to personalise Galaxy by changing the branding with
3156
# - GALAXY_CONFIG_BRAND=FOO
32-
- NONUSE=proftp
57+
- NONUSE=proftp postgres
3358
- GALAXY_CONFIG_FTP_UPLOAD_DIR=/export/ftp
3459
- GALAXY_CONFIG_ALLOW_USER_DATASET_PURGE=True
3560
- GALAXY_CONFIG_ALLOW_LIBRARY_PATH_PASTE=True
3661
- GALAXY_CONFIG_ENABLE_USER_DELETION=True
3762
- GALAXY_CONFIG_ENABLE_BETA_WORKFLOW_MODULES=True
63+
- GALAXY_CONFIG_DATABASE_CONNECTION=postgresql://galaxy:chaopagoosaequuashie@db/galaxy?client_encoding=utf8
64+
65+
- GALAXY_DEFAULT_ADMIN_PASSWORD=admin
66+
- GALAXY_DEFAULT_ADMIN_KEY=admin
3867
ports:
3968
- "8080:80" # nginx
4069
- "9002:9002" # supervisor web-interface - not super useful in compose mode
70+
links:
71+
- postgres:db
4172
container_name: galaxy
4273
volumes:
43-
- ftp_config:/etc/proftpd/
4474
- ftp_data:/export/ftp
4575
# This is the directory where all your files from Galaxy will be stored
4676
# on your host system
@@ -49,5 +79,4 @@ services:
4979
privileged: True
5080

5181
volumes:
52-
ftp_config: {}
5382
ftp_data: {}

compose/dumpsql.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Sets the image of postgres to use
3+
POSTGRES=postgres
4+
POSTGRES_USER=galaxy
5+
POSTGRES_PASSWORD=chaopagoosaequuashie
6+
POSTGRES_DB=galaxy
7+
# Create postgres in detached mode
8+
pg_start=`date +%s`
9+
docker run -d --name "dumpsql_postgres" -e "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" -e "POSTGRES_USER=$POSTGRES_USER" -e "POSTGRES_DB=$POSTGRES_DB" $POSTGRES
10+
# Output postgres log
11+
docker logs -f dumpsql_postgres &
12+
# Wait until postgres has initialized
13+
until docker run --rm --link dumpsql_postgres:pg $POSTGRES pg_isready -U postgres -h pg >/dev/null; do sleep 1; done
14+
pg_end=`date +%s`
15+
init_start=`date +%s`
16+
docker run -i --rm --name "dumpsql_galaxy_installdb" -e "GALAXY_CONFIG_DATABASE_CONNECTION=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db/$POSTGRES_DB?client_encoding=utf8" --link "dumpsql_postgres:db" quay.io/bgruening/galaxy:compose install_db.sh
17+
init_end=`date +%s`
18+
dump_start=`date +%s`
19+
docker exec "dumpsql_postgres" pg_dump --no-tablespace --no-acl --no-owner -U postgres galaxy > postgres-galaxy/init-galaxy-db.sql.in
20+
dump_end=`date +%s`
21+
docker rm -f dumpsql_postgres
22+
echo "Stats:"
23+
echo "Startup postgres: $((pg_end-pg_start)) sec"
24+
echo "install_db: $((init_end-init_start)) sec"
25+
echo "pg_dumpall: $((dump_end-dump_start)) sec"
26+
echo "Total: $((dump_end-pg_start)) sec"

compose/postgres-galaxy/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM library/postgres
2+
ADD init-galaxy-db.sql.in /docker-entrypoint-initdb.d/
3+
ADD init-galaxy-db.sh /docker-entrypoint-initdb.d/
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
echo "Initializing galaxy database with defaults"
3+
"${psql[@]}" < /docker-entrypoint-initdb.d/init-galaxy-db.sql.in >/dev/null
4+
echo "Successfully initialized galaxy database"

0 commit comments

Comments
 (0)