├── VERSION ├── docs ├── index.md ├── about │ ├── license.md │ ├── author.md │ └── contributing.md ├── docs │ └── logo │ │ └── galaxy-launcher-transparant-small.png ├── logo │ ├── galaxy-launcher-transparent.png │ ├── galaxy-launcher-logo-export-space.png │ ├── galaxy-launcher-logo-export-space2.png │ ├── galaxy-launcher-logo-export-white.png │ ├── galaxy-launcher-transparant-small.png │ └── galaxy-launcher-logo-export-space-transparent.png ├── developer_docs │ ├── installdocker.md │ └── introduction.md ├── user_guide │ ├── installation.md │ └── install_administrate_cluster.md ├── known_issues.md └── tutorial │ └── tutorial.md ├── test ├── files │ ├── cluster-test │ ├── cluster-test2 │ ├── centos-7 │ │ └── placeholder.txt │ ├── ubuntu-16.04 │ │ └── placeholder.txt │ └── test │ │ ├── ssh │ │ └── example.backups.org │ │ │ └── public_key.sample │ │ ├── dbkeys │ │ └── dbkeys.yaml │ │ ├── welcome │ │ └── welcome.html │ │ └── tools │ │ └── tool_list.yaml ├── docker │ ├── cluster-test │ ├── gridengine-cluster │ │ └── Dockerfile │ ├── centos-7 │ │ ├── files │ │ │ ├── galaxy_ssh.pub │ │ │ └── galaxy_ssh │ │ └── Dockerfile │ ├── cluster-test2 │ │ ├── files │ │ │ ├── galaxy_ssh.pub │ │ │ ├── galaxy_ssh │ │ │ └── sshd_config │ │ └── Dockerfile │ └── ubuntu-16.04 │ │ ├── files │ │ ├── galaxy_ssh.pub │ │ ├── galaxy_ssh │ │ └── sshd_config │ │ └── Dockerfile ├── host_vars │ ├── cluster-test2 │ └── cluster-test │ │ ├── test_settings.yaml │ │ ├── ldap_settings.yml │ │ ├── web_settings.yml │ │ ├── docker_settings.yml │ │ ├── upgrade_settings.yml │ │ ├── files_settings.yml │ │ ├── backup_settings.yml │ │ ├── galaxy_settings.yml │ │ └── cluster_settings.yml ├── variables │ ├── centos-7.sh │ ├── ubuntu-16.04.sh │ ├── standalone_vms.sh │ ├── cluster-test2.sh │ └── cluster-test.sh ├── group_vars │ └── test │ │ ├── test_settings.yaml │ │ ├── ldap_settings.yml │ │ ├── docker_settings.yml │ │ ├── web_settings.yml │ │ ├── upgrade_settings.yml │ │ ├── galaxy_settings.yml │ │ ├── files_settings.yml │ │ └── backup_settings.yml ├── mkdocs.sh ├── dynamic_includes.yml ├── yamllinting.sh ├── licensetest.sh ├── hosts └── ansiblelinting.sh ├── files ├── cluster_example_host │ ├── ssh │ ├── dbkeys │ ├── genomes │ ├── tools │ ├── welcome │ └── docker_custom_image │ │ └── Dockerfile └── example_host │ ├── ssh │ └── example.backups.org │ │ └── public_key.sample │ ├── dbkeys │ └── dbkeys.yaml.sample │ └── welcome │ └── welcome.html ├── roles ├── galaxy-docker │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── files │ │ └── galaxy_sudoers │ ├── tasks │ │ ├── template_galaxy_settings │ │ │ ├── setup_cluster_run_as_user │ │ │ ├── setupsge.yml │ │ │ ├── template_ldap.yml │ │ │ ├── report_user.yml │ │ │ ├── main.yml │ │ │ ├── setup_virtual_environment.yml │ │ │ ├── galaxywelcome.yml │ │ │ └── setup_cluster_general.yml │ │ ├── provision │ │ │ ├── import │ │ │ │ ├── delete_database_file.yml │ │ │ │ ├── delete_empty_db_script.yml │ │ │ │ ├── create_empty_db_script.yml │ │ │ │ ├── main.yml │ │ │ │ └── transfer_database.yml │ │ │ ├── main.yml │ │ │ ├── transfer_genomes.yml │ │ │ ├── ephemeris_jobs.yml │ │ │ ├── installephemeris.yml │ │ │ ├── start_provision_container.yml │ │ │ ├── container_running_check.yml │ │ │ ├── installtools.yml │ │ │ └── installgenomes.yml │ │ ├── backups │ │ │ └── main.yml │ │ ├── prerequisites │ │ │ ├── create_export_folder.yml │ │ │ ├── add_users.yml │ │ │ ├── install_packages.yml │ │ │ ├── galaxy_startup_service.yml │ │ │ ├── main.yml │ │ │ └── galaxyfirewall.yml │ │ ├── start_container │ │ │ ├── main.yml │ │ │ ├── install_python_dependencies.yml │ │ │ └── run.yml │ │ ├── upgrade │ │ │ ├── main.yml │ │ │ ├── copy_database.yml │ │ │ ├── add_new_config.yml │ │ │ ├── test.yml │ │ │ └── upgrade.yml │ │ ├── prepare_docker │ │ │ ├── create_export_folder.yml │ │ │ ├── main.yml │ │ │ ├── create_export_directory_folders.yml │ │ │ └── customimage.yml │ │ └── delete │ │ │ ├── delete_cron_jobs.yml │ │ │ ├── delete_system_files.yml │ │ │ ├── delete_export_folder.yml │ │ │ └── main.yml │ ├── templates │ │ ├── act_qmaster.j2 │ │ ├── ufwgalaxyprofile.j2 │ │ ├── ufwtestgalaxyprofile.j2 │ │ ├── environment_setup_file.sh.j2 │ │ ├── new_empty_db.j2 │ │ ├── galaxy.service.j2 │ │ ├── Dockerfile.j2 │ │ ├── tool_destinations.yml.j2 │ │ ├── docker_environment_dict.j2 │ │ ├── docker_environment_provision.j2 │ │ ├── docker_volumes_provision.yml.j2 │ │ ├── rsyncscript.sh.j2 │ │ ├── docker_ports_and_volumes.yml.j2 │ │ ├── backupscript.sh.j2 │ │ └── auth_conf.xml.j2 │ ├── handlers │ │ ├── restart_galaxy_in_container.yml │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── vars │ │ └── main.yml └── installdocker │ ├── handlers │ └── main.yml │ ├── defaults │ └── main.yml │ ├── vars │ └── main.yml │ ├── tasks │ ├── distributions │ │ ├── Ubuntu.yml │ │ └── CentOS.yml │ └── main.yml │ ├── README.md │ └── meta │ └── main.yml ├── host_vars ├── cluster_example_host │ ├── files_settings.yml │ ├── ldap_settings.yml │ ├── web_settings.yml │ ├── backup_settings.yml │ ├── upgrade_settings.yml │ ├── docker_settings.yml │ └── galaxy_settings.yml └── example_host │ ├── ldap_settings.yml │ ├── upgrade_settings.yml │ ├── web_settings.yml │ ├── galaxy_settings.yml │ ├── files_settings.yml │ ├── docker_settings.yml │ └── backup_settings.yml ├── group_vars └── example_group │ └── universal_settings.yml ├── .github └── PULL_REQUEST_TEMPLATE.md ├── hosts.sample ├── .gitmodules ├── RELEASE_CHECKLIST.md ├── licenses ├── license_header.txt └── license_change.yml ├── .gitignore ├── run ├── delete_galaxy.yml ├── start_container.yml ├── cron_database_backup.yml ├── import_database.yml ├── install_tools.yml ├── extract_database.yml ├── enable_ldap.yml ├── upgrade.yml ├── upgrade_test.yml ├── patch_image.yml ├── install_genomes.yml ├── delete_upgrade_test.yml ├── delete_galaxy_complete.yml ├── patch_custom_image.yml ├── upgrade_cluster.yml ├── upgrade_custom_image.yml ├── install_galaxy.yml ├── install_cluster_prerequisites.yml ├── install_galaxy_cluster.yml └── install_prerequisites.yml ├── main.yml ├── mkdocs.yml ├── LICENSE ├── .travis.yml ├── CHANGELOG.md ├── .yamllint.yml └── README.md /VERSION: -------------------------------------------------------------------------------- 1 | 1.1.0dev 2 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /test/files/cluster-test: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /docs/about/license.md: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /test/docker/cluster-test: -------------------------------------------------------------------------------- 1 | ubuntu-16.04/ -------------------------------------------------------------------------------- /test/files/cluster-test2: -------------------------------------------------------------------------------- 1 | cluster-test -------------------------------------------------------------------------------- /test/host_vars/cluster-test2: -------------------------------------------------------------------------------- 1 | cluster-test -------------------------------------------------------------------------------- /test/variables/centos-7.sh: -------------------------------------------------------------------------------- 1 | ubuntu-16.04.sh -------------------------------------------------------------------------------- /test/variables/ubuntu-16.04.sh: -------------------------------------------------------------------------------- 1 | standalone_vms.sh -------------------------------------------------------------------------------- /files/cluster_example_host/ssh: -------------------------------------------------------------------------------- 1 | ../example_host/ssh -------------------------------------------------------------------------------- /files/cluster_example_host/dbkeys: -------------------------------------------------------------------------------- 1 | ../example_host/dbkeys/ -------------------------------------------------------------------------------- /files/cluster_example_host/genomes: -------------------------------------------------------------------------------- 1 | ../example_host/genomes/ -------------------------------------------------------------------------------- /files/cluster_example_host/tools: -------------------------------------------------------------------------------- 1 | ../example_host/tools/ -------------------------------------------------------------------------------- /files/cluster_example_host/welcome: -------------------------------------------------------------------------------- 1 | ../example_host/welcome/ -------------------------------------------------------------------------------- /roles/galaxy-docker/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /test/files/centos-7/placeholder.txt: -------------------------------------------------------------------------------- 1 | This file is here for testing purposes 2 | -------------------------------------------------------------------------------- /host_vars/cluster_example_host/files_settings.yml: -------------------------------------------------------------------------------- 1 | ../example_host/files_settings.yml -------------------------------------------------------------------------------- /host_vars/cluster_example_host/ldap_settings.yml: -------------------------------------------------------------------------------- 1 | ../example_host/ldap_settings.yml -------------------------------------------------------------------------------- /host_vars/cluster_example_host/web_settings.yml: -------------------------------------------------------------------------------- 1 | ../example_host/web_settings.yml -------------------------------------------------------------------------------- /test/files/ubuntu-16.04/placeholder.txt: -------------------------------------------------------------------------------- 1 | This file is here for testing purposes 2 | -------------------------------------------------------------------------------- /host_vars/cluster_example_host/backup_settings.yml: -------------------------------------------------------------------------------- 1 | ../example_host/backup_settings.yml -------------------------------------------------------------------------------- /host_vars/cluster_example_host/upgrade_settings.yml: -------------------------------------------------------------------------------- 1 | ../example_host/upgrade_settings.yml -------------------------------------------------------------------------------- /test/group_vars/test/test_settings.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_ephemeris_ignore_errors: False 3 | -------------------------------------------------------------------------------- /docs/docs/logo/galaxy-launcher-transparant-small.png: -------------------------------------------------------------------------------- 1 | ../../logo/galaxy-launcher-transparant-small.png -------------------------------------------------------------------------------- /test/host_vars/cluster-test/test_settings.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_ephemeris_ignore_errors: False 3 | -------------------------------------------------------------------------------- /group_vars/example_group/universal_settings.yml: -------------------------------------------------------------------------------- 1 | --- # Here you can put settings that apply to the whole group 2 | -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-transparent.png -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-logo-export-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-logo-export-space.png -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-logo-export-space2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-logo-export-space2.png -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-logo-export-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-logo-export-white.png -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-transparant-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-transparant-small.png -------------------------------------------------------------------------------- /test/mkdocs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | set -o pipefail 4 | 5 | echo "Test if mkdocs documentation can be build." 6 | mkdocs build -s --clean 7 | -------------------------------------------------------------------------------- /docs/logo/galaxy-launcher-logo-export-space-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUMC/galaxy-launcher/HEAD/docs/logo/galaxy-launcher-logo-export-space-transparent.png -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | 4 | # Checklist 5 | - [ ] Changelog updated? 6 | - [ ] Documentation updated? 7 | - [ ] Tests updated? 8 | -------------------------------------------------------------------------------- /hosts.sample: -------------------------------------------------------------------------------- 1 | [example_group] 2 | example_host ansible_host=example_host.example_domain.tld ansible_user=remote_user 3 | 4 | [example_group:vars] 5 | 6 | [all:vars] 7 | ansible_ssh_pipelining=yes 8 | -------------------------------------------------------------------------------- /docs/about/author.md: -------------------------------------------------------------------------------- 1 | galaxy-launcher is maintained by the [Sequence Analysis Support Core](https://humgenprojects.lumc.nl/sasc/) at the [Leiden University Medical Center](https://www.lumc.nl/). 2 | 3 | Contact us at: sasc@lumc.nl 4 | -------------------------------------------------------------------------------- /test/group_vars/test/ldap_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_ldap_settings: 3 | server: "ldap://dc1.example.com" 4 | search_base: "dc=dc1,dc=example,dc=com" 5 | search_user: "ldapsearch" 6 | search_password: "beyondsecretwithmanycharacters" 7 | -------------------------------------------------------------------------------- /docs/developer_docs/installdocker.md: -------------------------------------------------------------------------------- 1 | # The installdocker role 2 | This is a very straightforward and simple role that follows the instructions on 3 | the [docker installation page](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/). 4 | -------------------------------------------------------------------------------- /host_vars/example_host/ldap_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_ldap_settings: 3 | server: "ldap://dc1.example.com" 4 | search_base: "dc=dc1,dc=example,dc=com" 5 | search_user: "ldapsearch" 6 | search_password: "beyondsecretwithmanycharacters" 7 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/ldap_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_ldap_settings: 3 | server: "ldap://dc1.example.com" 4 | search_base: "dc=dc1,dc=example,dc=com" 5 | search_user: "ldapsearch" 6 | search_password: "beyondsecretwithmanycharacters" 7 | -------------------------------------------------------------------------------- /test/group_vars/test/docker_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | installdocker_default_location: "/data/docker" 3 | galaxy_docker_docker_image: "bgruening/galaxy-stable:18.05" 4 | docker_user: "galaxy" 5 | galaxy_docker_export_location: "/data/galaxy/galaxy_storage" 6 | galaxy_docker_container_name: "galaxy" 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "test/vagrant/virtual-clusters"] 2 | path = test/vagrant/virtual-clusters 3 | url = https://github.com/rhpvorderman/virtual-clusters.git 4 | [submodule "roles/jdauphant.nginx"] 5 | path = roles/jdauphant.nginx 6 | url = https://github.com/jdauphant/ansible-role-nginx.git 7 | -------------------------------------------------------------------------------- /roles/galaxy-docker/files/galaxy_sudoers: -------------------------------------------------------------------------------- 1 | galaxy ALL = (root) NOPASSWD: SETENV: /galaxy-central/scripts/drmaa_external_runner.py 2 | galaxy ALL = (root) NOPASSWD: SETENV: /galaxy-central/scripts/drmaa_external_killer.py 3 | galaxy ALL = (root) NOPASSWD: SETENV: /galaxy-central/scripts/external_chown_script.py 4 | -------------------------------------------------------------------------------- /docs/about/contributing.md: -------------------------------------------------------------------------------- 1 | Contributions are always welcome. To contribute to the code or go the [the project's github page](https://github.com/LUMC/galaxy-launcher) and open a pull request. 2 | Your feedback is also very welcome. Please open an issue on [our github page](https://github.com/LUMC/galaxy-launcher). 3 | -------------------------------------------------------------------------------- /test/dynamic_includes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # A file to ansible-lint any skipped files. 3 | 4 | - host: test 5 | tasks: 6 | # Skipped due to being part of a dynamic include using ansible facts 7 | - include: ../roles/installdocker/tasks/distributions/CentOS.yml 8 | - include: ../roles/installdocker/tasks/distributions/Ubuntu.yml 9 | -------------------------------------------------------------------------------- /RELEASE_CHECKLIST.md: -------------------------------------------------------------------------------- 1 | # Release Checklist 2 | 3 | The following checklist should be pasted in the pull request to master. 4 | 5 | - [ ] Changelog up to date? 6 | - [ ] Documentation up to date? 7 | - [ ] All tests passed? 8 | - [ ] VERSION file set to right version? (Without dev?) 9 | - [ ] Release notes written? (Should also be in the changelog.) 10 | -------------------------------------------------------------------------------- /test/yamllinting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | set -o pipefail 4 | 5 | project_root=$(git rev-parse --show-toplevel) 6 | 7 | echo "Fetching all project YAML file names from git." 8 | project_yamls=$(git ls-files | grep -E ".*\.ya?ml$") 9 | echo "Test all project YAML files." 10 | yamllint -f parsable -c $project_root/.yamllint.yml $project_yamls 11 | -------------------------------------------------------------------------------- /files/cluster_example_host/docker_custom_image/Dockerfile: -------------------------------------------------------------------------------- 1 | # Adapts bgruening/galaxy-stable for use on a ogs-cluster 2 | 3 | from bgruening/galaxy-stable:17.09 4 | 5 | Maintainer test@example.com 6 | 7 | USER root 8 | 9 | # Makes sure the host knows the IP of the cluster head node 10 | run sed -i '3iecho "10.0.1.100 head-node" >> /etc/hosts' /usr/bin/startup 11 | 12 | 13 | CMD ["/usr/bin/startup"] 14 | -------------------------------------------------------------------------------- /test/docker/gridengine-cluster/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lumc/ubuntu-gridengine-drmaa 2 | 3 | EXPOSE 6444 4 | EXPOSE 6445 5 | RUN apt-get update && \ 6 | apt-get install -y --no-install-recommends python2.7 && \ 7 | rm -rf /var/lib/apt/lists/* 8 | RUN useradd -d /home/galaxy_web --create-home --uid 1450 galaxy_web 9 | RUN useradd -d /home/galaxy_db --create-home --uid 1550 galaxy_db 10 | CMD ["sleep","10000000"] 11 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/web_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | max_upload_size: "50g" 3 | 4 | galaxy_docker_web_urls: 5 | - example_host.org 6 | - galaxy.example_host.org 7 | - www.example_galaxy.org 8 | 9 | # remote listening ports 10 | galaxy_docker_web_port_public: 80 11 | 12 | # Local listening ports 13 | galaxy_docker_web_port: 8080 14 | #galaxy_docker_ftp_port: 8021 15 | #galaxy_docker_sftp_port: 8022 16 | -------------------------------------------------------------------------------- /test/docker/centos-7/files/galaxy_ssh.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRa7P7bVB4D/VQOaSv5zwG8JZAPRusH60UXmyUwn5Yt0FKzkf2l9wceWtgH8NEwkLwFPf4Yg6hcJsFQvGny0Zg+/jaLC2B9ZR1UetzCVAHGBjtxf26ubr96VHhMrcJ/a/VvgjElAd6iMD7Z4GisVcNBuf8UYWBmUwv5AIrsMlHCJ0w2e2vzUIuHZQKDeHyPmYYJsvdB6+TEcFBkE0toiBiG4yjA4hSTbWo6pu+Tl01gitUU20nqaRRykPCMUVP6vn/+mb4moZ2eKNyStNz969eASejyr7/TtEUcODxLZc2YScX3wW/g9lRflSNw7rkcAFMKOfBUvh8q3uxDwDiLILh ruben@SASC-pc-6 2 | -------------------------------------------------------------------------------- /test/docker/cluster-test2/files/galaxy_ssh.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRa7P7bVB4D/VQOaSv5zwG8JZAPRusH60UXmyUwn5Yt0FKzkf2l9wceWtgH8NEwkLwFPf4Yg6hcJsFQvGny0Zg+/jaLC2B9ZR1UetzCVAHGBjtxf26ubr96VHhMrcJ/a/VvgjElAd6iMD7Z4GisVcNBuf8UYWBmUwv5AIrsMlHCJ0w2e2vzUIuHZQKDeHyPmYYJsvdB6+TEcFBkE0toiBiG4yjA4hSTbWo6pu+Tl01gitUU20nqaRRykPCMUVP6vn/+mb4moZ2eKNyStNz969eASejyr7/TtEUcODxLZc2YScX3wW/g9lRflSNw7rkcAFMKOfBUvh8q3uxDwDiLILh ruben@SASC-pc-6 2 | -------------------------------------------------------------------------------- /test/docker/ubuntu-16.04/files/galaxy_ssh.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRa7P7bVB4D/VQOaSv5zwG8JZAPRusH60UXmyUwn5Yt0FKzkf2l9wceWtgH8NEwkLwFPf4Yg6hcJsFQvGny0Zg+/jaLC2B9ZR1UetzCVAHGBjtxf26ubr96VHhMrcJ/a/VvgjElAd6iMD7Z4GisVcNBuf8UYWBmUwv5AIrsMlHCJ0w2e2vzUIuHZQKDeHyPmYYJsvdB6+TEcFBkE0toiBiG4yjA4hSTbWo6pu+Tl01gitUU20nqaRRykPCMUVP6vn/+mb4moZ2eKNyStNz969eASejyr7/TtEUcODxLZc2YScX3wW/g9lRflSNw7rkcAFMKOfBUvh8q3uxDwDiLILh ruben@SASC-pc-6 2 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/setup_cluster_run_as_user: -------------------------------------------------------------------------------- 1 | #- name: Copy sudoers file to export location 2 | # copy: 3 | # src: galaxy_sudoers 4 | # dest: "{{ galaxy_docker_export_location }}/galaxy_sudoers" 5 | # mode: 0440 6 | 7 | #- name: copy sudo 8 | # command: "docker exec {{galaxy_docker_container_name}} {{command}}" 9 | # vars: 10 | # command: "cp -p /export/galaxy_sudoers /etc/sudoers.d/galaxy" 11 | -------------------------------------------------------------------------------- /test/group_vars/test/web_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | max_upload_size: "50g" 3 | 4 | galaxy_docker_web_urls: 5 | - example_host.org 6 | - galaxy.example_host.org 7 | - www.example_galaxy.org 8 | 9 | # remote listening ports 10 | galaxy_docker_web_port_public: 80 11 | 12 | # Local listening ports 13 | galaxy_docker_web_port: 8080 14 | #galaxy_docker_ftp_port: 8021 15 | galaxy_docker_sftp_port: 8022 16 | galaxy_docker_sftp_port_expose: True 17 | -------------------------------------------------------------------------------- /test/files/test/ssh/example.backups.org/public_key.sample: -------------------------------------------------------------------------------- 1 | example.backups.org,127.0.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1IlWcfKw8n4oxVEJEvyBaieJmit5Trfit0UT22cLeWgTorAxxrWLfCICAOglTdSOPHjY3SHglwlUZU3VBom4B431ERcEUB2p71/TP/qbG+s1jA8BiObL0CDXuGCdOJP7NiuvyOMypzPrqAnjyR2bpkGPJGXrjEnYLBh5Pc9xR1a0E0aEczLRZeoqM1mR0IwI+MD391Y/vMDRu2kdrq1OPbNAHTMf7UXwygKveY76S1oxDpveTrBqQGdzRZU7TjAJt4Tmm5iJyalF8TJ+kthcM2MFBDKoUmQ5dQTBFRo0vuWpNgSHkayergZ/03W2uyFl0g+u7669oVt4CfsDREqp5 2 | -------------------------------------------------------------------------------- /files/example_host/ssh/example.backups.org/public_key.sample: -------------------------------------------------------------------------------- 1 | example.backups.org,127.0.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1IlWcfKw8n4oxVEJEvyBaieJmit5Trfit0UT22cLeWgTorAxxrWLfCICAOglTdSOPHjY3SHglwlUZU3VBom4B431ERcEUB2p71/TP/qbG+s1jA8BiObL0CDXuGCdOJP7NiuvyOMypzPrqAnjyR2bpkGPJGXrjEnYLBh5Pc9xR1a0E0aEczLRZeoqM1mR0IwI+MD391Y/vMDRu2kdrq1OPbNAHTMf7UXwygKveY76S1oxDpveTrBqQGdzRZU7TjAJt4Tmm5iJyalF8TJ+kthcM2MFBDKoUmQ5dQTBFRo0vuWpNgSHkayergZ/03W2uyFl0g+u7669oVt4CfsDREqp5 2 | -------------------------------------------------------------------------------- /host_vars/example_host/upgrade_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_upgrade_overwrite_config_files: False 3 | 4 | galaxy_docker_upgrade_test_settings: 5 | galaxy_docker_docker_image: "bgruening/galaxy-stable:18.05" 6 | galaxy_docker_container_name: test_upgrade_galaxy 7 | galaxy_docker_export_location: "/data/galaxy/test_upgrade_galaxy/galaxy_storage" 8 | galaxy_docker_web_port: 8888 9 | galaxy_docker_web_port_public: 8880 10 | galaxy_brand: "Test upgrade of Galaxy to 18.05" 11 | -------------------------------------------------------------------------------- /licenses/license_header.txt: -------------------------------------------------------------------------------- 1 | Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 2 | Contact us at: sasc@lumc.nl 3 | 4 | This file is part of galaxy-launcher. 5 | 6 | galaxy-launcher is free software: you can redistribute it 7 | and/or modify it under the terms of the MIT License (Expat) as 8 | published by the Open Source initiative. 9 | 10 | You should have received a copy of the MIT License (Expat) 11 | along with galaxy-launcher. If not, see 12 | . 13 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/docker_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | installdocker_default_location: "/data/docker" 3 | galaxy_docker_docker_image: "cluster-galaxy-stable:18.05" 4 | galaxy_docker_export_location: "{{galaxy_docker_shared_cluster_directory}}/galaxy_storage" 5 | galaxy_docker_container_name: "galaxy" 6 | galaxy_docker_container_hostname: "galaxy-docker" 7 | 8 | bgruening_galaxy_stable_version: 18.05 9 | galaxy_docker_custom_image_lines: 10 | - RUN sed -i '3iecho "192.168.99.100 ogs-head" >> /etc/hosts' /usr/bin/startup 11 | -------------------------------------------------------------------------------- /test/licensetest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu -o pipefail 3 | 4 | project_root=$(git rev-parse --show-toplevel) 5 | 6 | echo "install modified ansible" 7 | git clone \ 8 | --recursive \ 9 | https://github.com/rhpvorderman/ansible-role-license-changer.git \ 10 | $project_root/roles/license-changer 11 | 12 | pip install -r $project_root/roles/license-changer/requirements.txt 13 | ansible --version 14 | 15 | echo "check if licenses are " 16 | ansible-playbook $project_root/licenses/license_change.yml \ 17 | -e "license_changer_check_mode=true" 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | *.save* 3 | *.config 4 | *.swp 5 | *.pyc 6 | *.log 7 | 8 | /hosts 9 | 10 | deprecated/ 11 | 12 | !host_vars/ 13 | host_vars/* 14 | !host_vars/example_host 15 | !host_vars/cluster_example_host 16 | 17 | !group_vars/ 18 | group_vars/* 19 | !group_vars/example_group 20 | 21 | !files/ 22 | files/* 23 | !files/example_host 24 | !files/cluster_example_host 25 | 26 | .venv 27 | 28 | site/ 29 | .vagrant/ 30 | 31 | test/files/*/ssh/* 32 | test/files/*/database_extract/* 33 | test/files/*/database_import/* 34 | test/ci_hosts 35 | test/CI/files 36 | -------------------------------------------------------------------------------- /test/group_vars/test/upgrade_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_upgrade_overwrite_config_files: False 3 | 4 | galaxy_docker_upgrade_test_settings: 5 | galaxy_docker_docker_image: "bgruening/galaxy-stable:18.05" 6 | galaxy_docker_container_name: test_upgrade_galaxy 7 | galaxy_docker_export_location: "/data/galaxy/test_upgrade_galaxy/galaxy_storage" 8 | galaxy_docker_ufw_profile: test_upgrade_galaxy 9 | galaxy_docker_web_port: 8888 10 | galaxy_docker_web_port_public: 8880 11 | galaxy_docker_sftp_port: 8822 12 | galaxy_brand: "Test upgrade of Galaxy to 18.05" 13 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/upgrade_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_upgrade_overwrite_config_files: False 3 | 4 | galaxy_docker_upgrade_test_settings: 5 | galaxy_docker_docker_image: "bgruening/galaxy-stable:18.05" 6 | galaxy_docker_container_name: test_upgrade_galaxy 7 | galaxy_docker_export_location: "{{galaxy_docker_shared_cluster_directory}}/test_upgrade_galaxy/galaxy_storage" 8 | galaxy_docker_ufw_profile: test_upgrade_galaxy 9 | galaxy_docker_web_port: 8888 10 | galaxy_docker_web_port_public: 8880 11 | galaxy_brand: "Test upgrade of Galaxy to 18.05" 12 | -------------------------------------------------------------------------------- /test/group_vars/test/galaxy_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | #Required settings 3 | # Please uncomment and specify these values yourself 4 | 5 | galaxy_admin_user: "admin@galaxy.org" 6 | galaxy_master_api_key: "insecure_test_key9s98d8dy98i212ybkknb" 7 | galaxy_brand: "test" 8 | galaxy_report_user: admin 9 | galaxy_report_password: admin 10 | 11 | galaxy_admin_api_key: "admin" 12 | 13 | # optional settings 14 | galaxy_docker_optional_environment_settings: 15 | GALAXY_CONFIG_CONDA_AUTO_INSTALL: True 16 | GALAXY_CONFIG_CONDA_AUTO_INIT: True 17 | GALAXY_CONFIG_USE_CACHED_DEPENDENCY_MANAGER: True 18 | -------------------------------------------------------------------------------- /run/delete_galaxy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_delete: True 18 | -------------------------------------------------------------------------------- /run/start_container.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_run: True 18 | -------------------------------------------------------------------------------- /host_vars/example_host/web_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | max_upload_size: "50g" 3 | 4 | galaxy_docker_web_urls: 5 | - example_host.org 6 | - galaxy.example_host.org 7 | - www.example_galaxy.org 8 | 9 | # remote listening ports 10 | galaxy_docker_web_port_public: 80 11 | 12 | # Local listening ports 13 | galaxy_docker_web_port: 8080 14 | #galaxy_docker_ftp_port: 8021 15 | #galaxy_docker_sftp_port: 8022 16 | # By default ftp and sftp ports are only exposed to localhost. 17 | # Set below values to True to expose them to the internet. 18 | galaxy_docker_ftp_port_expose: False 19 | galaxy_docker_sftp_port_expose: False 20 | -------------------------------------------------------------------------------- /run/cron_database_backup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_backup: True 17 | galaxy_docker_backup_cron: True 18 | -------------------------------------------------------------------------------- /run/import_database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_provision: True 17 | galaxy_docker_import_database: True 18 | -------------------------------------------------------------------------------- /run/install_tools.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_provision: True 17 | galaxy_docker_provision_tools: True 18 | -------------------------------------------------------------------------------- /run/extract_database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_backup: True 17 | galaxy_docker_backup_extract_database: True 18 | -------------------------------------------------------------------------------- /test/files/test/dbkeys/dbkeys.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # configuration for fetch and index genomes 3 | 4 | data_managers: 5 | - id: data_manager_fetch_genome_all_fasta_dbkey 6 | params: 7 | - 'dbkey_source|dbkey_source_selector': 'new' 8 | - 'dbkey_source|dbkey': 'RhinoVirusA' 9 | - 'dbkey_source|dbkey_name': 'RhinoVirus A (NC_001617.1)' 10 | - 'sequence_name': 'RhinoVirus A (NC_001617.1)' 11 | - 'sequence_id': 'RhinoVirusA' 12 | - 'reference_source|reference_source_selector': 'ncbi' 13 | - 'reference_source|requested_identifier': 'NC_001617.1' 14 | data_table_reload: 15 | - all_fasta 16 | - __dbkeys__ 17 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | - hosts: localhost 17 | remote_user: root 18 | roles: 19 | - . 20 | -------------------------------------------------------------------------------- /host_vars/example_host/galaxy_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | #Required settings 3 | # Please uncomment and specify these values yourself 4 | 5 | # galaxy_admin_user: "example@example.nl" 6 | # galaxy_master_api_key: "8374uhiuy893749872302" #replace with your own key!! 7 | # galaxy_brand: "Instance of Galaxy" 8 | # galaxy_report_user: admin 9 | # galaxy_report_password: admin 10 | 11 | #optional settings 12 | galaxy_docker_optional_environment_settings: 13 | GALAXY_CONFIG_CONDA_AUTO_INSTALL: True 14 | GALAXY_CONFIG_CONDA_AUTO_INIT: True 15 | GALAXY_CONFIG_USE_CACHED_DEPENDENCY_MANAGER: True 16 | NONUSE: proftp 17 | # GALAXY_CONFIG_AUTH_CONFIG_FILE: "config/auth_conf.xml" 18 | -------------------------------------------------------------------------------- /run/enable_ldap.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_run: True 17 | galaxy_docker_template: True 18 | galaxy_docker_template_ldap: True 19 | -------------------------------------------------------------------------------- /run/upgrade.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_upgrade: True 18 | galaxy_docker_run: True 19 | galaxy_docker_prepare_docker: True 20 | -------------------------------------------------------------------------------- /run/upgrade_test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_test_upgrade: True 18 | galaxy_docker_run: True 19 | galaxy_docker_upgrade: True 20 | -------------------------------------------------------------------------------- /run/patch_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_prepare_docker: True 18 | galaxy_docker_security_patch: True 19 | galaxy_docker_run: True 20 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/act_qmaster.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | {{ galaxy_docker_gridengine_master_host }} 16 | -------------------------------------------------------------------------------- /run/install_genomes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_provision: True 17 | galaxy_docker_transfer_genomes: True 18 | galaxy_docker_provision_genomes: True 19 | -------------------------------------------------------------------------------- /run/delete_upgrade_test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_delete_test_upgrade: True 18 | galaxy_docker_delete_files: True 19 | galaxy_docker_delete: True 20 | -------------------------------------------------------------------------------- /test/hosts: -------------------------------------------------------------------------------- 1 | cluster-test ansible_host=127.0.0.1 ansible_user=vagrant ansible_port=2205 ansible_ssh_private_key_file="test/vagrant/cluster-test/.vagrant/machines/default/virtualbox/private_key" 2 | 3 | [test] 4 | ubuntu-16.04 ansible_host=127.0.0.1 ansible_user=vagrant ansible_port=2201 ansible_ssh_private_key_file="test/vagrant/ubuntu-16.04/.vagrant/machines/default/virtualbox/private_key" 5 | centos-7 ansible_host=127.0.0.1 ansible_user=vagrant ansible_port=2202 ansible_ssh_private_key_file="test/vagrant/centos-7/.vagrant/machines/default/virtualbox/private_key" 6 | 7 | [all:vars] 8 | ansible_ssh_pipelining=yes 9 | ansible_ssh_extra_args="-o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" 10 | -------------------------------------------------------------------------------- /docs/user_guide/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | 4 | ## Prerequisites 5 | - Ansible. ([installation manual]((http://docs.ansible.com/ansible/intro_installation.html)) 6 | * Ansible version 2.4.0.0 is tested and required. 7 | * The easiest way to obtain ansible is by `pip install ansible==2.4.0.0`. `libssl-dev` needs to be installed on your system before you run this. 8 | 9 | ## Setting up galaxy-launcher 10 | 1. Clone the git repository. `git clone --recursive https://github.com/LUMC/galaxy-launcher.git` 11 | 2. Checkout the version of galaxy-launcher you want to use. For example `git checkout v1.0.0` or `git checkout develop`. 12 | 3. Make sure all submodules are up to date with `git submodule update --init --recursive` 13 | -------------------------------------------------------------------------------- /run/delete_galaxy_complete.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_delete: True 18 | galaxy_docker_delete_backup_files: True 19 | galaxy_docker_delete_files: True 20 | galaxy_docker_delete_system_files: True 21 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/import/delete_database_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Delete temporary files 18 | file: 19 | path: "{{galaxy_docker_imported_db_location}}}" 20 | state: absent 21 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/backups/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - import_tasks: cronbackupdb.yml 18 | when: galaxy_docker_backup_cron 19 | 20 | - import_tasks: extractdb.yml 21 | when: galaxy_docker_backup_extract_database 22 | -------------------------------------------------------------------------------- /run/patch_custom_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_prepare_docker: True 18 | galaxy_docker_security_patch: True 19 | galaxy_docker_change_uids: True 20 | galaxy_docker_custom_image: True 21 | galaxy_docker_run: True 22 | -------------------------------------------------------------------------------- /run/upgrade_cluster.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_upgrade: True 18 | galaxy_docker_run: True 19 | galaxy_docker_prepare_docker: True 20 | galaxy_docker_change_uids: True 21 | galaxy_docker_custom_image: True 22 | galaxy_docker_template: True 23 | -------------------------------------------------------------------------------- /test/group_vars/test/files_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_tool_list_dir: "{{playbook_dir}}/test/files/test/tools/" 3 | galaxy_docker_backup_db_dir: "{{playbook_dir}}/test/files/test/backup_db" 4 | galaxy_docker_import_db_dir: "{{playbook_dir}}/test/files/{{inventory_hostname}}/database_import" 5 | galaxy_docker_ssh_dir: "{{playbook_dir}}/test/files/{{ inventory_hostname }}/ssh" 6 | galaxy_docker_welcome_dir: "{{playbook_dir}}/test/files/test/welcome/" 7 | galaxy_docker_genomes_dir: "{{playbook_dir}}/test/files/test/genomes/" 8 | galaxy_docker_dbkeys_list_dir: "{{playbook_dir}}/test/files/test/dbkeys/" 9 | galaxy_docker_extract_database_dir: "test/files/{{inventory_hostname}}/database_extract/" 10 | galaxy_docker_custom_image_dir: "{{playbook_dir}}/test/files/test/docker_custom_image/" 11 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/import/delete_empty_db_script.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Delete script to delete old database and create new empty database 18 | file: 19 | path: "{{galaxy_docker_empty_database_script}}" 20 | state: absent 21 | -------------------------------------------------------------------------------- /run/upgrade_custom_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_upgrade: True 18 | galaxy_docker_run: True 19 | galaxy_docker_prepare_docker: True 20 | galaxy_docker_change_uids: True 21 | galaxy_docker_custom_image: True 22 | galaxy_docker_template: True 23 | -------------------------------------------------------------------------------- /host_vars/example_host/files_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_tool_list_dir: "{{playbook_dir}}/files/{{ inventory_hostname }}/tools/" 3 | galaxy_docker_backup_db_dir: "{{ inventory_hostname }}/backup_db" 4 | galaxy_docker_import_db_dir: "{{ inventory_hostname }}/database_import" 5 | galaxy_docker_ssh_dir: "{{playbook_dir}}/files/{{ inventory_hostname }}/ssh" 6 | galaxy_docker_welcome_dir: "{{playbook_dir}}/files/{{ inventory_hostname }}/welcome/" 7 | galaxy_docker_genomes_dir: "{{playbook_dir}}/files/{{inventory_hostname}}/genomes/" 8 | galaxy_docker_dbkeys_list_dir: "{{playbook_dir}}/files/{{inventory_hostname}}/dbkeys/" 9 | galaxy_docker_custom_image_dir: "files/{{inventory_hostname}}/docker_custom_image/" 10 | galaxy_docker_extract_database_dir: "files/{{inventory_hostname}}/database_extract/" 11 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/import/create_empty_db_script.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create script to delete old database and create new empty database 18 | template: 19 | src: new_empty_db.j2 20 | dest: "{{galaxy_docker_empty_database_script}}" 21 | mode: 0600 22 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/setupsge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # Add SGE settings to galaxy docker instance 18 | 19 | 20 | - name: create act_qmaster file 21 | template: 22 | dest: "{{galaxy_docker_export_location}}/act_qmaster" 23 | src: "act_qmaster.j2" 24 | -------------------------------------------------------------------------------- /host_vars/example_host/docker_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | installdocker_default_location: "/data/docker" #Where the docker images are stored 3 | galaxy_docker_docker_image: "bgruening/galaxy-stable:18.05" 4 | galaxy_docker_export_location: "/data/galaxy/galaxy_storage" 5 | galaxy_docker_container_name: "galaxy" 6 | galaxy_docker_container_hostname: "galaxy-docker" 7 | 8 | # For specifying extra ports 9 | # Use docker CLI syntax: 8000, 9000:8000, or 0.0.0.0:9000:8000 10 | # where 8000 is a container port, 9000 is a host port, and 0.0.0.0 is a host interface 11 | 12 | #galaxy_docker_extra_ports: 13 | # - "2222:2222" 14 | 15 | # Add extra volumes 16 | # Use docker CLI-style syntax: /host:/container[:mode]. 17 | # You can specify a read mode for the mount with either ro or rw. 18 | #galaxy_docker_extra_volumes: 19 | # - /tmp/:/tmp/:rw 20 | -------------------------------------------------------------------------------- /roles/installdocker/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # handlers file for installdocker 18 | 19 | - name: test docker service 20 | command: docker run hello-world 21 | register: result 22 | until: '"Hello from Docker!" in result.stdout' 23 | retries: 10 24 | delay: 10 25 | become: yes 26 | -------------------------------------------------------------------------------- /run/install_galaxy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_prepare_docker: True 18 | galaxy_docker_template: True 19 | galaxy_docker_provision: True 20 | galaxy_docker_run: True 21 | 22 | galaxy_docker_template_welcome: True 23 | galaxy_docker_provision_tools: True 24 | galaxy_docker_provision_genomes: True 25 | -------------------------------------------------------------------------------- /roles/installdocker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # This task decides wich sub-tasks should be run based on the boolean variables. 18 | # The order should represent the order in which tasks are ideally done. 19 | 20 | # defaults file for installdocker 21 | installdocker_default_location: "/var/lib/docker" 22 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/files_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_tool_list_dir: "{{playbook_dir}}/test/files/cluster-test/tools/" 3 | galaxy_docker_backup_db_dir: "{{playbook_dir}}/test/files/cluster-test/backup_db" 4 | galaxy_docker_import_db_dir: "{{playbook_dir}}/test/files/cluster-test/database_import" 5 | galaxy_docker_ssh_dir: "{{playbook_dir}}/test/files/{{ inventory_hostname }}/ssh" 6 | galaxy_docker_welcome_dir: "{{playbook_dir}}/test/files/cluster-test/welcome/" 7 | galaxy_docker_genomes_dir: "{{playbook_dir}}/test/files/cluster-test/genomes/" 8 | galaxy_docker_dbkeys_list_dir: "{{playbook_dir}}/test/files/cluster-test/dbkeys/" 9 | galaxy_docker_custom_image_dir: "{{playbook_dir}}/test/files/cluster-test/docker_custom_image/" 10 | galaxy_docker_extract_database_dir: "{{playbook_dir}}/test/files/{{inventory_hostname}}/database_extract/" 11 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/ufwgalaxyprofile.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | [{{galaxy_docker_ufw_profile}}] 16 | title={{galaxy_docker_ufw_profile}} 17 | description= This policy enables all ports that are opened in the galaxy application 18 | ports={{galaxy_docker_web_port_public}}/tcp 19 | -------------------------------------------------------------------------------- /run/install_cluster_prerequisites.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | galaxy_docker_run_privileged: True 17 | galaxy_docker_prerequisites: True 18 | galaxy_docker_install_packages: True 19 | installdocker: True 20 | galay_docker_nginx_settings: True 21 | ansible_role_nginx: True 22 | galaxy_docker_firewall: True 23 | galaxy_docker_prerequisites_startup_service: True 24 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/create_export_folder.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Make sure export location exists 18 | file: 19 | path: "{{galaxy_docker_export_location}}" 20 | state: directory 21 | group: "{{galaxy_docker_web_group_id}}" 22 | owner: "{{galaxy_docker_web_user}}" 23 | mode: "{{galaxy_docker_export_location_mode}}" 24 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/ufwtestgalaxyprofile.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | 16 | [{{galaxy_docker_test_ufw_profile}}] 17 | title={{galaxy_docker_test_ufw_profile}} 18 | description= This profile sets open a web port for the test galaxy application 19 | ports={{galaxy_docker_upgrade_test_settings.galaxy_docker_web_port_public}} 20 | -------------------------------------------------------------------------------- /run/install_galaxy_cluster.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_prepare_docker: True 18 | galaxy_docker_template: True 19 | galaxy_docker_provision: True 20 | galaxy_docker_run: True 21 | 22 | galaxy_docker_template_welcome: True 23 | galaxy_docker_provision_tools: True 24 | galaxy_docker_provision_genomes: True 25 | galaxy_docker_change_uids: True 26 | galaxy_docker_cluster: True 27 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/start_container/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - import_tasks: run.yml 18 | when: galaxy_docker_run 19 | 20 | - import_tasks: install_python_dependencies.yml 21 | when: 22 | - galaxy_docker_template_ldap 23 | - > 24 | not 25 | galaxy_docker_optional_environment_settings.LOAD_GALAXY_CONDITIONAL_DEPENDENCIES 26 | | default(False) 27 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/upgrade/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Setting new docker container for the test upgrade. 18 | set_fact: 19 | galaxy_docker_container_name: "{{galaxy_docker_upgrade_test_settings.galaxy_docker_container_name}}" 20 | when: galaxy_docker_test_upgrade 21 | 22 | - import_tasks: upgrade.yml 23 | when: galaxy_docker_upgrade or galaxy_docker_test_upgrade 24 | -------------------------------------------------------------------------------- /run/install_prerequisites.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_docker_run_privileged: True 18 | galaxy_docker_prerequisites: True 19 | galaxy_docker_install_packages: True 20 | galaxy_docker_create_export_folder: True 21 | installdocker: True 22 | galay_docker_nginx_settings: True 23 | ansible_role_nginx: True 24 | galaxy_docker_firewall: True 25 | galaxy_docker_add_users: True 26 | galaxy_docker_prerequisites_startup_service: True 27 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/environment_setup_file.sh.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | #!/bin/bash 16 | 17 | GALAXY_VIRTUAL_ENV={{galaxy_docker_cluster_virtualenv | default('/galaxy_venv')}} 18 | GALAXY_ROOT_DIR={{galaxy_docker_export_location}}/galaxy-central 19 | GALAXY_LIB={{galaxy_docker_export_location}}/galaxy-central/lib 20 | export GALAXY_VIRTUAL_ENV 21 | export GALAXY_ROOT_DIR 22 | export GALAXY_LIB 23 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/backup_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_backup_rsync_remote_host: False 3 | 4 | galaxy_docker_backup_database_cron_jobs: 5 | 5minutely: 6 | description: "lots of backups for testing" 7 | timestamp: "-%Z%Y%m%dT%H%M%S" 8 | filename: "galaxy-hourly-backup" 9 | files_to_keep: 12 10 | compression_level: 6 11 | cron: 12 | minute: "*/5" 13 | 14 | #Rsync settings 15 | galaxy_docker_backup_database_rsync_settings: 16 | dest: /big_volume/galaxy_remote_backups 17 | host: example.backups.org 18 | user: remotebackupuser 19 | delete: True 20 | compression_level: 0 21 | cron: 22 | special_time: "hourly" 23 | 24 | # Set compression level. This compresses the data before sending to save bandwith 25 | # This does not compress the files. 26 | # 0 = no compression 27 | # 1-3 uses a fast compression algorithm that uses less resources 28 | # 4-9 provide progressively better compression at increased system resource use 29 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/upgrade/copy_database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Copy running instance files to test location 18 | command: "cp -p -R {{src}} {{dest}}" 19 | args: 20 | creates: "{{dest}}" 21 | vars: 22 | src: "{{galaxy_docker_export_location}}/{{item.src}}" 23 | dest: "{{galaxy_docker_upgrade_test_settings.galaxy_docker_export_location}}/{{item.dest}}" 24 | with_items: 25 | - src: "postgresql" 26 | dest: "" 27 | -------------------------------------------------------------------------------- /main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # Playbook that contains all roles. 18 | 19 | - hosts: "{{ host }}" 20 | become: "{{ galaxy_docker_run_privileged }}" 21 | become_method: sudo 22 | become_user: root 23 | gather_facts: yes 24 | pre_tasks: 25 | - name: Include run variables 26 | include_vars: 27 | file: "run/{{item}}.yml" 28 | with_items: 29 | - "{{run | default('[]')}}" 30 | 31 | roles: 32 | - role: galaxy-docker 33 | -------------------------------------------------------------------------------- /test/ansiblelinting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | set -o pipefail 4 | 5 | project_root=$(git rev-parse --show-toplevel) 6 | 7 | 8 | # Excluded files contain !unsafe tag which causes ansible-lint to crash. 9 | # Issue has been filed https://github.com/willthames/ansible-lint/issues/291 10 | excluded_files=" 11 | --exclude=$project_root/roles/galaxy-docker/tasks/delete/delete_export_folder.yml 12 | --exclude=$project_root/roles/galaxy-docker/tasks/prepare_docker/create_export_directory_folders.yml 13 | --exclude=$project_root/roles/galaxy-docker/tasks/start_container/install_python_dependencies.yml 14 | --exclude=$project_root/roles/galaxy-docker/tasks/prepare_docker/change_uids.yml 15 | " 16 | 17 | echo "Check for ansible best practices using ansible-lint" 18 | for lint_files in $project_root/roles/galaxy-docker $project_root/roles/installdocker $project_root/main.yml $project_root/test/dynamic_includes.yml 19 | do 20 | ansible-lint -p $excluded_files -x '206,602' $lint_files 21 | done 22 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prepare_docker/create_export_folder.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # This task decides wich sub-tasks should be run based on the boolean variables. 18 | # The order should represent the order in which tasks are ideally done. 19 | 20 | - name: Check if export folder is created with right permissions 21 | file: 22 | path: "{{galaxy_docker_export_location}}" 23 | state: directory 24 | mode: "{{galaxy_docker_export_location_mode}}" 25 | -------------------------------------------------------------------------------- /test/group_vars/test/backup_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_backup_rsync_remote_host: False 3 | 4 | galaxy_docker_backup_database_cron_jobs: 5 | 5minutely: 6 | description: "lots of backups for testing" 7 | timestamp: "-%Z%Y%m%dT%H%M%S" 8 | filename: "galaxy-hourly-backup" 9 | files_to_keep: 2 10 | compression_level: 6 11 | cron: 12 | minute: "*/5" 13 | 14 | #Rsync settings 15 | galaxy_docker_backup_database_rsync_settings: 16 | dest: /home/galaxy_docker/galaxy_remote_backups 17 | host: 127.0.0.1 18 | host_public_key: "ssh-rsa {{ansible_ssh_host_key_rsa_public}}" 19 | user: galaxy_docker 20 | delete: True 21 | compression_level: 3 22 | cron: 23 | minute: "*/5" 24 | 25 | # Set compression level. This compresses the data before sending to save bandwith 26 | # This does not compress the files. 27 | # 0 = no compression 28 | # 1-3 uses a fast compression algorithm that uses less resources 29 | # 4-9 provide progressively better compression at increased system resource use 30 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/new_empty_db.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | 16 | SELECT pg_terminate_backend(pg_stat_activity.pid) 17 | FROM pg_stat_activity 18 | WHERE pg_stat_activity.datname = '{{galaxy_docker_container_database_name}}' 19 | AND pid <> pg_backend_pid(); 20 | DROP DATABASE {{galaxy_docker_container_database_name}} ; 21 | CREATE DATABASE {{galaxy_docker_container_database_name}} WITH OWNER {{galaxy_docker_container_database_username}} ; 22 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | site_name: galaxy-launcher 3 | theme: readthedocs 4 | pages: 5 | - Home: index.md 6 | - Known issues: known_issues.md 7 | - User guide: 8 | - Installing galaxy-launcher: user_guide/installation.md 9 | - Configuring a galaxy instance for a vm: user_guide/configure_instance.md 10 | - Configure a galaxy instance for running on a cluster: user_guide/configure_cluster_instance.md 11 | - Installing and administrating a galaxy instance: user_guide/install_administrate.md 12 | - Installing and administrating a galaxy instance on a cluster: user_guide/install_administrate_cluster.md 13 | - Tutorial: tutorial/tutorial.md 14 | - Developer documentation: 15 | - Introduction: developer_docs/introduction.md 16 | - The galaxy-docker role: developer_docs/galaxy-docker.md 17 | - The installdocker role: developer_docs/installdocker.md 18 | - About: 19 | - Contributing: about/contributing.md 20 | - Author: about/author.md 21 | - License: about/license.md 22 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/galaxy.service.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | 16 | {# Using advice from http://container-solutions.com/running-docker-containers-with-systemd/#} 17 | 18 | [Unit] 19 | Description=galaxy docker container 20 | Requires=docker.service 21 | After=docker.service 22 | 23 | [Install] 24 | WantedBy=multi-user.target 25 | 26 | [Service] 27 | Type=oneshot 28 | ExecStart=/usr/bin/docker restart {{galaxy_docker_container_name}} 29 | TimeoutSec=120 30 | -------------------------------------------------------------------------------- /host_vars/cluster_example_host/docker_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | installdocker_default_location: "/data/docker" 3 | galaxy_docker_docker_image: "cluster-galaxy-stable:18.05" 4 | galaxy_docker_export_location: "{{galaxy_docker_shared_cluster_directory}}/galaxy_storage" 5 | galaxy_docker_container_name: "galaxy" 6 | galaxy_docker_container_hostname: "galaxy-docker" 7 | 8 | # Connect extra volumes to which your container needs acces to 9 | #galaxy_docker_extra_volumes: 10 | # - /tmp/:/tmp/:rw # Use docker CLI-style syntax: /host:/container[:mode]. 11 | # You can specify a read mode for the mount with either ro or rw. 12 | # For example: mount a cluster genomes folder as read-only 13 | # - /exports/genomes:/exports/genomes:ro 14 | # Extra ports could be needed to connect to an external cluster. 15 | # Below example is for SGE 16 | #galaxy_docker_extra_ports: 17 | # - "6444:6444" 18 | # - "6445:6445" 19 | 20 | bgruening_galaxy_stable_version: 18.05 21 | galaxy_docker_custom_image_lines: 22 | - RUN sed -i '3iecho "10.0.0.1 head-node" >> /etc/hosts' /usr/bin/startup 23 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/delete/delete_cron_jobs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: remove cron jobs for backup scripts 18 | cron: 19 | state: absent 20 | name: "{{item.value.description}}" 21 | user: "{{galaxy_docker_docker_user}}" 22 | with_dict: "{{ galaxy_docker_backup_database_cron_jobs }}" 23 | 24 | - name: remove cron jobs for rsync script 25 | cron: 26 | state: absent 27 | name: "Rsync to the backup host" 28 | user: "{{galaxy_docker_docker_user}}" 29 | when: galaxy_docker_backup_rsync_remote_host 30 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/Dockerfile.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | 16 | {% if galaxy_docker_change_uids | bool %} 17 | from {{galaxy_docker_docker_image_changed_uids}} 18 | {% else %} 19 | from bgruening/galaxy-stable:{{bgruening_galaxy_stable_version}} 20 | {% endif %} 21 | 22 | Maintainer ansible-generated 23 | 24 | {% if galaxy_docker_custom_image_lines is defined %} 25 | {% for line in galaxy_docker_custom_image_lines %} 26 | {{line}} 27 | {% endfor %} 28 | {% endif %} 29 | 30 | CMD ["/usr/bin/startup"] 31 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - import_tasks: import/main.yml 18 | when: galaxy_docker_import_database 19 | 20 | - import_tasks: transfer_genomes.yml 21 | when: galaxy_docker_transfer_genomes 22 | become: "{{galaxy_docker_become}}" 23 | become_user: "{{galaxy_docker_web_user}}" 24 | vars: 25 | ansible_user: "{{galaxy_docker_web_ssh_user}}" 26 | ansible_ssh_private_key_file: "{{galaxy_docker_web_user_private_key}}" 27 | 28 | - import_tasks: ephemeris_jobs.yml 29 | when: ( galaxy_docker_provision_tools or galaxy_docker_provision_genomes ) 30 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/upgrade/add_new_config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Overwrite old config files? 18 | set_fact: 19 | no_overwrite: "" 20 | when: galaxy_docker_upgrade_overwrite_config_files 21 | 22 | - name: Add new config files 23 | command: "rsync -p -r {{no_overwrite | default('--ignore-existing')}} {{src}} {{dest}}" 24 | vars: 25 | src: "{{galaxy_docker_export_location}}/.distribution_config/" 26 | dest: "{{galaxy_docker_export_location}}/galaxy-central/config" 27 | tags: 28 | - skip_ansible_lint # Synchronize module does not support copying on the same host. 29 | -------------------------------------------------------------------------------- /docs/developer_docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Developer documentation 2 | 3 | ## galaxy-launcher structure 4 | galaxy-launcher consists of multiple files and directories. Each with 5 | their own function. 6 | 7 | * A `docs/` folder which contains the documentation. The documentation is automatically created using mkdocs. The structure is defined in `mkdocs.yml`. 8 | * A `main.yml` that is the main playbook for running galaxy-launcher. 9 | * A `files/` folder that contains the files to customize the galaxy instances 10 | * A `host_vars/` and a `group_vars` folder to contain the variables for each galaxy instance. 11 | * A `licenses/` folder that contains the project's licenses 12 | * A `run/` folder that contains the yaml files needed for running galaxy-launcher 13 | * A `test/` folder containing the tests. 14 | * A `roles/` folder containing the roles where the action happens. 15 | 16 | It contains some other files such as: 17 | 18 | * `.git*` files for git functionality 19 | * `.yamllint.yml` specifies the yamllint settings. 20 | * `.travis.yml` and `tox.ini` for the tests. 21 | * `ansible.cfg` configuration for ansible. 22 | * `hosts.sample` example hosts file. 23 | -------------------------------------------------------------------------------- /roles/galaxy-docker/handlers/restart_galaxy_in_container.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: restart galaxy in container 18 | command: "docker exec {{galaxy_docker_container_name}} {{command}}" 19 | vars: 20 | command: "supervisorctl restart {{supervisorctl_galaxy | default('galaxy')}}:*" 21 | notify: check if galaxy has started 22 | 23 | - name: restart provision galaxy in container 24 | command: "docker exec {{galaxy_docker_provision_container_name}} {{command}}" 25 | vars: 26 | command: "supervisorctl restart {{supervisorctl_galaxy | default('galaxy')}}:*" 27 | notify: check if provision galaxy has started 28 | -------------------------------------------------------------------------------- /roles/galaxy-docker/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_info: 18 | author: Sequencing Analysis Support Core 19 | description: A role to install bgruening/galaxy-docker-stable on a host 20 | company: Leiden University Medical Center 21 | 22 | license: MIT License (expat) 23 | 24 | min_ansible_version: 2.4 25 | 26 | platforms: 27 | - name: Ubuntu 28 | versions: 29 | - 16.04 30 | 31 | galaxy_tags: 32 | - galaxy 33 | - docker 34 | - bgruening 35 | - galaxyproject 36 | - lumc 37 | 38 | #dependencies: 39 | # - { role: jdauphant.nginx, nginx_sites: "{{nginx_sites}}" } 40 | -------------------------------------------------------------------------------- /roles/installdocker/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # vars file for installdocker 18 | installdocker_prerequisites: 19 | - linux-image-extra-virtual 20 | - "linux-image-extra-{{ansible_kernel}}" 21 | 22 | installdocker_python_packages: 23 | - python-pip 24 | - python-setuptools 25 | installdocker_pip_packages: 26 | - docker-py 27 | installdocker_gpg_key: "https://download.docker.com/linux/{{ansible_distribution | lower}}/gpg" 28 | installdocker_apt_repository: >- 29 | deb https://download.docker.com/linux/{{ansible_distribution | lower}} 30 | {{ansible_distribution_release}} stable 31 | installdocker_packages: 32 | - docker-ce 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/template_ldap.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # tasks file for galaxy_docker_template_ldap 18 | # This task writes an auth.conf.xml file to the galaxy settings directory 19 | # and installs the python ldap module in the container's virtual environment. 20 | - name: Show ldap variables 21 | debug: 22 | var: galaxy_docker_ldap_config 23 | verbosity: 1 24 | 25 | - name: Create auth_conf.xml file in config folder 26 | template: 27 | dest: "{{galaxy_docker_export_location}}/galaxy-central/config/auth_conf.xml" 28 | force: yes 29 | src: auth_conf.xml.j2 30 | mode: 0700 31 | trim_blocks: False 32 | -------------------------------------------------------------------------------- /roles/galaxy-docker/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # vars file for galaxy-docker 18 | 19 | # vars for ldap 20 | galaxy_docker_ldap_config: 21 | "{{ galaxy_docker_ldap_defaults | combine(galaxy_docker_ldap_settings) }}" 22 | 23 | # vars for galaxy_docker_backup_cron 24 | galaxy_docker_backup_database_rsync_configuration: >- 25 | {{ galaxy_docker_backup_rsync_settings_default | 26 | combine(galaxy_docker_backup_database_rsync_settings) }} 27 | 28 | # vars for galaxy_docker_provision_tools: 29 | galaxy_docker_ephemeris_package: ephemeris 30 | galaxy_docker_ephemeris_version: 0.8.0 31 | 32 | # vars for rundockergalaxy 33 | galaxy_docker_published_ports: "" 34 | -------------------------------------------------------------------------------- /test/docker/cluster-test2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Adapted from https://docs.docker.com/engine/examples/running_ssh_service/ 2 | FROM ubuntu:16.04 3 | 4 | ENV SSH_USER=galaxy_ssh 5 | 6 | RUN apt-get update && apt-get install -y openssh-server python sudo 7 | RUN mkdir /var/run/sshd 8 | RUN echo 'root:screencast' | chpasswd 9 | COPY files/sshd_config /etc/ssh/sshd_config 10 | 11 | # SSH login fix. Otherwise user is kicked off after login 12 | RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd 13 | 14 | ENV NOTVISIBLE "in users profile" 15 | RUN echo "export VISIBLE=now" >> /etc/profile 16 | 17 | # Add passwordless sudo user. 18 | RUN groupadd passwordless 19 | RUN useradd -d /home/$SSH_USER -m -p $SSH_USER -G sudo,passwordless -s /bin/bash $SSH_USER 20 | RUN echo "%passwordless ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers 21 | 22 | USER $SSH_USER 23 | RUN mkdir $HOME/.ssh 24 | RUN chmod 700 $HOME/.ssh 25 | COPY files/galaxy_ssh.pub /home/$SSH_USER/galaxy_ssh.pub 26 | RUN cat $HOME/galaxy_ssh.pub >> $HOME/.ssh/authorized_keys 27 | RUN chmod 600 $HOME/.ssh/authorized_keys 28 | 29 | 30 | 31 | 32 | USER root 33 | 34 | EXPOSE 8822 35 | CMD ["/usr/sbin/sshd", "-D"] 36 | -------------------------------------------------------------------------------- /test/docker/ubuntu-16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | # Adapted from https://docs.docker.com/engine/examples/running_ssh_service/ 2 | FROM ubuntu:16.04 3 | 4 | ENV SSH_USER=galaxy_ssh 5 | 6 | RUN apt-get update && apt-get install -y openssh-server python sudo 7 | RUN mkdir /var/run/sshd 8 | RUN echo 'root:screencast' | chpasswd 9 | COPY files/sshd_config /etc/ssh/sshd_config 10 | 11 | # SSH login fix. Otherwise user is kicked off after login 12 | RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd 13 | 14 | ENV NOTVISIBLE "in users profile" 15 | RUN echo "export VISIBLE=now" >> /etc/profile 16 | 17 | # Add passwordless sudo user. 18 | RUN groupadd passwordless 19 | RUN useradd -d /home/$SSH_USER -m -p $SSH_USER -G sudo,passwordless -s /bin/bash $SSH_USER 20 | RUN echo "%passwordless ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers 21 | 22 | USER $SSH_USER 23 | RUN mkdir $HOME/.ssh 24 | RUN chmod 700 $HOME/.ssh 25 | COPY files/galaxy_ssh.pub /home/$SSH_USER/galaxy_ssh.pub 26 | RUN cat $HOME/galaxy_ssh.pub >> $HOME/.ssh/authorized_keys 27 | RUN chmod 600 $HOME/.ssh/authorized_keys 28 | 29 | 30 | 31 | 32 | USER root 33 | 34 | EXPOSE 8822 35 | CMD ["/usr/sbin/sshd", "-D"] 36 | -------------------------------------------------------------------------------- /host_vars/example_host/backup_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_backup_rsync_remote_host: False 3 | 4 | galaxy_docker_backup_database_cron_jobs: 5 | hourly: 6 | description: "Hourly backup of the galaxy database" 7 | timestamp: "-%Z%Y%m%dT%H%M%S" 8 | filename: "galaxy-hourly-backup" 9 | files_to_keep: 24 10 | compression_level: 6 11 | cron: 12 | special_time: "hourly" 13 | daily: 14 | description: "Daily backup of the galaxy database" 15 | timestamp: "-%Z%Y%m%dT%H%M" 16 | filename: "galaxy-daily-backup" 17 | files_to_keep: 7 18 | compression_level: 6 19 | cron: 20 | special_time: daily 21 | 22 | #Rsync settings 23 | galaxy_docker_backup_database_rsync_settings: 24 | dest: /big_volume/galaxy_remote_backups 25 | host: example.backups.org 26 | user: remotebackupuser 27 | delete: True 28 | compression_level: 0 29 | cron: 30 | special_time: "hourly" 31 | 32 | # Set compression level. This compresses the data before sending to save bandwith 33 | # This does not compress the files. 34 | # 0 = no compression 35 | # 1-3 uses a fast compression algorithm that uses less resources 36 | # 4-9 provide progressively better compression at increased system resource use 37 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/add_users.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create user to run docker image 18 | user: 19 | createhome: yes 20 | name: "{{galaxy_docker_docker_user}}" 21 | groups: "{{galaxy_docker_docker_user_groups}}" 22 | state: present 23 | 24 | - name: Create galaxy web user 25 | user: 26 | createhome: yes 27 | name: "{{galaxy_docker_web_user}}" 28 | uid: "{{galaxy_docker_web_user_id}}" 29 | state: present 30 | 31 | - name: create galaxy database user 32 | user: 33 | createhome: yes 34 | name: "{{galaxy_docker_database_user}}" 35 | uid: "{{galaxy_docker_database_user_id}}" 36 | state: present 37 | groups: "{{galaxy_docker_web_group_id}}" 38 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/report_user.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Fail when report user and password are not defined 18 | fail: 19 | msg: "galaxy_report_user and galaxy_report_password should be defined!" 20 | when: (galaxy_report_password is not defined) or (galaxy_report_user is not defined) 21 | 22 | 23 | - name: Add report_htpasswd file for Report Webapp 24 | htpasswd: 25 | create: yes 26 | # Other secure choices: 27 | # https://passlib.readthedocs.io/en/stable/narr/quickstart.html#recommended-hashes 28 | crypt_scheme: sha512_crypt 29 | name: "{{galaxy_report_user}}" 30 | password: "{{galaxy_report_password}}" 31 | path: "{{galaxy_docker_export_location}}/reports_htpasswd" 32 | -------------------------------------------------------------------------------- /roles/installdocker/tasks/distributions/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | - name: Install Docker prerequisites on Ubuntu 17 | apt: 18 | update_cache: yes 19 | pkg: "{{ item }}" 20 | state: present 21 | with_items: 22 | - apt-transport-https 23 | - ca-certificates 24 | - curl 25 | - software-properties-common 26 | 27 | 28 | - name: Install Docker key on Ubuntu 29 | apt_key: 30 | url: "{{ installdocker_gpg_key }}" 31 | 32 | - name: Install Docker repository on Ubuntu 33 | apt_repository: 34 | repo: "{{ installdocker_apt_repository }}" 35 | 36 | - name: Install Docker packages on Ubuntu 37 | apt: 38 | pkg: "{{ installdocker_packages }}" 39 | state: present 40 | update_cache: yes 41 | notify: test docker service 42 | -------------------------------------------------------------------------------- /docs/user_guide/install_administrate_cluster.md: -------------------------------------------------------------------------------- 1 | # Install and administer a galaxy instance connected to a cluster 2 | 3 | This is the same as managing it on a vm that is not connected to a cluster. Except that some cluster settings need to be templated out to galaxy and you may not want to run the playbook as a sudo user on the remote host. 4 | 5 | Check out the `cluster.settings` example for cluster settings examples. 6 | 7 | ## Root required parts 8 | ### Install docker and required packages on the remote machine 9 | This does not create the users. As it assumes that the users are already present on the cluster. 10 | ```bash 11 | ansible-playbook main.yml -e "host=HOSTNAME run=install_cluster_prerequisites" 12 | ``` 13 | If you want to create the users, and want to create the ssh_key_pairs so you do not need to run as a sudo user: 14 | ```bash 15 | ansible-playbook main.yml -e "host=HOSTNAME run=install_prerequisites galaxy_docker_create_user_ssh_keys=True" 16 | ``` 17 | 18 | ## Root not required 19 | All the management steps that are described in the administration of a vm run without root rights. 20 | To install galaxy on a cluster without using a sudo user: 21 | ```bash 22 | ansible-playbook main.yml -e "host=HOSTNAME run=install_galaxy_cluster galaxy_docker_run_privileged=False" 23 | ``` 24 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/install_packages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # Installs packages that are later needed by unpriviledged users 18 | - name: Install rsync 19 | package: 20 | name: rsync 21 | state: present 22 | 23 | - name: install git 24 | package: 25 | name: git 26 | state: present 27 | 28 | - name: install virtualenv 29 | pip: 30 | name: virtualenv 31 | state: present 32 | 33 | - name: install required passlib module 34 | pip: 35 | name: "passlib" 36 | state: latest 37 | tags: 38 | - skip_ansible_lint # This is a security library. This using latest is warranted. 39 | 40 | - name: install access control lists to allow user switching during playbook. 41 | package: 42 | name: acl 43 | state: present 44 | -------------------------------------------------------------------------------- /test/variables/standalone_vms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ansible_playbook_extra_settings="\ 4 | galaxy_docker_container_name: galaxy_${hostname} 5 | galaxy_docker_extract_database_dir: ${export_volume}/import_db/ 6 | galaxy_docker_import_db_dir: ${export_volume}/import_db/ 7 | galaxy_docker_export_location: ${export_folder} 8 | galaxy_docker_web_port_public: 8081 9 | galaxy_docker_web_port: 8080 10 | galaxy_docker_ansible_generated_vars_dir: ${export_volume} 11 | galaxy_docker_empty_database_script: ${export_volume}/new_empty_db 12 | galaxy_docker_imported_db_location: ${export_volume}/database/ 13 | galaxy_docker_upgrade_test_settings: 14 | galaxy_docker_docker_image: 'bgruening/galaxy-stable:18.05' 15 | galaxy_docker_container_name: test_upgrade_galaxy 16 | galaxy_docker_export_location: ${export_volume}/test_upgrade 17 | galaxy_docker_ufw_profile: test_upgrade_galaxy 18 | galaxy_docker_web_port: 8888 19 | galaxy_docker_web_port_public: 8880 20 | galaxy_docker_sftp_port: 8823 21 | galaxy_brand: Test upgrade of Galaxy to 18.05 22 | " 23 | ansible_playbook_run_commands="\ 24 | install_galaxy \ 25 | enable_ldap \ 26 | extract_database \ 27 | import_database \ 28 | upgrade_test \ 29 | delete_upgrade_test \ 30 | upgrade \ 31 | cron_database_backup \ 32 | ['install_tools','install_genomes'] \ 33 | patch_image \ 34 | delete_galaxy_complete \ 35 | " 36 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/tool_destinations.yml.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | # {{ansible_managed}} 16 | default_destination: {{galaxy_docker_cluster_default_destination}} 17 | tools: 18 | upload1: 19 | default_destination: local 20 | {% for destination, tool_list in galaxy_docker_cluster_tool_destinations.items() %} 21 | {% for tool in tool_list %} 22 | {{tool}}: 23 | default_destination: {{destination}} 24 | {% endfor %} 25 | {% endfor %} 26 | {% if galaxy_docker_cluster_tool_destination_configuration %} 27 | {{ galaxy_docker_cluster_tool_destination_configuration | to_nice_yaml}} 28 | {% endif %} 29 | {% if galaxy_docker_cluster_user_destinations %} 30 | users: 31 | {{ galaxy_docker_cluster_user_destinations | to_nice_yaml }} 32 | {% endif %} 33 | verbose: True 34 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/docker_environment_dict.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | {# #} 16 | # Galaxy docker environment file. WARNING: NEWLINES NOT ALLOWED 17 | # This is due to a dysfunctional python parser 18 | # Create newlines using hashes 19 | # 20 | ##### 21 | ### Obligatory section. 22 | ### No defaults used. Specifiy in galaxysettings.config 23 | ##### 24 | # 25 | GALAXY_CONFIG_ADMIN_USERS={{galaxy_admin_user}} 26 | GALAXY_CONFIG_MASTER_API_KEY={{galaxy_master_api_key}} 27 | GALAXY_CONFIG_BRAND={{galaxy_brand}} 28 | # 29 | ##### 30 | ###Optional Section. 31 | ##### 32 | {%if galaxy_docker_optional_environment_settings is defined %} 33 | {% for env_var, env_setting in galaxy_docker_optional_environment_settings.items() %} 34 | {{env_var}}={{env_setting}} 35 | {% endfor %} 36 | {% endif %} 37 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/galaxy_startup_service.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Add systemd unit file. 18 | template: 19 | dest: /etc/systemd/system/galaxy.service 20 | src: galaxy.service.j2 21 | force: yes 22 | 23 | - name: register if a galaxy container exists 24 | command: "docker ps -aq -f name={{galaxy_docker_container_name}}$" 25 | register: galaxy_container_exists 26 | changed_when: false 27 | 28 | - name: Start a dummy container 29 | docker_container: 30 | name: "{{galaxy_docker_container_name}}" 31 | image: hello-world 32 | when: 33 | - galaxy_container_exists is defined 34 | - galaxy_container_exists.stdout =='' 35 | 36 | - name: Galaxy should be started on reboot. 37 | systemd: 38 | enabled: yes 39 | name: galaxy.service 40 | state: started 41 | masked: no 42 | daemon_reload: yes 43 | -------------------------------------------------------------------------------- /docs/known_issues.md: -------------------------------------------------------------------------------- 1 | # Known issues 2 | 3 | ## Deprecation warnings 4 | 5 | The following warning is caused by the [jdauphant.nginx](https://github.com/jdauphant/ansible-role-nginx) role. 6 | ``` 7 | [DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. 8 | ``` 9 | The change from `include:` to `include_tasks` and `import_tasks` has been made in 2.4. As soon as [jdauphant.nginx](https://github.com/jdauphant/ansible-role-nginx) is updated to reflect this change the dependency in galaxy-launcher will be changed as well. 10 | 11 | ## host_vars and group_vars are ignored. 12 | If you have been using an older version of galaxy-launcher these variables would be stored as .settings files. By default ansible only reads YAML and JSON-type files. The fact that it would read files with other extensions as well was a bug that was fixed in ansible >= 2.3.1. 13 | 14 | The solution is to rename \*.settings files to \*.yml files. 15 | 16 | ## SSH connections fail during playbook. 17 | In older versions of galaxy-launcher `ansible_connection=ssh` was included in the host file as an example variable. Removing this variable should fix the issue. (Ansible's default is `ansible_connection=smart`) 18 | 19 | ## Galaxy does not automatically restart when the VM restarts 20 | The VM needs to be restarted at least once before this works. Simply restart the VM again 21 | and the galaxy docker container should be launched. 22 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Register whether config folder is already created 18 | stat: 19 | path: "{{galaxy_docker_export_location}}/galaxy-central/config" 20 | register: default_config_folder 21 | until: default_config_folder.stat.exists 22 | retries: 10 23 | delay: 15 24 | 25 | - import_tasks: template_ldap.yml 26 | when: galaxy_docker_template_ldap 27 | 28 | - import_tasks: galaxywelcome.yml 29 | when: galaxy_docker_template_welcome 30 | 31 | - import_tasks: setup_cluster_general.yml 32 | when: galaxy_docker_cluster 33 | 34 | - import_tasks: setup_virtual_environment.yml 35 | when: galaxy_docker_cluster_virtualenv is defined 36 | 37 | - import_tasks: setupsge.yml 38 | when: 39 | - galaxy_docker_cluster 40 | - galaxy_docker_cluster_type == 'sge' 41 | 42 | 43 | - import_tasks: report_user.yml 44 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Start docker installation 18 | include_role: 19 | name: installdocker 20 | when: installdocker 21 | 22 | - import_tasks: install_packages.yml 23 | when: galaxy_docker_install_packages 24 | 25 | - import_tasks: add_users.yml 26 | when: galaxy_docker_add_users 27 | 28 | - import_tasks: add_user_ssh_keys.yml 29 | when: galaxy_docker_create_user_ssh_keys 30 | 31 | - import_tasks: galaxy_startup_service.yml 32 | when: galaxy_docker_prerequisites_startup_service 33 | 34 | - import_tasks: create_export_folder.yml 35 | when: galaxy_docker_create_export_folder 36 | 37 | - import_tasks: nginxsettings.yml 38 | when: galay_docker_nginx_settings 39 | 40 | - name: Start nginx installation 41 | include_role: 42 | name: jdauphant.nginx 43 | when: ansible_role_nginx 44 | 45 | - import_tasks: galaxyfirewall.yml 46 | when: galaxy_docker_firewall 47 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/docker_environment_provision.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | {# #} 16 | # Galaxy docker environment file. WARNING: NEWLINES NOT ALLOWED 17 | # This is due to a dysfunctional python parser 18 | # Create newlines using hashes 19 | # 20 | ##### 21 | ### Obligatory section. 22 | ### No defaults used. Specifiy in galaxysettings.config 23 | ##### 24 | # 25 | GALAXY_CONFIG_ADMIN_USERS={{galaxy_docker_provision_user}} 26 | #Master API KEY should not be the same as admin api key of provision user. 27 | GALAXY_CONFIG_MASTER_API_KEY=NOT{{galaxy_docker_provision_key}} 28 | GALAXY_CONFIG_BRAND={{galaxy_brand}} 29 | # 30 | ##### 31 | ###Optional Section. 32 | ##### 33 | {%if galaxy_docker_optional_environment_settings is defined %} 34 | {% for env_var, env_setting in galaxy_docker_optional_environment_settings.items() %} 35 | {{env_var}}={{env_setting}} 36 | {% endfor %} 37 | {% endif %} 38 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/transfer_genomes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # this task installs ephemeris. It is used for installing tools and genomes. 18 | 19 | - name: Create genomes directory in export folder 20 | file: 21 | path: "{{galaxy_docker_export_location}}/genomes" 22 | state: directory 23 | 24 | - name: Move genomes to the server using rsync 25 | synchronize: 26 | compress: yes #Necessary for big fasta files 27 | # You don't have to duplicate the file in the playbook directory but can symlink instead 28 | copy_links: "{{galaxy_docker_genome_copy_links}}" 29 | delete: no # do not delete genomes already there 30 | dest: "{{galaxy_docker_export_location}}/genomes" 31 | src: "{{galaxy_docker_genomes_dir}}" 32 | archive: no #owner and chmod information should not be copied 33 | recursive: yes 34 | #when archive is no. Checksum should be yes, otherwise the files are always copied. 35 | checksum: yes 36 | -------------------------------------------------------------------------------- /roles/galaxy-docker/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # handlers file for galaxy_docker 18 | 19 | - name: Load restart galaxy in container handler. 20 | import_tasks: restart_galaxy_in_container.yml 21 | become: "{{galaxy_docker_become}}" 22 | become_user: "{{galaxy_docker_docker_user}}" 23 | vars: 24 | ansible_user: "{{galaxy_docker_docker_ssh_user}}" 25 | ansible_ssh_private_key_file: "{{galaxy_docker_docker_user_private_key}}" 26 | 27 | - name: check if galaxy has started 28 | uri: 29 | url: "http://localhost:{{galaxy_docker_web_port}}" 30 | return_content: yes 31 | register: result 32 | until: 'galaxy_brand in result.content' 33 | retries: 20 34 | delay: 10 35 | 36 | - name: check if provision galaxy has started 37 | uri: 38 | url: "http://localhost:{{galaxy_docker_provision_port}}" 39 | return_content: yes 40 | register: result 41 | until: 'galaxy_brand in result.content' 42 | retries: 20 43 | delay: 10 44 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/delete/delete_system_files.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: remove firewall port exception 18 | ufw: 19 | name: "{{galaxy_docker_ufw_profile}}" 20 | rule: allow 21 | delete: yes 22 | state: reloaded 23 | 24 | - name: remove firewall profile 25 | file: 26 | path: "/etc/ufw/applications.d/{{galaxy_docker_ufw_profile}}" 27 | state: absent 28 | when: not galaxy_docker_delete_test_upgrade 29 | 30 | - name: remove firewall profile 31 | file: 32 | path: "/etc/ufw/applications.d/{{galaxy_docker_test_ufw_profile}}" 33 | state: absent 34 | when: galaxy_docker_delete_test_upgrade 35 | 36 | - import_tasks: ../prerequisites/nginxsettings.yml 37 | when: not galaxy_docker_delete_test_upgrade 38 | 39 | - name: remove nginx profiles 40 | file: 41 | path: "/etc/nginx/sites-available/{{item.key}}.conf" 42 | state: absent 43 | with_dict: "{{nginx_sites}}" 44 | when: not galaxy_docker_delete_test_upgrade 45 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/import/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # tasks file for galaxy_docker_import_database 18 | # This imports a database in galaxy. 19 | # This does overwrite the existing database. 20 | 21 | - name: Register the files that are copied 22 | find: 23 | paths: "{{galaxy_docker_import_db_dir}}" 24 | patterns: "*" 25 | register: dump_file_list 26 | delegate_to: 127.0.0.1 27 | become: no 28 | 29 | - name: show dump_file_list 30 | debug: 31 | var: dump_file_list 32 | verbosity: 1 33 | 34 | - name: Fail when multiple files are found 35 | fail: 36 | msg: "Multiple files in {{galaxy_docker_import_db_dir}}" 37 | when: "dump_file_list.matched > 1" 38 | 39 | - name: Display when no files are found 40 | debug: 41 | msg: "No files in {{galaxy_docker_import_db_dir}}. Skipping galaxy_docker_import_database role" 42 | when: "dump_file_list.matched < 1" 43 | 44 | - import_tasks: import.yml 45 | when: "dump_file_list.matched == 1" 46 | -------------------------------------------------------------------------------- /files/example_host/dbkeys/dbkeys.yaml.sample: -------------------------------------------------------------------------------- 1 | # configuration for fetch and index genomes 2 | 3 | data_managers: 4 | # Data manager ID 5 | - id: toolshed.g2.bx.psu.edu/repos/devteam/data_manager_fetch_genome_dbkeys_all_fasta/data_manager_fetch_genome_all_fasta_dbkey/0.0.2 6 | # tool parameters, nested parameters should be specified using a pipe (|) 7 | params: 8 | - 'dbkey_source|dbkey': '{{ item }}' 9 | - 'reference_source|reference_source_selector': 'ucsc' 10 | - 'reference_source|requested_dbkey': '{{ item }}' 11 | # Items refere to a list of variables you want to run this data manager. You can use them inside the param field with {{ item }} 12 | # In case of genome for example you can run this DM with multiple genomes, or you could give multiple URLs. 13 | items: 14 | - ce6 15 | #- dm3 16 | #- mm9 17 | # Name of the data-tables you want to reload after your DM are finished. This can be important for subsequent data managers 18 | data_table_reload: 19 | - all_fasta 20 | - __dbkeys__ 21 | 22 | # - id: toolshed.g2.bx.psu.edu/repos/devteam/data_manager_bowtie2_index_builder/bowtie2_index_builder_data_manager/2.2.6 23 | # params: 24 | # - 'all_fasta_source': '{{ item }}' 25 | # items: 26 | # #- ce8 27 | # - dm3 28 | # #- mm9 29 | # data_table_reload: 30 | # # Bowtie creates indices for Bowtie and TopHat 31 | # - bowtie2_indexes 32 | # - tophat2_indexes 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | sudo: false 4 | services: 5 | - docker 6 | python: 2.7 7 | git: 8 | submodules: false 9 | matrix: 10 | include: 11 | 12 | - env: 13 | Lint_and_license_test: True 14 | install: 15 | - pip install mkdocs yamllint ansible-lint 16 | script: 17 | - bash test/yamllinting.sh 18 | - bash test/ansiblelinting.sh 19 | - bash test/mkdocs.sh 20 | - bash test/licensetest.sh 21 | 22 | - env: 23 | test_hostname: ubuntu-16.04 24 | privileged: True 25 | install: 26 | - pip install ansible==2.4.0 27 | script: 28 | - bash -c 'source test/test_playbook.sh $test_hostname $privileged' 29 | 30 | - env: 31 | test_hostname: ubuntu-16.04 32 | privileged: False 33 | install: 34 | - pip install ansible==2.4.0 35 | script: 36 | - bash -c 'source test/test_playbook.sh $test_hostname $privileged' 37 | 38 | - env: 39 | test_hostname: cluster-test 40 | privileged: False 41 | install: 42 | - pip install ansible==2.4.0 43 | script: 44 | - bash -c 'source test/test_playbook.sh $test_hostname $privileged' 45 | 46 | - env: 47 | test_hostname: cluster-test2 48 | privileged: False 49 | install: 50 | - pip install ansible==2.4.0 51 | script: 52 | - bash -c 'source test/test_playbook.sh $test_hostname $privileged' 53 | # Keep inboxes nice and clean. 54 | notifications: 55 | email: false 56 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/ephemeris_jobs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - import_tasks: installephemeris.yml 18 | 19 | - import_tasks: container_running_check.yml 20 | 21 | - import_tasks: installtools.yml 22 | when: galaxy_docker_provision_tools 23 | 24 | - name: register whether the docker provision container is running 25 | command: "docker ps -q -f name={{galaxy_docker_provision_container_name}}$" 26 | register: provision_container_running 27 | changed_when: false 28 | 29 | - import_tasks: installgenomes.yml 30 | when: galaxy_docker_provision_genomes 31 | 32 | - name: register whether the docker provision container is running 33 | command: "docker ps -q -f name={{galaxy_docker_provision_container_name}}$" 34 | register: provision_container_running 35 | changed_when: false 36 | 37 | - name: Remove the docker provision container 38 | docker_container: 39 | name: "{{galaxy_docker_provision_container_name}}" 40 | state: absent 41 | when: 42 | - provision_container_running.stdout !='' 43 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/delete/delete_export_folder.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Remove docker export volumes 18 | docker_container: 19 | volumes: "{{galaxy_docker_export_location}}:/export/" 20 | image: "{{galaxy_docker_docker_image}}" 21 | name: "delete_galaxy_{{ansible_date_time.epoch}}" 22 | state: started 23 | command: bash -c 'rm -rfv /export/* /export/.distribution_config' 24 | register: docker_container 25 | 26 | - name: Save delete container name 27 | set_fact: 28 | galaxy_docker_delete_container: '{{docker_container.Name.replace("/","")}}' 29 | 30 | - name: register whether the delete export container has finished 31 | command: "docker inspect -f {{inspect}} {{galaxy_docker_delete_container}}" 32 | vars: 33 | inspect: !unsafe '{{.State.Running}}' 34 | register: folder_container_running 35 | until: 'not folder_container_running.stdout | bool' 36 | retries: 10 37 | delay: 10 38 | 39 | - name: Remove delete container 40 | docker_container: 41 | name: "{{galaxy_docker_delete_container}}" 42 | state: absent 43 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/delete/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # This deletes the galaxy container and all remnants. 18 | 19 | - import_tasks: delete_system_files.yml 20 | when: 21 | - galaxy_docker_delete_system_files 22 | - galaxy_docker_run_privileged 23 | become: yes 24 | become_user: root 25 | 26 | - name: Set parameters for deleting the test upgrade container 27 | set_fact: 28 | "{{item.key}}": "{{item.value}}" 29 | with_dict: "{{galaxy_docker_upgrade_test_settings}}" 30 | when: galaxy_docker_delete_test_upgrade 31 | 32 | - name: Remove docker container 33 | docker_container: 34 | name: "{{galaxy_docker_container_name}}" 35 | state: absent 36 | 37 | - import_tasks: delete_export_folder.yml 38 | when: galaxy_docker_delete_files 39 | 40 | - import_tasks: delete_cron_jobs.yml 41 | when: 42 | - galaxy_docker_delete_cron_jobs 43 | - not galaxy_docker_delete_test_upgrade 44 | 45 | - name: delete backup files 46 | file: 47 | path: "{{galaxy_docker_backup_location}}" 48 | state: absent 49 | when: galaxy_docker_delete_backup_files 50 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prepare_docker/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Stop galaxy container before patching 18 | docker_container: 19 | name: "{{galaxy_docker_container_name}}" 20 | state: absent 21 | when: galaxy_docker_security_patch 22 | 23 | - name: Delete old docker image 24 | docker_image: 25 | name: "{{galaxy_docker_docker_image}}" 26 | state: absent 27 | when: galaxy_docker_security_patch 28 | 29 | - import_tasks: change_uids.yml 30 | when: galaxy_docker_change_uids 31 | 32 | - import_tasks: customimage.yml 33 | when: (galaxy_docker_custom_image or galaxy_docker_change_uids) 34 | 35 | - name: Download image when not present 36 | docker_image: 37 | name: "{{galaxy_docker_docker_image}}" 38 | state: present 39 | 40 | - import_tasks: create_export_folder.yml 41 | become: "{{galaxy_docker_become}}" 42 | become_user: "{{galaxy_docker_web_user}}" 43 | vars: 44 | ansible_user: "{{galaxy_docker_web_ssh_user}}" 45 | ansible_ssh_private_key_file: "{{galaxy_docker_web_user_private_key}}" 46 | 47 | - import_tasks: create_export_directory_folders.yml 48 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/import/transfer_database.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: register dump_file 18 | set_fact: 19 | galaxy_docker_imported_db: "{{dump_file_list.files[0].path | basename }}" 20 | 21 | - name: show database name 22 | debug: 23 | var: galaxy_docker_imported_db 24 | verbosity: 1 25 | 26 | - name: Create folder to import database into 27 | file: 28 | path: "{{galaxy_docker_imported_db_location}}" 29 | state: directory 30 | mode: 0700 31 | 32 | - name: copy database file using rsync 33 | synchronize: 34 | mode: push 35 | dest: "{{galaxy_docker_imported_db_location}}/{{galaxy_docker_imported_db}}" 36 | src: "{{galaxy_docker_import_db_dir}}/{{galaxy_docker_imported_db}}" 37 | perms: yes 38 | compress: yes 39 | 40 | # Not necessary when connected as the galaxy user. Which is the default in non-privileged mode. 41 | - name: set ownership rights correctly 42 | file: 43 | path: "{{galaxy_docker_imported_db_location}}/{{galaxy_docker_imported_db}}" 44 | owner: "{{galaxy_docker_web_user}}" 45 | become: yes 46 | become_user: root 47 | when: galaxy_docker_run_privileged 48 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/docker_volumes_provision.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | {# ----- #} 3 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 4 | {# Contact us at: sasc@lumc.nl #} 5 | {# #} 6 | {# This file is part of galaxy-launcher. #} 7 | {# #} 8 | {# galaxy-launcher is free software: you can redistribute it #} 9 | {# and/or modify it under the terms of the MIT License (Expat) as #} 10 | {# published by the Open Source initiative. #} 11 | {# #} 12 | {# You should have received a copy of the MIT License (Expat) #} 13 | {# along with galaxy-launcher. If not, see #} 14 | {# . #} 15 | {# ..... #} 16 | {{ansible_managed | comment}} 17 | 18 | # galaxy-launcher generates these values to run the docker container. 19 | 20 | docker_mounted_volumes: 21 | - "{{galaxy_docker_export_location}}:/export/" 22 | {% if galaxy_docker_shared_cluster_directory is defined%} 23 | - "{{galaxy_docker_shared_cluster_directory}}:{{galaxy_docker_shared_cluster_directory}}" 24 | {% endif %} 25 | {% if galaxy_docker_extra_volumes is defined and galaxy_docker_extra_volumes !='' %} 26 | {% for extra_volume in galaxy_docker_extra_volumes %} 27 | - "{{extra_volume}}" 28 | {% endfor %} 29 | {% endif %} 30 | # {% if galaxy_docker_cluster_virtualenv is defined%} 31 | # - "{{galaxy_docker_cluster_virtualenv}}:/galaxy_venv" 32 | # - "{{galaxy_docker_cluster_virtualenv}}:{{galaxy_docker_cluster_virtualenv}}" 33 | # {% endif %} 34 | # {% if galaxy_docker_optional_environment_settings.SGE_ROOT is defined%} 35 | # - "{{galaxy_docker_optional_environment_settings.SGE_ROOT}}:{{galaxy_docker_optional_environment_settings.SGE_ROOT}}" 36 | # {% endif %} 37 | ... 38 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | 4 | ## Current development branch 5 | * Make sure NGINX can be resolved by making it a git submodule. 6 | * Fixed bug where galaxy_ext library could not be found when using SGE cluster 7 | * Fixed bug in the cron backup scripts. 8 | Now the userID is used to identify the backup user in the container. 9 | * Ephemeris default version upgraded to 0.8 10 | * Update virtual environment when using a cluster virtual environment and upgrading to 11 | a new version of galaxy. 12 | * Allow_password_change is enabled by default on ldap-authenticated galaxies. This only affects the 13 | ability to login to the sftp server. 14 | * Updated default bgruening/galaxy-stable image to 18.05 15 | 16 | ## Release 1.0.0 17 | The first release of galaxy-launcher. Features include: 18 | 19 | * Complete deployment of a galaxy instance with just two commands. 20 | * Configuration in easy to understand yaml files. 21 | * Use the example host files to quickly get started 22 | * Use the cluster example host to get the image running on your cluster 23 | * Install prerequisites including docker on a Ubuntu or CentOS server 24 | * Automatic provisioning 25 | * The galaxy docker container is restarted on reboot of the system 26 | * Running the deployment script as a non-privileged user (root required for prerequisites script) 27 | 28 | Important changes during development up to first release: 29 | * Changed name from galaxy-docker-ansible to galaxy-launcher 30 | * Changed license from a custom license to MIT (expat) License 31 | * Restructured galaxy-docker-role to concentrate all tasks requiring 32 | root in one part of the role. 33 | * Enabled the use of galaxy-docker-ansible for a VM connected to a cluster. 34 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/rsyncscript.sh.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | #!/bin/bash 16 | set -eu -o pipefail 17 | 18 | timestamp(){ 19 | {{galaxy_docker_backup_cron_log_timestamp}} 20 | } 21 | 22 | echo "$(timestamp) === START RSYNCING BACKUP DATA ===" 23 | 24 | src={{src}} 25 | host={{host_address}} 26 | user={{user | default("")}} 27 | dest={{dest}} 28 | dest_string={{user | default("")}}{{ '@' if user != '' else '' }}{{host_address}}:{{dest}} 29 | flags="-v -a --compress-level={{compression_level | default('0')}} {{ '--delete' if delete else ''}} --delete-after" 30 | command="rsync $flags $src $dest_string" 31 | 32 | echo "$(timestamp) Source = $src" 33 | echo "$(timestamp) Remote host = $host" 34 | echo "$(timestamp) Destination = $dest" 35 | {% if user != '' %} 36 | echo "$(timestamp) Remote_user = $user" 37 | {% endif %} 38 | echo "$(timestamp) flags = $flags" 39 | echo "$(timestamp) command = $command" 40 | echo "$(timestamp) --- START SYNCING ---" 41 | stdbuf -oL -eL $command | 42 | while IFS= read -r line 43 | do echo "$(timestamp) $line" 44 | done 45 | echo "$(timestamp) --- DONE ---" 46 | echo "$(timestamp) === RSYNC TO BACKUP SERVER SUCCESSFULL ===" 47 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prepare_docker/create_export_directory_folders.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create config folder 18 | docker_container: 19 | volumes: "{{galaxy_docker_export_location}}:/export/" 20 | image: "{{galaxy_docker_docker_image}}" 21 | name: "export_folder_creator_{{ansible_date_time.epoch}}" 22 | state: started 23 | command: "/usr/local/bin/export_user_files.py $PG_DATA_DIR_DEFAULT" 24 | register: docker_container 25 | 26 | - name: Show docker_container variable 27 | debug: 28 | var: docker_container 29 | verbosity: 1 30 | 31 | - name: Save config folder creator container name 32 | set_fact: 33 | config_folder_creator_name: '{{docker_container.Name.replace("/","")}}' 34 | 35 | - name: register whether the folder creator container has finished 36 | command: "docker inspect -f {{inspect}} {{config_folder_creator_name}}" 37 | vars: 38 | inspect: !unsafe '{{.State.Running}}' 39 | register: folder_container_running 40 | until: 'not folder_container_running.stdout | bool' 41 | retries: 30 42 | delay: 10 43 | 44 | - name: Remove config folder creator container 45 | docker_container: 46 | name: "{{config_folder_creator_name}}" 47 | state: absent 48 | keep_volumes: True 49 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/start_container/install_python_dependencies.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: register whether the container is running 18 | command: "docker inspect -f {{inspect}} {{galaxy_docker_container_name}}" 19 | vars: 20 | inspect: !unsafe '{{.State.Running}}' 21 | changed_when: false 22 | register: docker_running 23 | 24 | - name: Show docker inspection results 25 | debug: 26 | var: docker_running 27 | verbosity: 1 28 | 29 | - name: Make sure the docker container is started 30 | docker_container: 31 | name: "{{galaxy_docker_container_name}}" 32 | state: started 33 | when: not docker_running.stdout | bool 34 | 35 | - name: install python_ldap in docker container 36 | command: "docker exec -u {{user}} {{name}} {{command}}" 37 | vars: 38 | user: "{{galaxy_docker_web_user}}" 39 | name: "{{galaxy_docker_container_name}}" 40 | command: /galaxy_venv/bin/pip install python-ldap -i https://wheels.galaxyproject.org 41 | register: ldap_python_install 42 | changed_when: '"Successfully installed python-ldap" in ldap_python_install.stdout' 43 | notify: restart galaxy in container 44 | 45 | - name: show installationresults 46 | debug: 47 | var: ldap_python_install.stdout 48 | verbosity: 1 49 | -------------------------------------------------------------------------------- /test/docker/centos-7/files/galaxy_ssh: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEA0Wuz+21QeA/1UDmkr+c8BvCWQD0brB+tFF5slMJ+WLdBSs5H 3 | 9pfcHHlrYB/DRMJC8BT3+GIOoXCbBULxp8tGYPv42iwtgfWUdVHrcwlQBxgY7cX9 4 | urm6/elR4TK3Cf2v1b4IxJQHeojA+2eBorFXDQbn/FGFgZlML+QCK7DJRwidMNnt 5 | r81CLh2UCg3h8j5mGCbL3QevkxHBQZBNLaIgYhuMowOIUk21qOqbvk5dNYIrVFNt 6 | J6mkUcpDwjFFT+r5//pm+JqGdnijckrTc/evXgEno8q+/07RFHDg8S2XNmEnF98F 7 | v4PZUX5UjcO65HABTCjnwVL4fKt7sQ8A4iyC4QIDAQABAoIBAQCiyUSzeUqmuUjo 8 | HpasgWNAxb0VnCqphknk3m0qyXCrB3ACdQytW2gm3h8gLjB8f0DHHJWQhrB2v3BR 9 | C7OKydEgTF0pQlPxhHLtK0uJNUD28r1V/qR3hC4dd0NFeUWcx4zp6fkozSRvFGRm 10 | SBQV4iIXpzmnAbt0fTQiuesSCS68PkYeUijrHQY3tGjAVlTM4+JrD4U/Xbjf9BQY 11 | H3QwArHdReqEW4aIst9cY0CnUyR6LpNCzdFOG/0QmFWw0nMPumlevJ5PerMcwnNm 12 | Q7sDgy2JefJymlUBbOC6ZA+tgov8o48jCPLR6c7umfIyJZYcQysBmk6KvHtGiJ58 13 | gqZLfevRAoGBAPfIoxKzIMEjwy/rVgPRYxx2AO5xSdj0oeUWMzrpgOrETtw0PRYP 14 | lxLhyIA4PdtvO9MOyF8tC3ftdPF/3YlDFduf/EugNGGnC27zxKVpo+y0A/tYsMhF 15 | 8+nyM2qid2bWytq63/HGTfn7SbU0wWeuJRhfSkUVgSpVGy9pMy/wwQAVAoGBANhd 16 | aeaDdKbtTdxlHb5Nb9tZn8pXNWmQJ87htgvhuzz7yZWsCZgLTFjXJotplSDtQAp7 17 | +yWOxSISfEaCY1A3zQHoBTzEgGcTWYaFvBQ5e6FagfCYkPz4u9qPLY6U2kXI8XZG 18 | ksuTZW/a6EKaCBPf+lv0LL3kgQPDeMZZB3dc2R6dAoGAJi3CArWbDGdoQc/vFvOC 19 | Y/ZCunq2ODmpYFUFW8Ry2rmYtRFPgECytHQZorgHv/Hps+GJOjEEnVv3MubSyb2O 20 | dqK2CykKKSnF9ziUSjB205gBLQ9DXfh5Vsi852dVIoFiDEXTD7vQc/4mI0eXrVQF 21 | 3zV/ihmAJ3epkqqQ+ogMFOkCgYBo0sEGy/NNGDUbrOV/GDc0FzTCLAQVk6Clq1au 22 | ZPt4rSfZ2pJ/ViHz/LCQ5GM6o5bePXjMlmHNgxUwd+UzrQUmgklfSnhG9+nssYgQ 23 | aFUMNDQ140SDOuKQHcPdiyJAovzQ55ohBNUlHvJdqhB1yJKb0C2JBla3AxHVTra+ 24 | Tn5mRQKBgQCJKx/OXHtsff5N0/DpuZKd/9z2oRk56WAlTCgsgVm7QxbcTA1ZdPH+ 25 | P+iiqBrr9cBiX32nS+F5oVvaslBeI5LIGKw5bI2KJ/H4i4IL/E2+XovPDqvjZ791 26 | Rpor4sLOoKy00g4lOvGTbIQ+MfudsqbOSfPJfx4CJsp22mPKJSrLvw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /test/docker/cluster-test2/files/galaxy_ssh: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEA0Wuz+21QeA/1UDmkr+c8BvCWQD0brB+tFF5slMJ+WLdBSs5H 3 | 9pfcHHlrYB/DRMJC8BT3+GIOoXCbBULxp8tGYPv42iwtgfWUdVHrcwlQBxgY7cX9 4 | urm6/elR4TK3Cf2v1b4IxJQHeojA+2eBorFXDQbn/FGFgZlML+QCK7DJRwidMNnt 5 | r81CLh2UCg3h8j5mGCbL3QevkxHBQZBNLaIgYhuMowOIUk21qOqbvk5dNYIrVFNt 6 | J6mkUcpDwjFFT+r5//pm+JqGdnijckrTc/evXgEno8q+/07RFHDg8S2XNmEnF98F 7 | v4PZUX5UjcO65HABTCjnwVL4fKt7sQ8A4iyC4QIDAQABAoIBAQCiyUSzeUqmuUjo 8 | HpasgWNAxb0VnCqphknk3m0qyXCrB3ACdQytW2gm3h8gLjB8f0DHHJWQhrB2v3BR 9 | C7OKydEgTF0pQlPxhHLtK0uJNUD28r1V/qR3hC4dd0NFeUWcx4zp6fkozSRvFGRm 10 | SBQV4iIXpzmnAbt0fTQiuesSCS68PkYeUijrHQY3tGjAVlTM4+JrD4U/Xbjf9BQY 11 | H3QwArHdReqEW4aIst9cY0CnUyR6LpNCzdFOG/0QmFWw0nMPumlevJ5PerMcwnNm 12 | Q7sDgy2JefJymlUBbOC6ZA+tgov8o48jCPLR6c7umfIyJZYcQysBmk6KvHtGiJ58 13 | gqZLfevRAoGBAPfIoxKzIMEjwy/rVgPRYxx2AO5xSdj0oeUWMzrpgOrETtw0PRYP 14 | lxLhyIA4PdtvO9MOyF8tC3ftdPF/3YlDFduf/EugNGGnC27zxKVpo+y0A/tYsMhF 15 | 8+nyM2qid2bWytq63/HGTfn7SbU0wWeuJRhfSkUVgSpVGy9pMy/wwQAVAoGBANhd 16 | aeaDdKbtTdxlHb5Nb9tZn8pXNWmQJ87htgvhuzz7yZWsCZgLTFjXJotplSDtQAp7 17 | +yWOxSISfEaCY1A3zQHoBTzEgGcTWYaFvBQ5e6FagfCYkPz4u9qPLY6U2kXI8XZG 18 | ksuTZW/a6EKaCBPf+lv0LL3kgQPDeMZZB3dc2R6dAoGAJi3CArWbDGdoQc/vFvOC 19 | Y/ZCunq2ODmpYFUFW8Ry2rmYtRFPgECytHQZorgHv/Hps+GJOjEEnVv3MubSyb2O 20 | dqK2CykKKSnF9ziUSjB205gBLQ9DXfh5Vsi852dVIoFiDEXTD7vQc/4mI0eXrVQF 21 | 3zV/ihmAJ3epkqqQ+ogMFOkCgYBo0sEGy/NNGDUbrOV/GDc0FzTCLAQVk6Clq1au 22 | ZPt4rSfZ2pJ/ViHz/LCQ5GM6o5bePXjMlmHNgxUwd+UzrQUmgklfSnhG9+nssYgQ 23 | aFUMNDQ140SDOuKQHcPdiyJAovzQ55ohBNUlHvJdqhB1yJKb0C2JBla3AxHVTra+ 24 | Tn5mRQKBgQCJKx/OXHtsff5N0/DpuZKd/9z2oRk56WAlTCgsgVm7QxbcTA1ZdPH+ 25 | P+iiqBrr9cBiX32nS+F5oVvaslBeI5LIGKw5bI2KJ/H4i4IL/E2+XovPDqvjZ791 26 | Rpor4sLOoKy00g4lOvGTbIQ+MfudsqbOSfPJfx4CJsp22mPKJSrLvw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /test/docker/ubuntu-16.04/files/galaxy_ssh: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEA0Wuz+21QeA/1UDmkr+c8BvCWQD0brB+tFF5slMJ+WLdBSs5H 3 | 9pfcHHlrYB/DRMJC8BT3+GIOoXCbBULxp8tGYPv42iwtgfWUdVHrcwlQBxgY7cX9 4 | urm6/elR4TK3Cf2v1b4IxJQHeojA+2eBorFXDQbn/FGFgZlML+QCK7DJRwidMNnt 5 | r81CLh2UCg3h8j5mGCbL3QevkxHBQZBNLaIgYhuMowOIUk21qOqbvk5dNYIrVFNt 6 | J6mkUcpDwjFFT+r5//pm+JqGdnijckrTc/evXgEno8q+/07RFHDg8S2XNmEnF98F 7 | v4PZUX5UjcO65HABTCjnwVL4fKt7sQ8A4iyC4QIDAQABAoIBAQCiyUSzeUqmuUjo 8 | HpasgWNAxb0VnCqphknk3m0qyXCrB3ACdQytW2gm3h8gLjB8f0DHHJWQhrB2v3BR 9 | C7OKydEgTF0pQlPxhHLtK0uJNUD28r1V/qR3hC4dd0NFeUWcx4zp6fkozSRvFGRm 10 | SBQV4iIXpzmnAbt0fTQiuesSCS68PkYeUijrHQY3tGjAVlTM4+JrD4U/Xbjf9BQY 11 | H3QwArHdReqEW4aIst9cY0CnUyR6LpNCzdFOG/0QmFWw0nMPumlevJ5PerMcwnNm 12 | Q7sDgy2JefJymlUBbOC6ZA+tgov8o48jCPLR6c7umfIyJZYcQysBmk6KvHtGiJ58 13 | gqZLfevRAoGBAPfIoxKzIMEjwy/rVgPRYxx2AO5xSdj0oeUWMzrpgOrETtw0PRYP 14 | lxLhyIA4PdtvO9MOyF8tC3ftdPF/3YlDFduf/EugNGGnC27zxKVpo+y0A/tYsMhF 15 | 8+nyM2qid2bWytq63/HGTfn7SbU0wWeuJRhfSkUVgSpVGy9pMy/wwQAVAoGBANhd 16 | aeaDdKbtTdxlHb5Nb9tZn8pXNWmQJ87htgvhuzz7yZWsCZgLTFjXJotplSDtQAp7 17 | +yWOxSISfEaCY1A3zQHoBTzEgGcTWYaFvBQ5e6FagfCYkPz4u9qPLY6U2kXI8XZG 18 | ksuTZW/a6EKaCBPf+lv0LL3kgQPDeMZZB3dc2R6dAoGAJi3CArWbDGdoQc/vFvOC 19 | Y/ZCunq2ODmpYFUFW8Ry2rmYtRFPgECytHQZorgHv/Hps+GJOjEEnVv3MubSyb2O 20 | dqK2CykKKSnF9ziUSjB205gBLQ9DXfh5Vsi852dVIoFiDEXTD7vQc/4mI0eXrVQF 21 | 3zV/ihmAJ3epkqqQ+ogMFOkCgYBo0sEGy/NNGDUbrOV/GDc0FzTCLAQVk6Clq1au 22 | ZPt4rSfZ2pJ/ViHz/LCQ5GM6o5bePXjMlmHNgxUwd+UzrQUmgklfSnhG9+nssYgQ 23 | aFUMNDQ140SDOuKQHcPdiyJAovzQ55ohBNUlHvJdqhB1yJKb0C2JBla3AxHVTra+ 24 | Tn5mRQKBgQCJKx/OXHtsff5N0/DpuZKd/9z2oRk56WAlTCgsgVm7QxbcTA1ZdPH+ 25 | P+iiqBrr9cBiX32nS+F5oVvaslBeI5LIGKw5bI2KJ/H4i4IL/E2+XovPDqvjZ791 26 | Rpor4sLOoKy00g4lOvGTbIQ+MfudsqbOSfPJfx4CJsp22mPKJSrLvw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prepare_docker/customimage.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create docker build directory 18 | file: 19 | path: "{{galaxy_docker_docker_build_dir}}/custom_image" 20 | state: directory 21 | mode: 0700 22 | 23 | - name: Check if docker_custom_image directory exists 24 | stat: 25 | path: "{{galaxy_docker_custom_image_dir}}" 26 | register: custom_image_dir 27 | delegate_to: 127.0.0.1 28 | become: no 29 | 30 | - name: Copy files to docker build directory 31 | copy: 32 | src: "{{galaxy_docker_custom_image_dir}}" 33 | dest: "{{galaxy_docker_docker_build_dir}}/custom_image" 34 | mode: 0700 35 | when: custom_image_dir.stat.exists 36 | 37 | - name: Template the Dockerfile 38 | template: 39 | dest: "{{galaxy_docker_docker_build_dir}}/custom_image/Dockerfile" 40 | src: Dockerfile.j2 41 | mode: 0600 42 | force: yes 43 | 44 | - name: Build custom docker image 45 | docker_image: 46 | name: "{{galaxy_docker_docker_image}}" 47 | path: "{{galaxy_docker_docker_build_dir}}/custom_image" 48 | force: yes 49 | state: present 50 | nocache: "{{galaxy_docker_security_patch}}" 51 | pull: "{{ (not galaxy_docker_change_uids) | bool}}" 52 | 53 | - name: remove docker build directory 54 | file: 55 | path: "{{galaxy_docker_docker_build_dir}}/custom_image" 56 | state: absent 57 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/galaxy_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | #Required settings 3 | # Please uncomment and specify these values yourself 4 | 5 | galaxy_admin_user: "admin@galaxy.org" 6 | galaxy_master_api_key: "insecure_test_key9s98d8dy98i212ybkknb" 7 | galaxy_brand: "test" 8 | galaxy_report_user: admin 9 | galaxy_report_password: admin 10 | 11 | galaxy_admin_api_key: "admin" 12 | 13 | # optional settings 14 | galaxy_docker_optional_environment_settings: 15 | GALAXY_CONFIG_CONDA_AUTO_INSTALL: True 16 | GALAXY_CONFIG_CONDA_AUTO_INIT: True 17 | GALAXY_CONFIG_USE_CACHED_DEPENDENCY_MANAGER: True 18 | GALAXY_CONFIG_SANITIZE_ALL_HTML: True 19 | GALAXY_LOGGING: full 20 | NONUSE: proftp,condor,slurm 21 | SGE_ROOT: /var/lib/gridengine 22 | DRMAA_LIBRARY_PATH: /usr/lib/gridengine-drmaa/lib/libdrmaa.so.1.0 23 | GALAXY_CONFIG_OUTPUTS_TO_WORKING_DIRECTORY: True 24 | GALAXY_CONFIG_RETRY_JOB_OUTPUT_COLLECTION: 5 25 | # Set directories to cluster file system 26 | GALAXY_CONFIG_CLUSTER_FILES_DIRECTORY: "{{galaxy_docker_shared_cluster_directory}}/job_scripts" 27 | GALAXY_CONFIG_NEW_FILE_PATH: "{{galaxy_docker_shared_cluster_directory}}/tmp" 28 | GALAXY_CONFIG_TOOL_DEPENDENCY_DIR: "{{galaxy_docker_export_location}}/tool_deps" 29 | GALAXY_CONFIG_CONDA_PREFIX: "{{galaxy_docker_shared_cluster_directory}}/_conda" 30 | GALAXY_CONFIG_TOOL_DEPENDENCY_CACHE_DIR: "{{galaxy_docker_export_location}}/tool_deps/_cache" 31 | GALAXY_CONFIG_JOB_WORKING_DIRECTORY: "{{galaxy_docker_export_location}}/galaxy-central/database/job_working_directory" 32 | GALAXY_CONFIG_FILE_PATH: "{{galaxy_docker_export_location}}/galaxy-central/database/files" 33 | GALAXY_CONFIG_TOOL_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tools" 34 | GALAXY_CONFIG_TOOL_DATA_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tool-data" 35 | GALAXY_CONFIG_SHED_TOOL_DATA_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tool-data" 36 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # http://yamllint.readthedocs.io/en/latest/rules.html 4 | 5 | rules: 6 | # "{{var}}" for variables. "{}" for empty dictionaries. 7 | braces: 8 | min-spaces-inside: 0 9 | max-spaces-inside: 0 10 | min-spaces-inside-empty: 0 11 | max-spaces-inside-empty: 0 12 | # Lists as [ 1, 2, 3, 4, 5 ] empty lists as [] 13 | brackets: 14 | min-spaces-inside: 1 15 | max-spaces-inside: 1 16 | min-spaces-inside-empty: 0 17 | max-spaces-inside-empty: 0 18 | # Set variables to be always one space after colon 19 | colons: 20 | max-spaces-before: 0 21 | max-spaces-after: 1 22 | # Clean and clear comma placement (same as default). 23 | commas: 24 | max-spaces-before: 0 25 | min-spaces-after: 1 26 | max-spaces-after: 1 27 | # Starting space not enforced (useful for commented out variables and code) 28 | comments: 29 | require-starting-space: false 30 | min-spaces-from-content: 2 31 | # Force proper indentation of comments 32 | comments-indentation: {} 33 | # Do not force document start and end markers 34 | document-end: disable 35 | document-start: 36 | present: true 37 | # Default 38 | empty-lines: 39 | max: 2 40 | max-start: 0 41 | max-end: 0 42 | # Clean list formatting (Default) 43 | hyphens: 44 | max-spaces-after: 1 45 | # Set spaces to 2 and force multi-line-strings to be indented. 46 | indentation: 47 | spaces: 2 48 | indent-sequences: true 49 | check-multi-line-strings: true 50 | # No key-duplicates allowed. Ansible will always choose last defined value. 51 | # Ambiguity is not desirable. 52 | key-duplicates: false 53 | # Max line-length 100. 54 | line-length: 55 | max: 100 56 | allow-non-breakable-words: true 57 | allow-non-breakable-inline-mappings: true 58 | new-line-at-end-of-file: enable 59 | new-lines: 60 | type: unix 61 | trailing-spaces: {} 62 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/installephemeris.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # this task installs ephemeris. It is used for installing tools and genomes. 18 | 19 | - name: Install required ephemeris package 20 | pip: 21 | name: "{{ galaxy_docker_ephemeris_package }}" 22 | state: present 23 | version: "{{ galaxy_docker_ephemeris_version }}" 24 | virtualenv: "{{galaxy_docker_docker_user_virtualenv}}" 25 | when: not galaxy_docker_ephemeris_from_git 26 | 27 | - name: Clean ephemeris git folder 28 | file: 29 | path: "{{galaxy_docker_ephemeris_dir}}" 30 | state: absent 31 | when: galaxy_docker_ephemeris_from_git 32 | 33 | - name: Install ephemeris repo 34 | git: 35 | repo: "{{galaxy_docker_ephemeris_repo}}" 36 | dest: "{{galaxy_docker_ephemeris_dir}}" 37 | version: "{{galaxy_docker_ephemeris_branch}}" 38 | when: galaxy_docker_ephemeris_from_git 39 | 40 | - name: Install ephemeris requirements 41 | pip: 42 | requirements: "{{galaxy_docker_ephemeris_dir}}/requirements.txt" 43 | state: present 44 | virtualenv: "{{galaxy_docker_docker_user_virtualenv}}" 45 | when: galaxy_docker_ephemeris_from_git 46 | 47 | - name: Install ephemeris from git repo 48 | command: "{{galaxy_docker_docker_user_virtualenv}}/bin/python setup.py install" 49 | args: 50 | chdir: "{{galaxy_docker_ephemeris_dir}}" 51 | when: galaxy_docker_ephemeris_from_git 52 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/setup_virtual_environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: make sure galaxy_venv directory exists 18 | file: 19 | path: "{{galaxy_docker_cluster_virtualenv}}" 20 | state: directory 21 | mode: "{{galaxy_docker_export_location_mode}}" 22 | when: galaxy_docker_cluster_virtualenv is defined 23 | 24 | - name: Create virtualenv 25 | pip: 26 | name: "pip>=8.1" 27 | virtualenv: "{{galaxy_docker_cluster_virtualenv}}" 28 | when: galaxy_docker_cluster_virtualenv is defined 29 | 30 | - name: Install pinned-requirements 31 | pip: 32 | requirements: "{{galaxy_docker_export_location}}/galaxy-central/lib/galaxy/dependencies/pinned-requirements.txt" 33 | virtualenv: "{{galaxy_docker_cluster_virtualenv}}" 34 | extra_args: >- 35 | --index-url https://wheels.galaxyproject.org/simple 36 | --extra-index-url https://pypi.org/simple/ 37 | when: galaxy_docker_cluster_virtualenv is defined 38 | 39 | - name: Add some conditional-requirements. 40 | pip: 41 | name: "{{item}}" 42 | virtualenv: "{{galaxy_docker_cluster_virtualenv}}" 43 | extra_args: > 44 | --index-url https://wheels.galaxyproject.org/simple 45 | --extra-index-url https://pypi.org/simple/ 46 | with_items: 47 | - "psycopg2==2.6.1" 48 | - "drmaa" 49 | - "uWSGI" 50 | - "watchdog" 51 | when: galaxy_docker_cluster_virtualenv is defined 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![Galaxy-launcher logo](docs/logo/galaxy-launcher-transparant-small.png "Launch your Galaxy!")galaxy-launcher 2 | 3 | Please read our documentation at: http://galaxy-launcher.readthedocs.io/ 4 | 5 | ## What is galaxy-launcher? 6 | galaxy-launcher is an ansible playbook directory containing all the roles to install the 7 | [bgruening/docker-galaxy-stable](https://github.com/bgruening/docker-galaxy-stable) 8 | image on a server running docker. 9 | 10 | It also contains a installdocker role to install docker on a Ubuntu or CentOS server. 11 | 12 | ## Why galaxy-launcher? 13 | Using the docker-galaxy-stable image simplifies running a galaxy server. 14 | However the container must be set-up using the exact settings you want. 15 | Doing this from the command line is cumbersome, and using a script is not scalable. 16 | 17 | galaxy-launcher uses the power of ansible to set up a galaxy instance using 18 | the docker-galaxy-stable image. It allows you to set all the necessary variables 19 | and start the galaxy instance with just two commands. 20 | 21 | ## Features 22 | * Complete deployment of a galaxy instance with just two commands. 23 | * Configuration in easy to understand yaml files. 24 | * Use the example host files to quickly get started 25 | * Use the cluster example host to get the image running on your cluster 26 | * Install prerequisites including docker on a Ubuntu or CentOS server 27 | * Automatic provisioning 28 | * The galaxy docker container is restarted on reboot of the system 29 | * Running the deployment script as a non-privileged user (root required for prerequisites script) 30 | 31 | ## Report issues 32 | Issues can be reported to our [github issue tracker](https://github.com/LUMC/galaxy-launcher/issues). 33 | Please check our known issues page first. 34 | 35 | ## License 36 | galaxy-launcher is free software available under the MIT License (Expat License). 37 | Check the license chapter in our documentation for more details. 38 | -------------------------------------------------------------------------------- /test/host_vars/cluster-test/cluster_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_docker_cluster_type: sge 3 | galaxy_docker_gridengine_master_host: "ogs-head" 4 | galaxy_docker_cluster_virtualenv: "{{galaxy_docker_shared_cluster_directory}}/galaxy_venv" 5 | #galaxy_docker_cluster_embed_metadata_in_job: False 6 | galaxy_docker_cluster_environment_variables: 7 | LC_ALL: "en_US.UTF-8" 8 | galaxy_docker_shared_cluster_directory: "/exports/galaxy" 9 | galaxy_docker_docker_user: galaxy_docker 10 | galaxy_docker_database_user: galaxy_db 11 | galaxy_docker_web_user: galaxy_web 12 | galaxy_docker_cluster_registered_user_concurrent_jobs: 2 13 | galaxy_docker_cluster_anonymous_user_concurrent_jobs: 1 14 | galaxy_docker_cluster_embed_metadata_in_job: True 15 | galaxy_docker_cluster_default_destination: cluster_low 16 | galaxy_docker_cluster_sge_parallel_environment: make 17 | galaxy_docker_cluster_sge_extra_options: "" 18 | galaxy_docker_cluster_destinations: 19 | cluster_low: 20 | cpu_count: 1 21 | memory: 4G 22 | extra_options: "" 23 | cluster_low_high_mem: 24 | cpu_count: 1 25 | memory: 16G 26 | extra_options: "" 27 | galaxy_docker_cluster_tool_destinations: 28 | cluster_low: 29 | - Filter1 30 | - ucsc_table_direct1 31 | cluster_low_high_mem: 32 | - ChangeCase 33 | galaxy_docker_cluster_tool_destination_configuration: 34 | trimmer: 35 | rules: 36 | - rule_type: file_size 37 | nice_value: 0 38 | lower_bound: 0 39 | upper_bound: 512 KB 40 | destination: local 41 | - rule_type: file_size 42 | nice_value: 0 43 | lower_bound: 4 MB 44 | upper_bound: infinity 45 | destination: cluster_low_high_mem 46 | galaxy_docker_cluster_user_destinations: 47 | admin@galaxy.org: 48 | priority: med 49 | 50 | galaxy_docker_custom_image_lines: 51 | - run sed -i '3iecho "192.168.99.100 ogs-head" >> /etc/hosts' /usr/bin/startup 52 | 53 | bgruening_galaxy_stable_version: 18.05 54 | -------------------------------------------------------------------------------- /roles/installdocker/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # This task decides wich sub-tasks should be run based on the boolean variables. 18 | # The order should represent the order in which tasks are ideally done. 19 | 20 | # tasks file for installdocker 21 | 22 | - name: Create docker default location 23 | file: 24 | state: directory 25 | path: "{{ installdocker_default_location }}" 26 | 27 | - name: Set symbolic link for default location 28 | file: 29 | state: link 30 | path: /var/lib/docker 31 | src: "{{ installdocker_default_location }}" 32 | when: "not installdocker_default_location=='/var/lib/docker'" 33 | 34 | # Distrospecific. Only disto. 35 | # ansible_distribution_version specific things should be handled down the line 36 | - name: Start distribution specific installation 37 | include_tasks: "{{role_path}}/tasks/distributions/{{ansible_distribution}}.yml" 38 | 39 | 40 | # General postinstall 41 | - name: install required python_packages 42 | package: 43 | name: "{{installdocker_python_packages}}" 44 | state: present 45 | 46 | - name: Install required PIP packages 47 | pip: 48 | name: "{{ installdocker_pip_packages }}" 49 | state: present 50 | 51 | - name: start docker service 52 | service: 53 | name: docker 54 | enabled: yes 55 | state: started 56 | notify: test docker service 57 | 58 | # Make sure docker installation is tested before other roles are started 59 | - meta: flush_handlers 60 | -------------------------------------------------------------------------------- /roles/installdocker/tasks/distributions/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Install Docker prerequisites 18 | yum: 19 | update_cache: yes 20 | pkg: "{{ item }}" 21 | state: present 22 | with_items: 23 | - yum-utils 24 | - device-mapper-persistent-data 25 | - lvm2 26 | - epel-release 27 | 28 | # No ansible module available 29 | - name: Enable extras repository 30 | command: yum-config-manager --enable extras 31 | tags: 32 | - skip_ansible_lint # Does not create a file? 33 | 34 | # An attempt was made to install the repository using yum_repository but this failed. 35 | - name: install repository using yum-config-manager 36 | command: "yum-config-manager --add-repo {{repo_url}}" 37 | args: 38 | creates: "/etc/yum.repos.d/{{repo_url | basename}}" 39 | vars: 40 | repo_url: https://download.docker.com/linux/centos/docker-ce.repo 41 | 42 | - name: Install gpg key 43 | rpm_key: 44 | key: "{{ installdocker_gpg_key}}" 45 | state: present 46 | 47 | 48 | #- name: Install Docker repository 49 | # yum_repository: 50 | # name: docker 51 | # baseurl: "https://download.docker.com/linux/centos/docker-ce.repo" 52 | # state: present 53 | # description: Docker Community Edition Repository 54 | # enabled: no 55 | # gpgkey: "{{docker_gpg_key}}" 56 | 57 | - name: Install Docker packages 58 | yum: 59 | pkg: "{{ installdocker_packages }}" 60 | state: present 61 | update_cache: yes 62 | notify: test docker service 63 | -------------------------------------------------------------------------------- /roles/installdocker/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | 34 | Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 35 | Contact us at: sasc@lumc.nl 36 | 37 | This file is part of galaxy-launcher. 38 | 39 | galaxy-launcher is free software: you can redistribute it 40 | and/or modify it under the terms of the MIT License (Expat) as 41 | published by the Open Source initiative. 42 | 43 | You should have received a copy of the MIT License (Expat) 44 | along with galaxy-launcher. If not, see 45 | . 46 | 47 | 48 | Author Information 49 | ------------------ 50 | 51 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 52 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/galaxywelcome.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # tasks file for galaxy_docker_template_welcome 18 | # This task: 19 | # - Deletes all existing welcome files from the export folder 20 | # - copies all new welcome html files to the export folder 21 | 22 | 23 | - name: Search old "welcome" files in the export folder 24 | find: 25 | paths: "{{galaxy_docker_export_location}}" 26 | patterns: "(?i)welcome.*" 27 | use_regex: True 28 | hidden: True 29 | recurse: no 30 | register: old_welcome_files 31 | 32 | - name: Show which welcome files will be deleted. 33 | debug: 34 | var: old_welcome_files 35 | verbosity: 1 36 | 37 | - name: Delete old "welcome" files in the export folder 38 | file: 39 | path: "{{item.path}}" 40 | state: absent 41 | with_items: 42 | - "{{old_welcome_files.files}}" 43 | 44 | - name: Search new "welcome" files in the welcome folder 45 | find: 46 | paths: "{{galaxy_docker_welcome_dir}}" 47 | patterns: "(?i)welcome.*" 48 | use_regex: True 49 | hidden: True 50 | recurse: yes 51 | delegate_to: 127.0.0.1 52 | become: no 53 | register: new_welcome_files 54 | 55 | - name: Show which welcome files will be copied 56 | debug: 57 | var: new_welcome_files 58 | verbosity: 1 59 | 60 | - name: Copy welcome files 61 | copy: 62 | mode: 0644 63 | dest: "{{galaxy_docker_export_location}}/{{item.path | basename | lower}}" 64 | src: "{{item.path}}" 65 | with_items: 66 | - "{{new_welcome_files.files}}" 67 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/prerequisites/galaxyfirewall.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # This task creates a firewall profile and enables it. 18 | # A profile was chosen because a profile can be cleanly disabled and deleted. 19 | # The alternative of programming ports directly in this yaml would be more messy when cleaning. 20 | 21 | - name: Install ufw firewall. 22 | package: 23 | name: ufw 24 | state: present 25 | 26 | - name: Copy profile to ufw firewall 27 | template: 28 | dest: "/etc/ufw/applications.d/{{galaxy_docker_ufw_profile}}" 29 | force: yes 30 | src: ufwgalaxyprofile.j2 31 | 32 | - name: Copy test_upgrade_galaxy profile to ufw firewall 33 | template: 34 | dest: "/etc/ufw/applications.d/{{galaxy_docker_test_ufw_profile}}" 35 | force: yes 36 | src: ufwtestgalaxyprofile.j2 37 | when: galaxy_docker_test_upgrade 38 | # Apparently sshrules are removed if OpenSSH rule is not enabled on Ubuntu 39 | # The remote machine will become unmanagable because ssh port will be closed 40 | # This rule prevents this behaviour. 41 | - name: set the firewall open for ssh 42 | ufw: 43 | rule: allow 44 | name: OpenSSH 45 | when: ansible_distribution == 'Ubuntu' 46 | 47 | - name: set the firewall open for Galaxy 48 | ufw: 49 | name: "{{galaxy_docker_ufw_profile}}" 50 | rule: allow 51 | state: enabled 52 | 53 | - name: set the firewall open for testgalaxy 54 | ufw: 55 | name: "{{galaxy_docker_test_ufw_profile}}" 56 | rule: allow 57 | state: enabled 58 | when: galaxy_docker_test_upgrade 59 | -------------------------------------------------------------------------------- /host_vars/cluster_example_host/galaxy_settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | #Required settings 3 | # Please uncomment and specify these values yourself 4 | 5 | # galaxy_admin_user: "example@example.nl" 6 | # galaxy_master_api_key: "8374uhiuy893749872302" #replace with your own key!! 7 | # galaxy_brand: "Instance of Galaxy" 8 | # galaxy_report_user: admin 9 | # galaxy_report_password: admin 10 | 11 | # optional settings 12 | galaxy_docker_optional_environment_settings: 13 | GALAXY_CONFIG_CONDA_AUTO_INSTALL: True 14 | GALAXY_CONFIG_CONDA_AUTO_INIT: True 15 | GALAXY_CONFIG_USE_CACHED_DEPENDENCY_MANAGER: True 16 | GALAXY_CONFIG_SANITIZE_ALL_HTML: True 17 | GALAXY_LOGGING: full 18 | NONUSE: proftp,condor,slurm,slurmctld 19 | SGE_ROOT: /var/lib/gridengine 20 | DRMAA_LIBRARY_PATH: /usr/lib/gridengine-drmaa/lib/libdrmaa.so.1.0 21 | GALAXY_CONFIG_OUTPUTS_TO_WORKING_DIRECTORY: True 22 | GALAXY_CONFIG_RETRY_JOB_OUTPUT_COLLECTION: 5 23 | 24 | # Set directories to cluster file system 25 | # The default as shown here works very well as long as galaxy_docker_export_location 26 | # is a subdirectory of galaxy_docker_shared_cluster_directory 27 | GALAXY_CONFIG_CLUSTER_FILES_DIRECTORY: "{{galaxy_docker_shared_cluster_directory}}/job_scripts" 28 | GALAXY_CONFIG_NEW_FILE_PATH: "{{galaxy_docker_shared_cluster_directory}}/tmp" 29 | GALAXY_CONFIG_TOOL_DEPENDENCY_DIR: "{{galaxy_docker_export_location}}/tool_deps" 30 | GALAXY_CONFIG_CONDA_PREFIX: "{{galaxy_docker_shared_cluster_directory}}/_conda" 31 | GALAXY_CONFIG_TOOL_DEPENDENCY_CACHE_DIR: "{{galaxy_docker_export_location}}/tool_deps/_cache" 32 | GALAXY_CONFIG_JOB_WORKING_DIRECTORY: "{{galaxy_docker_export_location}}/galaxy-central/database/job_working_directory" 33 | GALAXY_CONFIG_FILE_PATH: "{{galaxy_docker_export_location}}/galaxy-central/database/files" 34 | GALAXY_CONFIG_TOOL_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tools" 35 | GALAXY_CONFIG_TOOL_DATA_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tool-data" 36 | GALAXY_CONFIG_SHED_TOOL_DATA_PATH: "{{galaxy_docker_export_location}}/galaxy-central/tool-data" 37 | -------------------------------------------------------------------------------- /licenses/license_change.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Playbook uses https://github.com/rhpvorderman/ansible-role-license-changer 3 | - hosts: localhost 4 | become: no 5 | vars: 6 | project_dir: "{{playbook_dir}}/.." 7 | license_files: 8 | - regexp: ".ya?ml$" 9 | prefix: "# " 10 | suffix: "" 11 | after: "---" 12 | start: "# -----" 13 | end: "# ....." 14 | dir: "main.yml" 15 | - regexp: ".ya?ml$" 16 | prefix: "# " 17 | suffix: "" 18 | after: "---" 19 | start: "# -----" 20 | end: "# ....." 21 | dir: roles 22 | - regexp: ".ya?ml$" 23 | prefix: "# " 24 | suffix: "" 25 | after: "---" 26 | start: "# -----" 27 | end: "# ....." 28 | dir: run 29 | - regexp: ".j2$" 30 | prefix: !unsafe '{# ' 31 | suffix: !unsafe ' #}' 32 | before: BOF 33 | start: !unsafe '{# ----- #}' 34 | end: !unsafe '{# ..... #}' 35 | - regexp: "README.md" 36 | prefix: "" 37 | suffix: "" 38 | after: 'License\n-------' 39 | start: 40 | end: 41 | dir: roles 42 | tasks: 43 | - name: Run license changer on test files 44 | include_role: 45 | name: license-changer 46 | vars: 47 | license_changer_project_dir: "{{project_dir}}/{{license_item.dir | default('')}}" 48 | license_changer_project_file_regexp: "{{license_item.regexp}}" 49 | license_changer_header_prefix: "{{license_item.prefix}}" 50 | license_changer_header_suffix: "{{license_item.suffix}}" 51 | license_changer_header_start: "{{license_item.start}}" 52 | license_changer_header_end: "{{license_item.end}}" 53 | license_changer_header_before: "{{license_item.before | default (omit)}}" 54 | license_changer_header_after: "{{license_item.after | default(omit)}}" 55 | license_changer_strip_whitespace: "{{license_item.whitespace_strip | default(True)}}" 56 | license_changer_header_file: "{{project_dir}}/licenses/license_header.txt" 57 | with_items: "{{license_files}}" 58 | loop_control: 59 | loop_var: license_item 60 | -------------------------------------------------------------------------------- /test/docker/centos-7/Dockerfile: -------------------------------------------------------------------------------- 1 | # Adapted from https://docs.docker.com/engine/examples/running_ssh_service/ 2 | # And from https://hub.docker.com/_/centos/ for information on how to enable systemd 3 | FROM centos:7 4 | ENV SSH_USER=galaxy_ssh 5 | 6 | # SYSTEMD enable 7 | ENV container docker 8 | RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ 9 | systemd-tmpfiles-setup.service ] || rm -f $i; done); \ 10 | rm -f /lib/systemd/system/multi-user.target.wants/*;\ 11 | rm -f /etc/systemd/system/*.wants/*;\ 12 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ 13 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ 14 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ 15 | rm -f /lib/systemd/system/basic.target.wants/*;\ 16 | rm -f /lib/systemd/system/anaconda.target.wants/*; 17 | VOLUME [ "/sys/fs/cgroup" ] 18 | 19 | # Disable no login policy 20 | RUN rm -f usr/lib/tmpfiles.d/systemd-nologin.conf 21 | 22 | # Install SSH python and sudo 23 | RUN yum update -y && yum install -y openssh-server python sudo 24 | RUN mkdir /var/run/sshd 25 | RUN echo 'root:screencast' | chpasswd 26 | ADD files/sshd_config /etc/ssh/sshd_config 27 | 28 | # SSH login fix. Otherwise user is kicked off after login 29 | RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd 30 | 31 | ENV NOTVISIBLE "in users profile" 32 | RUN echo "export VISIBLE=now" >> /etc/profile 33 | 34 | # Add host keys 35 | RUN for type in rsa ecdsa ed25519 dsa ; do ssh-keygen -f "/etc/ssh/ssh_host_${type}_key" -N '' -t $type ; done 36 | # Add passwordless sudo user. 37 | RUN groupadd passwordless 38 | RUN useradd -d /home/$SSH_USER -m -p $SSH_USER -G wheel,passwordless -s /bin/bash $SSH_USER 39 | RUN echo "%passwordless ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers 40 | RUN echo "%sudo ALL=(ALL:ALL) ALL" >> /etc/sudoers 41 | 42 | USER $SSH_USER 43 | RUN mkdir $HOME/.ssh 44 | RUN chmod 700 $HOME/.ssh 45 | ADD files/galaxy_ssh.pub /home/$SSH_USER/galaxy_ssh.pub 46 | RUN cat $HOME/galaxy_ssh.pub >> $HOME/.ssh/authorized_keys 47 | RUN chmod 600 $HOME/.ssh/authorized_keys 48 | 49 | 50 | USER root 51 | 52 | EXPOSE 22 53 | RUN systemctl enable sshd.service 54 | CMD ["/usr/sbin/init"] 55 | #CMD ["/usr/sbin/sshd", "-D"] 56 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/start_provision_container.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # this task installs ephemeris. It is used for installing tools and genomes. 18 | 19 | - name: Create directory for ansible_generated vars 20 | file: 21 | path: "{{galaxy_docker_ansible_generated_vars_dir}}" 22 | state: directory 23 | become: no 24 | delegate_to: 127.0.0.1 25 | 26 | - name: Create file with volume settings 27 | template: 28 | dest: "{{galaxy_docker_ansible_generated_vars_dir}}/docker_volumes_provision.yml" 29 | src: "docker_volumes_provision.yml.j2" 30 | force: yes 31 | trim_blocks: False 32 | become: no 33 | delegate_to: 127.0.0.1 34 | 35 | - name: Include port and volume settings 36 | include_vars: "{{galaxy_docker_ansible_generated_vars_dir}}/docker_volumes_provision.yml" 37 | 38 | - name: Show volumes 39 | debug: 40 | var: docker_mounted_volumes 41 | verbosity: 1 42 | 43 | - name: Update docker environment file 44 | template: 45 | src: docker_environment_provision.j2 46 | dest: "{{galaxy_docker_environment_file_location}}" 47 | mode: 0600 48 | 49 | - name: Start the docker provision container 50 | docker_container: 51 | env_file: "{{galaxy_docker_environment_file_location}}" 52 | volumes: "{{docker_mounted_volumes}}" 53 | image: "{{galaxy_docker_docker_image}}" 54 | name: "{{galaxy_docker_provision_container_name}}" 55 | hostname: "{{galaxy_docker_container_hostname}}" 56 | published_ports: "127.0.0.1:{{galaxy_docker_provision_port}}:80" 57 | state: started 58 | restart: yes 59 | notify: check if provision galaxy has started 60 | 61 | - name: remove docker environment file 62 | file: 63 | state: absent 64 | path: "{{galaxy_docker_environment_file_location}}" 65 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/start_container/run.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create directory for ansible_generated vars 18 | file: 19 | path: "{{galaxy_docker_ansible_generated_vars_dir}}" 20 | state: directory 21 | become: no 22 | delegate_to: 127.0.0.1 23 | 24 | - name: Create file with port and volume settings 25 | template: 26 | dest: "{{galaxy_docker_ansible_generated_vars_dir}}/docker_ports_and_volumes.yml" 27 | src: "docker_ports_and_volumes.yml.j2" 28 | force: yes 29 | trim_blocks: False 30 | become: no 31 | delegate_to: 127.0.0.1 32 | 33 | - name: Include port and volume settings 34 | include_vars: "{{galaxy_docker_ansible_generated_vars_dir}}/docker_ports_and_volumes.yml" 35 | 36 | - name: Show docker published ports 37 | debug: 38 | var: galaxy_docker_published_ports 39 | verbosity: 1 40 | 41 | - name: Show volumes 42 | debug: 43 | var: docker_mounted_volumes 44 | verbosity: 1 45 | 46 | - name: Update docker environment file 47 | template: 48 | src: docker_environment_dict.j2 49 | dest: "{{galaxy_docker_environment_file_location}}" 50 | mode: 0600 51 | 52 | - name: Restart the docker container 53 | docker_container: 54 | env_file: "{{galaxy_docker_environment_file_location}}" 55 | volumes: "{{docker_mounted_volumes}}" 56 | image: "{{galaxy_docker_docker_image}}" 57 | name: "{{galaxy_docker_container_name}}" 58 | hostname: "{{galaxy_docker_container_hostname}}" 59 | published_ports: "{{galaxy_docker_published_ports}}" 60 | state: started 61 | restart: yes 62 | recreate: yes 63 | notify: check if galaxy has started 64 | 65 | - name: remove docker environment file 66 | file: 67 | state: absent 68 | path: "{{galaxy_docker_environment_file_location}}" 69 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/template_galaxy_settings/setup_cluster_general.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create cluster filesystem folders 18 | file: 19 | path: "{{item}}" 20 | state: directory 21 | with_items: 22 | - "{{galaxy_docker_optional_environment_settings.GALAXY_CONFIG_JOB_WORKING_DIRECTORY}}" 23 | - "{{galaxy_docker_optional_environment_settings.GALAXY_CONFIG_FILE_PATH}}" 24 | when: 25 | - galaxy_docker_optional_environment_settings.GALAXY_CONFIG_JOB_WORKING_DIRECTORY is defined 26 | - galaxy_docker_optional_environment_settings.GALAXY_CONFIG_FILE_PATH is defined 27 | 28 | - name: Create cluster filesystem new file path 29 | file: 30 | path: "{{galaxy_docker_optional_environment_settings.GALAXY_CONFIG_NEW_FILE_PATH}}" 31 | state: directory 32 | mode: 01770 33 | 34 | - name: Create job_conf.xml 35 | template: 36 | dest: "{{galaxy_docker_export_location}}/galaxy-central/config/job_conf.xml" 37 | src: "job_conf.xml.j2" 38 | force: yes 39 | trim_blocks: False 40 | 41 | - name: Create tool_destinations.yml 42 | template: 43 | dest: "{{galaxy_docker_export_location}}/galaxy-central/config/tool_destinations.yml" 44 | src: "tool_destinations.yml.j2" 45 | force: yes 46 | trim_blocks: False 47 | 48 | - name: Edit shed_tool_conf.xml to contain the right tool shed location 49 | lineinfile: 50 | backrefs: yes 51 | backup: yes 52 | state: present 53 | regexp: '()' 54 | line: '\1{{galaxy_docker_export_location}}/shed_tools\3' 55 | path: "{{galaxy_docker_export_location}}/galaxy-central/config/shed_tool_conf.xml" 56 | 57 | - name: Create environment setup file 58 | template: 59 | dest: "{{galaxy_docker_export_location}}/environment_setup_file.sh" 60 | src: "environment_setup_file.sh.j2" 61 | force: yes 62 | -------------------------------------------------------------------------------- /test/variables/cluster-test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Create directory for cluster config script" 4 | script_dir=${project_root}/test/CI/files/$hostname/setup 5 | mkdir -p $script_dir 6 | 7 | echo "create config script" 8 | galaxy_hostname=galaxy-docker 9 | galaxy_ip=172.17.0.3 #Very ugly. But the container IP needs to be guessed. 10 | echo " 11 | #!/bin/bash 12 | echo $galaxy_ip $galaxy_hostname >> /etc/hosts 13 | su sgeadmin 14 | qconf -as $galaxy_hostname 15 | " > $script_dir/setup.sh 16 | chmod 775 $script_dir/setup.sh 17 | 18 | echo "start cluster container" 19 | cluster_image_name=cluster 20 | docker build -t $cluster_image_name $project_root/test/docker/gridengine-cluster 21 | CLUSTER_ID=`docker run -d -v ${script_dir}:/scripts --volumes-from $CONTAINER_NAME $cluster_image_name` 22 | CLUSTER_IP=`docker inspect -f {{.NetworkSettings.IPAddress}} $CLUSTER_ID` 23 | CLUSTER_NAME=`docker exec $CLUSTER_ID cat /etc/hostname` 24 | sleep 15 25 | docker exec $CLUSTER_ID bash /scripts/setup.sh 26 | 27 | ansible_playbook_extra_settings="\ 28 | galaxy_docker_container_name: galaxy_${hostname} 29 | galaxy_docker_extract_database_dir: ${export_volume}/import_db/ 30 | galaxy_docker_import_db_dir: ${export_volume}/import_db/ 31 | galaxy_docker_shared_cluster_directory: ${export_folder} 32 | galaxy_docker_web_port_public: 8081 33 | galaxy_docker_web_port: 8080 34 | galaxy_docker_ansible_generated_vars_dir: ${export_volume} 35 | galaxy_docker_empty_database_script: ${export_volume}/new_empty_db 36 | galaxy_docker_imported_db_location: ${export_volume}/database/ 37 | galaxy_docker_container_hostname: $galaxy_hostname 38 | galaxy_docker_upgrade_test_settings: 39 | galaxy_docker_docker_image: 'cluster-galaxy-stable:18.05' 40 | galaxy_docker_container_name: test_upgrade_galaxy 41 | galaxy_docker_shared_cluster_directory: ${export_volume}/test_upgrade 42 | galaxy_docker_ufw_profile: test_upgrade_galaxy 43 | galaxy_docker_web_port: 8888 44 | galaxy_docker_web_port_public: 8880 45 | galaxy_docker_sftp_port: 8823 46 | galaxy_brand: Test upgrade of Galaxy to 18.05 47 | 48 | galaxy_docker_cluster_sge_parallel_environment: batch 49 | galaxy_docker_gridengine_master_host: $CLUSTER_NAME 50 | galaxy_docker_custom_image_lines: 51 | - run sed -i '3iecho \"$CLUSTER_IP $CLUSTER_NAME\" >> /etc/hosts' /usr/bin/startup 52 | bgruening_galaxy_stable_version: 18.05 53 | " 54 | ansible_playbook_run_commands="\ 55 | install_galaxy_cluster \ 56 | upgrade_cluster \ 57 | patch_custom_image \ 58 | " 59 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/docker_ports_and_volumes.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | {# ----- #} 3 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 4 | {# Contact us at: sasc@lumc.nl #} 5 | {# #} 6 | {# This file is part of galaxy-launcher. #} 7 | {# #} 8 | {# galaxy-launcher is free software: you can redistribute it #} 9 | {# and/or modify it under the terms of the MIT License (Expat) as #} 10 | {# published by the Open Source initiative. #} 11 | {# #} 12 | {# You should have received a copy of the MIT License (Expat) #} 13 | {# along with galaxy-launcher. If not, see #} 14 | {# . #} 15 | {# ..... #} 16 | {{ansible_managed | comment}} 17 | 18 | # galaxy-launcher generates these values to run the docker container. 19 | 20 | galaxy_docker_published_ports: 21 | {% if galaxy_docker_web_port is defined and galaxy_docker_web_port !='' %} 22 | - "127.0.0.1:{{galaxy_docker_web_port}}:80" 23 | {% endif %} 24 | {% if galaxy_docker_ftp_port is defined and galaxy_docker_ftp_port !='' %} 25 | - "{% if not galaxy_docker_ftp_port_expose %}127.0.0.1:{% endif %}{{galaxy_docker_ftp_port}}:21" 26 | {% endif %} 27 | {% if galaxy_docker_sftp_port is defined and galaxy_docker_sftp_port !='' %} 28 | - "{% if not galaxy_docker_sftp_port_expose %}127.0.0.1:{% endif %}{{galaxy_docker_sftp_port}}:22" 29 | {% endif %} 30 | {% if galaxy_docker_extra_ports is defined and galaxy_docker_extra_ports !='' %} 31 | {% for extra_port in galaxy_docker_extra_ports %} 32 | - "{{extra_port}}" 33 | {% endfor %} 34 | {% endif %} 35 | docker_mounted_volumes: 36 | - "{{galaxy_docker_export_location}}:/export/" 37 | {% if galaxy_docker_shared_cluster_directory is defined%} 38 | - "{{galaxy_docker_shared_cluster_directory}}:{{galaxy_docker_shared_cluster_directory}}" 39 | {% endif %} 40 | {% if galaxy_docker_extra_volumes is defined and galaxy_docker_extra_volumes !='' %} 41 | {% for extra_volume in galaxy_docker_extra_volumes %} 42 | - "{{extra_volume}}" 43 | {% endfor %} 44 | {% endif %} 45 | # {% if galaxy_docker_cluster_virtualenv is defined%} 46 | # - "{{galaxy_docker_cluster_virtualenv}}:/galaxy_venv" 47 | # - "{{galaxy_docker_cluster_virtualenv}}:{{galaxy_docker_cluster_virtualenv}}" 48 | # {% endif %} 49 | # {% if galaxy_docker_optional_environment_settings.SGE_ROOT is defined%} 50 | # - "{{galaxy_docker_optional_environment_settings.SGE_ROOT}}:{{galaxy_docker_optional_environment_settings.SGE_ROOT}}" 51 | # {% endif %} 52 | ... 53 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/upgrade/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # Tasks for testing migration 18 | 19 | #- name: copy running instance files to test location 20 | # copy module is not used because remote_src does not support recursive copying. 21 | # Please enable the module if it is supported in future versions of anisble 22 | # copy: 23 | # remote_src: True 24 | 25 | - name: Create test location directory 26 | file: 27 | path: "{{galaxy_docker_upgrade_test_settings.galaxy_docker_export_location}}" 28 | state: "directory" 29 | mode: "{{galaxy_docker_export_location_mode}}" 30 | 31 | - name: create subfolders 32 | file: 33 | state: directory 34 | path: "{{galaxy_docker_upgrade_test_settings.galaxy_docker_export_location}}/{{item.dest}}" 35 | mode: "{{item.mode | default(omit)}}" 36 | with_items: 37 | - src: "galaxy-central/config" 38 | dest: "galaxy-central" 39 | - src: "postgresql" 40 | dest: "" 41 | mode: "0775" 42 | 43 | - name: Copy running instance files to test location 44 | command: "cp -p -R {{src}} {{dest}}" 45 | args: 46 | creates: "{{dest}}" 47 | vars: 48 | src: "{{galaxy_docker_export_location}}/{{item.src}}" 49 | dest: "{{galaxy_docker_upgrade_test_settings.galaxy_docker_export_location}}/{{item.dest}}" 50 | with_items: 51 | - src: "galaxy-central/config" 52 | dest: "galaxy-central" 53 | 54 | - import_tasks: copy_database.yml 55 | become: "{{galaxy_docker_become}}" 56 | become_user: "{{galaxy_docker_database_user}}" 57 | vars: 58 | ansible_user: "{{galaxy_docker_database_ssh_user}}" 59 | ansible_ssh_private_key_file: "{{galaxy_docker_database_user_private_key}}" 60 | 61 | - name: Set test upgrade parameters for the docker container 62 | set_fact: 63 | "{{item.key}}": "{{item.value}}" 64 | with_dict: "{{galaxy_docker_upgrade_test_settings}}" 65 | 66 | - name: Set container defaults succesfull? 67 | debug: 68 | var: galaxy_brand 69 | verbosity: 1 70 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/backupscript.sh.j2: -------------------------------------------------------------------------------- 1 | {# ----- #} 2 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 3 | {# Contact us at: sasc@lumc.nl #} 4 | {# #} 5 | {# This file is part of galaxy-launcher. #} 6 | {# #} 7 | {# galaxy-launcher is free software: you can redistribute it #} 8 | {# and/or modify it under the terms of the MIT License (Expat) as #} 9 | {# published by the Open Source initiative. #} 10 | {# #} 11 | {# You should have received a copy of the MIT License (Expat) #} 12 | {# along with galaxy-launcher. If not, see #} 13 | {# . #} 14 | {# ..... #} 15 | {# #} 16 | #!/bin/bash 17 | set -eu -o pipefail 18 | 19 | timestamp(){ 20 | {{galaxy_docker_backup_cron_log_timestamp}} 21 | } 22 | 23 | echo "$(timestamp) === START {{name.upper()}} BACKUP OF GALAXY ===" 24 | 25 | galaxy_docker_database_user="{{galaxy_docker_database_user_id}}" 26 | galaxy_docker_container_name="{{galaxy_docker_container_name}}" 27 | galaxy_docker_container_database_name="{{galaxy_docker_container_database_name}}" 28 | backup_db_location="{{backup_db_location}}" 29 | backup_db_dump_file="{{backup_db_dump_file}}" 30 | files_to_keep="{{files_to_keep}}" 31 | compression_level="{{compression_level}}" 32 | db_format="{{galaxy_docker_db_format}}" 33 | echo -n "$(timestamp) Dump the databse to $backup_db_location/$backup_db_dump_file ... " 34 | touch $backup_db_location/$backup_db_dump_file 35 | chmod 0600 $backup_db_location/$backup_db_dump_file 36 | docker exec -u $galaxy_docker_database_user $galaxy_docker_container_name \ 37 | bash -c "pg_dump $galaxy_docker_container_database_name --format=$db_format -Z $compression_level" >> $backup_db_location/$backup_db_dump_file 38 | echo "done" 39 | 40 | echo "$(timestamp) A maximum of $files_to_keep files will be kept in $backup_db_location. Looking for redundant files." 41 | 42 | old_files="$(ls -Atp $backup_db_location | grep -v '/$' | tail -n +$(($files_to_keep + 1)) )" 43 | number_of_files="$(ls -Atp $backup_db_location | grep -v '/$' | wc -l )" 44 | 45 | if [ "$(($number_of_files - $files_to_keep))" -gt "0" ] 46 | then 47 | echo "$(timestamp) More than $files_to_keep files found. Oldest files will be removed." 48 | for file in $old_files 49 | do 50 | echo -n "$(timestamp) Removing $file ... " 51 | rm -f "$backup_db_location/$file" 52 | echo "done" 53 | done 54 | else 55 | echo "$(timestamp) Not more than $files_to_keep files found. Skip cleanup." 56 | fi 57 | 58 | echo "$(timestamp) === BACKUP COMPLETED SUCCESSFULLY ===" 59 | -------------------------------------------------------------------------------- /test/variables/cluster-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Create directory for cluster config script" 4 | script_dir=${project_root}/test/CI/files/$hostname/setup 5 | mkdir -p $script_dir 6 | 7 | echo "create config script" 8 | galaxy_hostname=galaxy-docker 9 | galaxy_ip=172.17.0.3 #Very ugly. But the container IP needs to be guessed. 10 | echo " 11 | #!/bin/bash 12 | echo $galaxy_ip $galaxy_hostname >> /etc/hosts 13 | su sgeadmin 14 | qconf -as $galaxy_hostname 15 | " > $script_dir/setup.sh 16 | chmod 775 $script_dir/setup.sh 17 | 18 | echo "start cluster container" 19 | cluster_image_name=cluster 20 | docker build -t $cluster_image_name $project_root/test/docker/gridengine-cluster 21 | CLUSTER_ID=`docker run -d -v ${script_dir}:/scripts --volumes-from $CONTAINER_NAME $cluster_image_name` 22 | CLUSTER_IP=`docker inspect -f {{.NetworkSettings.IPAddress}} $CLUSTER_ID` 23 | CLUSTER_NAME=`docker exec $CLUSTER_ID cat /etc/hostname` 24 | sleep 15 25 | docker exec $CLUSTER_ID bash /scripts/setup.sh 26 | 27 | ansible_playbook_extra_settings="\ 28 | galaxy_docker_container_name: galaxy_${hostname} 29 | galaxy_docker_extract_database_dir: ${export_volume}/import_db/ 30 | galaxy_docker_import_db_dir: ${export_volume}/import_db/ 31 | galaxy_docker_shared_cluster_directory: ${export_folder} 32 | galaxy_docker_web_port_public: 8081 33 | galaxy_docker_web_port: 8080 34 | galaxy_docker_ansible_generated_vars_dir: ${export_volume} 35 | galaxy_docker_empty_database_script: ${export_volume}/new_empty_db 36 | galaxy_docker_imported_db_location: ${export_volume}/database/ 37 | galaxy_docker_container_hostname: $galaxy_hostname 38 | galaxy_docker_upgrade_test_settings: 39 | galaxy_docker_docker_image: 'cluster-galaxy-stable:18.05' 40 | galaxy_docker_container_name: test_upgrade_galaxy 41 | galaxy_docker_shared_cluster_directory: ${export_volume}/test_upgrade 42 | galaxy_docker_ufw_profile: test_upgrade_galaxy 43 | galaxy_docker_web_port: 8888 44 | galaxy_docker_web_port_public: 8880 45 | galaxy_docker_sftp_port: 8823 46 | galaxy_brand: Test upgrade of Galaxy to 18.05 47 | 48 | galaxy_docker_cluster_sge_parallel_environment: batch 49 | galaxy_docker_gridengine_master_host: $CLUSTER_NAME 50 | galaxy_docker_custom_image_lines: 51 | - run sed -i '3iecho \"$CLUSTER_IP $CLUSTER_NAME\" >> /etc/hosts' /usr/bin/startup 52 | bgruening_galaxy_stable_version: 18.05 53 | " 54 | ansible_playbook_run_commands="\ 55 | install_galaxy_cluster \ 56 | enable_ldap \ 57 | cron_database_backup \ 58 | extract_database \ 59 | import_database \ 60 | ['install_tools','install_genomes'] \ 61 | delete_galaxy_complete \ 62 | " 63 | -------------------------------------------------------------------------------- /roles/installdocker/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | galaxy_info: 18 | author: Sequencing Analysis Support Core 19 | description: Installs docker and docker-py 20 | company: Leiden University Medical Center 21 | 22 | # If the issue tracker for your role is not on github, uncomment the 23 | # next line and provide a value 24 | # issue_tracker_url: http://example.com/issue/tracker 25 | 26 | # Some suggested licenses: 27 | # - BSD (default) 28 | # - MIT 29 | # - GPLv2 30 | # - GPLv3 31 | # - Apache 32 | # - CC-BY 33 | license: MIT License (expat) 34 | min_ansible_version: 2.4 35 | 36 | # If this a Container Enabled role, provide the minimum Ansible Container version. 37 | # min_ansible_container_version: 38 | 39 | # Optionally specify the branch Galaxy will use when accessing the GitHub 40 | # repo for this role. During role install, if no tags are available, 41 | # Galaxy will use this branch. During import Galaxy will access files on 42 | # this branch. If Travis integration is configured, only notifications for this 43 | # branch will be accepted. Otherwise, in all cases, the repo's default branch 44 | # (usually master) will be used. 45 | #github_branch: 46 | 47 | # 48 | # platforms is a list of platforms, and each platform has a name and a list of versions. 49 | # 50 | platforms: 51 | - name: Ubuntu 52 | versions: 53 | - 16.04 54 | 55 | # - name: Fedora 56 | # versions: 57 | # - all 58 | # - 25 59 | # - name: SomePlatform 60 | # versions: 61 | # - all 62 | # - 1.0 63 | # - 7 64 | # - 99.99 65 | 66 | galaxy_tags: [] 67 | # List tags for your role here, one per line. A tag is a keyword that describes 68 | # and categorizes the role. Users find roles by searching for tags. Be sure to 69 | # remove the '[]' above, if you add tags to this list. 70 | # 71 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 72 | # Maximum 20 tags per role. 73 | 74 | dependencies: [] 75 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 76 | # if you add dependencies to this list. 77 | -------------------------------------------------------------------------------- /docs/tutorial/tutorial.md: -------------------------------------------------------------------------------- 1 | # Tutorial 2 | 3 | ## Prerequisites 4 | 5 | * A computer running GNU/Linux 6 | * install [Vagrant](https://www.vagrantup.com/) 7 | * install [VirtualBox](https://www.virtualbox.org/) 8 | * Set up the prerequisites as described in the [installation chapter](../user_guide/installation.md). 9 | 10 | ## Create a host to test on 11 | 1. go to the galaxy-launcher repository 12 | 2. go to `test/vagrant/ubuntu-16.04` 13 | 3. Type `vagrant up` 14 | 4. go to the galaxy-launcher repository 15 | 5. copy the `hosts.sample` file to host 16 | 17 | Exercise: Set up your own hosts file. Use `test/hosts` as an example. 18 | 19 | 6. Check if you can reach the host by `ansible -m ping HOSTNAME` (insert your own hostname here) 20 | 21 | ## Create the settings files for your host. 22 | 1. copy `files/example_host` to `files/HOSTNAME` 23 | 2. copy `host_vars/example_host` to `host_vars/HOSTNAME` 24 | 3. Uncomment the commented out variables in `host_vars/HOSTNAME/galaxy_settings.yml` and change them to your preferred settings. 25 | 4. Use the guide on [Björn Grünings page](https://github.com/bgruening/docker-galaxy-stable#Galaxys-config-settings) to add some settings to your galaxy that you like in `galaxy_docker_optional_environment_settings`. 26 | 5. Change the version of the docker image to 18.05 or whatever version you like in `host_vars/HOSTNAME/docker_settings.yml` 27 | 6. Install the prerequisites on your test vm by running `ansible-playbook main.yml -e "host=HOSTNAME run=install_prerequisites"`. 28 | 7. Install galaxy on your test VM by running `ansible-playbook main.yml -e "host=HOSTNAME run=install_galaxy"`. 29 | 8. Galaxy should now be accessible on [localhost:8081](http://localhost:8081) 30 | 31 | ## Provision your galaxy 32 | 33 | ### Tools 34 | Exercise: go to `files/example_host/tool/tool_list.yaml.sample` and use this as an example to create your own `tool_list.yaml`. Include at least one data manager tool. 35 | 36 | Tools can be installed by running `ansible-playbook main.yml -e "host=HOSTNAME run=install_tools"`. 37 | 38 | ### Genomes 39 | Exercise: go to `files/example_host/dbkeys/dbkeys.yaml.sample` and use this as an example to create your own `dbkeys.yaml`. 40 | 41 | Genomes can be installed by running `ansible-playbook main.yml -e "host=HOSTNAME run=install_genomes galaxy_admin_api_key=YOURADMINAPIKEY"`. You have to create an api key yourself first in the galaxy instance. Make sure it is mapped to a user with admin rights. 42 | 43 | ## Upgrading your galaxy 44 | Exercise: 45 | Using the manual: 46 | * See if you can start a new fresh galaxy instance with an older bgruening/galaxy-stable version. 47 | * Upgrade this to a newer version of bgruening/galaxy-stable. 48 | -------------------------------------------------------------------------------- /test/files/test/welcome/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |

Hello, your Galaxy Docker container is running!

13 | To customize this page you can create a welcome.html page in your directory mounted to /export. 14 | 15 |
16 | Configuring Galaxy » 17 | Installing Tools » 18 | Guided Tour » 19 |
20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 |

31 | 32 | Galaxy is an open platform for supporting data intensive 33 | research. Galaxy is developed by The Galaxy Team 34 | with the support of many contributors. 35 | The Galaxy Docker project is supported by the University of Freiburg, part of de.NBI. 36 |

37 | 38 | 46 | 47 |
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /files/example_host/welcome/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |

Hello, your Galaxy Docker container is running!

13 | To customize this page you can create a welcome.html page in your directory mounted to /export. 14 | 15 |
16 | Configuring Galaxy » 17 | Installing Tools » 18 | Guided Tour » 19 |
20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 |
29 | 30 |

31 | 32 | Galaxy is an open platform for supporting data intensive 33 | research. Galaxy is developed by The Galaxy Team 34 | with the support of many contributors. 35 | The Galaxy Docker project is supported by the University of Freiburg, part of de.NBI. 36 |

37 | 38 | 46 | 47 |
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/container_running_check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | # this task installs ephemeris. It is used for installing tools and genomes. 18 | 19 | - name: register whether the production container is running 20 | command: "docker ps -q -f name={{galaxy_docker_container_name}}$" 21 | register: production_container_running 22 | changed_when: false 23 | 24 | - name: register whether the docker provision container is running 25 | command: "docker ps -q -f name={{galaxy_docker_provision_container_name}}$" 26 | register: provision_container_running 27 | changed_when: false 28 | 29 | - name: Show docker inspection results 30 | debug: 31 | var: production_container_running 32 | verbosity: 1 33 | when: production_container_running 34 | 35 | - name: Show docker inspection results 36 | debug: 37 | var: provision_container_running 38 | verbosity: 1 39 | when: provision_container_running 40 | 41 | - import_tasks: start_provision_container.yml 42 | when: 43 | - production_container_running is defined 44 | - provision_container_running is defined 45 | - production_container_running.stdout == '' 46 | - provision_container_running.stdout == '' 47 | 48 | - name: Set provision key when starting provision container 49 | set_fact: 50 | galaxy_admin_api_key: "{{galaxy_docker_provision_key}}" 51 | when: 52 | - production_container_running is defined 53 | - not production_container_running.stdout !='' 54 | 55 | - name: Use public web port for provisioning when running production container 56 | set_fact: 57 | galaxy_docker_provision_port: "{{galaxy_docker_web_port}}" 58 | when: 59 | - production_container_running is defined 60 | - production_container_running.stdout !='' 61 | 62 | - name: Activate handler to check if provision galaxy has started 63 | command: echo this always reports as changed 64 | notify: check if provision galaxy has started 65 | when: 66 | - not production_container_running.stdout !='' 67 | 68 | - name: Activate handler to check if production galaxy has a working galaxy 69 | command: echo this always reports as changed 70 | notify: check if galaxy has started 71 | when: 72 | - production_container_running.stdout !='' 73 | 74 | - meta: flush_handlers 75 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/installtools.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Make sure tool directory exists 18 | file: 19 | path: "{{galaxy_docker_tool_dir}}" 20 | state: directory 21 | 22 | - name: Find yml files in tool list directory 23 | find: 24 | paths: "{{galaxy_docker_tool_list_dir}}" 25 | patterns: 26 | - "*.yml" 27 | - "*.yaml" 28 | register: tools 29 | delegate_to: 127.0.0.1 30 | become: no 31 | 32 | - name: Show which yamls will be transferred 33 | debug: 34 | var: tools 35 | verbosity: 1 36 | 37 | - name: Move tools to galaxy server 38 | copy: 39 | dest: "{{galaxy_docker_tool_dir}}/{{item.path | basename}}" 40 | src: "{{item.path}}" 41 | force: yes 42 | mode: 0600 43 | with_items: 44 | - "{{tools.files}}" 45 | 46 | - name: delete api key from files 47 | lineinfile: 48 | destfile: "{{galaxy_docker_tool_dir}}/{{item.path | basename}}" 49 | regexp: "api_key:.*" 50 | state: absent 51 | with_items: 52 | - "{{tools.files}}" 53 | 54 | - name: delete galaxy_instance from files 55 | lineinfile: 56 | destfile: "{{galaxy_docker_tool_dir}}/{{item.path | basename}}" 57 | regexp: "galaxy_instance:.*" 58 | state: absent 59 | with_items: 60 | - "{{tools.files}}" 61 | 62 | - name: Use ephemeris shed-tools install to install tools 63 | command: >- 64 | {{galaxy_docker_docker_user_virtualenv}}/bin/shed-tools 65 | install 66 | -g http://localhost:{{galaxy_docker_provision_port}} 67 | -a {{galaxy_admin_api_key | default(galaxy_master_api_key)}} 68 | -t {{galaxy_docker_tool_dir}}/{{item.path | basename}} 69 | with_items: "{{tools.files}}" 70 | ignore_errors: "{{galaxy_docker_ephemeris_ignore_errors}}" 71 | tags: 72 | - skip_ansible_lint # does not create files. 73 | register: galaxy_docker_ephemeris_shed_tools 74 | 75 | - name: Fail when shed-tools did not succeed 76 | fail: 77 | msg: shed-tools did not have exit code 0 78 | when: 79 | - not galaxy_docker_ephemeris_ignore_errors 80 | - galaxy_docker_ephemeris_shed_tools.get("failed", False) 81 | 82 | - name: remove added files 83 | file: 84 | path: "{{galaxy_docker_tool_dir}}/{{item.path | basename}}" 85 | state: absent 86 | with_items: 87 | - "{{tools.files}}" 88 | -------------------------------------------------------------------------------- /roles/galaxy-docker/templates/auth_conf.xml.j2: -------------------------------------------------------------------------------- 1 | 2 | {# ----- #} 3 | {# Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center #} 4 | {# Contact us at: sasc@lumc.nl #} 5 | {# #} 6 | {# This file is part of galaxy-launcher. #} 7 | {# #} 8 | {# galaxy-launcher is free software: you can redistribute it #} 9 | {# and/or modify it under the terms of the MIT License (Expat) as #} 10 | {# published by the Open Source initiative. #} 11 | {# #} 12 | {# You should have received a copy of the MIT License (Expat) #} 13 | {# along with galaxy-launcher. If not, see #} 14 | {# . #} 15 | {# ..... #} 16 | 17 | 18 | ldap 19 | '{email}'.endswith('{{ galaxy_docker_ldap_config.email_suffix | default('')}}') 20 | 21 | {{galaxy_docker_ldap_config.allow_register | default('True')}} 22 | {{galaxy_docker_ldap_config.auto_register|default('False')}} 23 | {{galaxy_docker_ldap_config.allow_password_change|default('False')}} 24 | 25 | {{galaxy_docker_ldap_config.server}} 26 | {% if galaxy_docker_ldap_config.options is defined %} 27 | {{galaxy_docker_ldap_config.options}} 28 | {% endif %} 29 | {{galaxy_docker_ldap_config.login_use_username| default('False')}} 30 | {{galaxy_docker_ldap_config.continue_on_failure | default('False')}} 31 | 32 | sAMAccountName,mail 33 | {{galaxy_docker_ldap_config.search_base}} 34 | 35 | {% if galaxy_docker_ldap_config.login_use_username %} 36 | (&(objectClass=user)(sAMAccountName={username})) 37 | {% else %} 38 | (&(objectClass=user)(mail={email})) 39 | {% endif %} 40 | 41 | 42 | {{galaxy_docker_ldap_config.search_user}}@{{galaxy_docker_ldap_config.server | regex_replace('(ldap:\/\/)([a-zA-Z0-9.\/]*)(:?[0-9]*)','\\2')}} 43 | {{galaxy_docker_ldap_config.search_password}} 44 | 45 | {sAMAccountName}@{{galaxy_docker_ldap_config.server | regex_replace('(ldap:\/\/)([a-zA-Z0-9.\/]*)(:?[0-9]*)','\\2')}} 46 | {password} 47 | {sAMAccountName} 48 | {mail} 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /test/docker/cluster-test2/files/sshd_config: -------------------------------------------------------------------------------- 1 | # Package generated configuration file 2 | # See the sshd_config(5) manpage for details 3 | 4 | # What ports, IPs and protocols we listen for 5 | Port 8822 6 | # Use these options to restrict which interfaces/protocols sshd will bind to 7 | #ListenAddress :: 8 | #ListenAddress 0.0.0.0 9 | Protocol 2 10 | # HostKeys for protocol version 2 11 | HostKey /etc/ssh/ssh_host_rsa_key 12 | HostKey /etc/ssh/ssh_host_dsa_key 13 | HostKey /etc/ssh/ssh_host_ecdsa_key 14 | HostKey /etc/ssh/ssh_host_ed25519_key 15 | #Privilege Separation is turned on for security 16 | UsePrivilegeSeparation yes 17 | 18 | # Lifetime and size of ephemeral version 1 server key 19 | KeyRegenerationInterval 3600 20 | ServerKeyBits 1024 21 | 22 | # Logging 23 | SyslogFacility AUTH 24 | LogLevel INFO 25 | 26 | # Authentication: 27 | LoginGraceTime 120 28 | PermitRootLogin no 29 | StrictModes yes 30 | 31 | RSAAuthentication yes 32 | PubkeyAuthentication yes 33 | #AuthorizedKeysFile %h/.ssh/authorized_keys 34 | 35 | # Don't read the user's ~/.rhosts and ~/.shosts files 36 | IgnoreRhosts yes 37 | # For this to work you will also need host keys in /etc/ssh_known_hosts 38 | RhostsRSAAuthentication no 39 | # similar for protocol version 2 40 | HostbasedAuthentication no 41 | # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication 42 | #IgnoreUserKnownHosts yes 43 | 44 | # To enable empty passwords, change to yes (NOT RECOMMENDED) 45 | PermitEmptyPasswords no 46 | 47 | # Change to yes to enable challenge-response passwords (beware issues with 48 | # some PAM modules and threads) 49 | ChallengeResponseAuthentication no 50 | 51 | # Change to no to disable tunnelled clear text passwords 52 | PasswordAuthentication no 53 | 54 | # Kerberos options 55 | #KerberosAuthentication no 56 | #KerberosGetAFSToken no 57 | #KerberosOrLocalPasswd yes 58 | #KerberosTicketCleanup yes 59 | 60 | # GSSAPI options 61 | #GSSAPIAuthentication no 62 | #GSSAPICleanupCredentials yes 63 | 64 | X11Forwarding yes 65 | X11DisplayOffset 10 66 | PrintMotd no 67 | PrintLastLog yes 68 | TCPKeepAlive yes 69 | #UseLogin no 70 | 71 | #MaxStartups 10:30:60 72 | #Banner /etc/issue.net 73 | 74 | # Allow client to pass locale environment variables 75 | AcceptEnv LANG LC_* 76 | 77 | Subsystem sftp /usr/lib/openssh/sftp-server 78 | 79 | # Set this to 'yes' to enable PAM authentication, account processing, 80 | # and session processing. If this is enabled, PAM authentication will 81 | # be allowed through the ChallengeResponseAuthentication and 82 | # PasswordAuthentication. Depending on your PAM configuration, 83 | # PAM authentication via ChallengeResponseAuthentication may bypass 84 | # the setting of "PermitRootLogin without-password". 85 | # If you just want the PAM account and session checks to run without 86 | # PAM authentication, then enable this but set PasswordAuthentication 87 | # and ChallengeResponseAuthentication to 'no'. 88 | UsePAM yes 89 | -------------------------------------------------------------------------------- /test/docker/ubuntu-16.04/files/sshd_config: -------------------------------------------------------------------------------- 1 | # Package generated configuration file 2 | # See the sshd_config(5) manpage for details 3 | 4 | # What ports, IPs and protocols we listen for 5 | Port 8822 6 | # Use these options to restrict which interfaces/protocols sshd will bind to 7 | #ListenAddress :: 8 | #ListenAddress 0.0.0.0 9 | Protocol 2 10 | # HostKeys for protocol version 2 11 | HostKey /etc/ssh/ssh_host_rsa_key 12 | HostKey /etc/ssh/ssh_host_dsa_key 13 | HostKey /etc/ssh/ssh_host_ecdsa_key 14 | HostKey /etc/ssh/ssh_host_ed25519_key 15 | #Privilege Separation is turned on for security 16 | UsePrivilegeSeparation yes 17 | 18 | # Lifetime and size of ephemeral version 1 server key 19 | KeyRegenerationInterval 3600 20 | ServerKeyBits 1024 21 | 22 | # Logging 23 | SyslogFacility AUTH 24 | LogLevel INFO 25 | 26 | # Authentication: 27 | LoginGraceTime 120 28 | PermitRootLogin no 29 | StrictModes yes 30 | 31 | RSAAuthentication yes 32 | PubkeyAuthentication yes 33 | #AuthorizedKeysFile %h/.ssh/authorized_keys 34 | 35 | # Don't read the user's ~/.rhosts and ~/.shosts files 36 | IgnoreRhosts yes 37 | # For this to work you will also need host keys in /etc/ssh_known_hosts 38 | RhostsRSAAuthentication no 39 | # similar for protocol version 2 40 | HostbasedAuthentication no 41 | # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication 42 | #IgnoreUserKnownHosts yes 43 | 44 | # To enable empty passwords, change to yes (NOT RECOMMENDED) 45 | PermitEmptyPasswords no 46 | 47 | # Change to yes to enable challenge-response passwords (beware issues with 48 | # some PAM modules and threads) 49 | ChallengeResponseAuthentication no 50 | 51 | # Change to no to disable tunnelled clear text passwords 52 | PasswordAuthentication no 53 | 54 | # Kerberos options 55 | #KerberosAuthentication no 56 | #KerberosGetAFSToken no 57 | #KerberosOrLocalPasswd yes 58 | #KerberosTicketCleanup yes 59 | 60 | # GSSAPI options 61 | #GSSAPIAuthentication no 62 | #GSSAPICleanupCredentials yes 63 | 64 | X11Forwarding yes 65 | X11DisplayOffset 10 66 | PrintMotd no 67 | PrintLastLog yes 68 | TCPKeepAlive yes 69 | #UseLogin no 70 | 71 | #MaxStartups 10:30:60 72 | #Banner /etc/issue.net 73 | 74 | # Allow client to pass locale environment variables 75 | AcceptEnv LANG LC_* 76 | 77 | Subsystem sftp /usr/lib/openssh/sftp-server 78 | 79 | # Set this to 'yes' to enable PAM authentication, account processing, 80 | # and session processing. If this is enabled, PAM authentication will 81 | # be allowed through the ChallengeResponseAuthentication and 82 | # PasswordAuthentication. Depending on your PAM configuration, 83 | # PAM authentication via ChallengeResponseAuthentication may bypass 84 | # the setting of "PermitRootLogin without-password". 85 | # If you just want the PAM account and session checks to run without 86 | # PAM authentication, then enable this but set PasswordAuthentication 87 | # and ChallengeResponseAuthentication to 'no'. 88 | UsePAM yes 89 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/provision/installgenomes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Create empty work directory 18 | file: 19 | path: "{{galaxy_docker_dbkeys_dir}}" 20 | state: directory 21 | 22 | - name: Find yml files in tool list directory 23 | find: 24 | paths: "{{galaxy_docker_dbkeys_list_dir}}" 25 | patterns: 26 | - "*.yml" 27 | - "*.yaml" 28 | register: dbkeys 29 | delegate_to: 127.0.0.1 30 | become: no 31 | 32 | - name: Show which yamls will be transferred 33 | debug: 34 | var: dbkeys 35 | verbosity: 1 36 | 37 | - name: Move dbkeys to galaxy server 38 | copy: 39 | dest: "{{galaxy_docker_dbkeys_dir}}/{{item.path | basename}}" 40 | src: "{{item.path}}" 41 | force: yes 42 | mode: 0600 43 | with_items: 44 | - "{{dbkeys.files}}" 45 | 46 | # This should be fed from the command line. 47 | - name: delete api key from files 48 | lineinfile: 49 | destfile: "{{galaxy_docker_dbkeys_dir}}/{{item.path | basename}}" 50 | regexp: "api_key:.*" 51 | state: absent 52 | with_items: 53 | - "{{dbkeys.files}}" 54 | 55 | # It should be this instance. So no room for interpretation in the the yamls. 56 | - name: delete galaxy_instance from files 57 | lineinfile: 58 | destfile: "{{galaxy_docker_dbkeys_dir}}/{{item.path | basename}}" 59 | regexp: "galaxy_instance:.*" 60 | state: absent 61 | with_items: 62 | - "{{dbkeys.files}}" 63 | 64 | - name: Use ephemeris run-data-managers to run data managers 65 | command: >- 66 | {{galaxy_docker_docker_user_virtualenv}}/bin/run-data-managers 67 | -g http://localhost:{{galaxy_docker_provision_port}} 68 | -a {{galaxy_admin_api_key}} 69 | --config {{galaxy_docker_dbkeys_dir}}/{{item.path | basename}} 70 | -v 71 | with_items: "{{dbkeys.files}}" 72 | ignore_errors: "{{galaxy_docker_ephemeris_ignore_errors}}" 73 | register: galaxy_docker_ephemeris_run_data_managers 74 | tags: 75 | - skip_ansible_lint # does not create files. 76 | 77 | - name: Fail when run-data-managers did not succeed 78 | fail: 79 | msg: run-data-managers did not have exit code 0 80 | when: 81 | - not galaxy_docker_ephemeris_ignore_errors 82 | - galaxy_docker_ephemeris_run_data_managers.get("failed", False) 83 | 84 | - name: remove added files 85 | file: 86 | path: "{{galaxy_docker_dbkeys_dir}}/{{item.path | basename}}" 87 | state: absent 88 | with_items: 89 | - "{{dbkeys.files}}" 90 | -------------------------------------------------------------------------------- /test/files/test/tools/tool_list.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is a sample file to be used as a reference for populating a list of 3 | # tools that you wish to install into Galaxy from a Tool Shed via the 4 | # `install_tool_shed_tools.py` script. 5 | # 6 | # For each tool you want to install, you must provide the following keys: 7 | # * name: this is is the name of the tool to install 8 | # * owner: owner of the Tool Shed repository from where the tools is being 9 | # installed 10 | # Further, you need to provide **one** of the following two keys: 11 | # * tool_panel_section_id: ID of the tool panel section where you want the 12 | # tool to be installed. The section ID can be found 13 | # in Galaxy's `shed_tool_conf.xml` config file. Note 14 | # that the specified section must exist in this file. 15 | # Otherwise, the tool will be installed outside any 16 | # section. 17 | # * tool_panel_section_label: Display label of a tool panel section where 18 | # you want the tool to be installed. If it does not 19 | # exist, this section will be created on the target 20 | # Galaxy instance (note that this is different than 21 | # when using the ID). 22 | # Multi-word labels need to be placed in quotes. 23 | # Each label will have a corresponding ID created; 24 | # the ID will be an all lowercase version of the 25 | # label, with multiple words joined with 26 | # underscores (e.g., 'BED tools' -> 'bed_tools'). 27 | # 28 | # You can also specify the following optional keys to further define the 29 | # installation properties: 30 | # * tool_shed_url: the URL of the Tool Shed from where the tool should be 31 | # installed. (default: https://toolshed.g2.bx.psu.edu) 32 | # * revisions: a list of revisions of the tool, all of which will attempt to 33 | # be installed. (default: latest) 34 | # * install_tool_dependencies: True or False - whether to install classic galaxy 35 | # Tool Shed dependencies or not. (default: True) 36 | # * install_repository_dependencies: True or False - whether to install classic 37 | # Galaxy Tool Shed repo dependencies or not. 38 | # (default: True) 39 | # * install_resolver_dependencies: True or False - whether to install dependencies 40 | # through a resolver (e.g Conda). (default: False) 41 | 42 | tools: 43 | - name: data_manager_fetch_genome_dbkeys_all_fasta 44 | owner: devteam 45 | tool_shed_url: https://toolshed.g2.bx.psu.edu 46 | revisions: 47 | - 16ab4dd6a0e5 48 | - b1bc53e9bbc5 49 | install_tool_dependencies: True 50 | install_repository_dependencies: True 51 | -------------------------------------------------------------------------------- /roles/galaxy-docker/tasks/upgrade/upgrade.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ----- 3 | # Copyright 2017 Sequencing Analysis Support Core - Leiden University Medical Center 4 | # Contact us at: sasc@lumc.nl 5 | # 6 | # This file is part of galaxy-launcher. 7 | # 8 | # galaxy-launcher is free software: you can redistribute it 9 | # and/or modify it under the terms of the MIT License (Expat) as 10 | # published by the Open Source initiative. 11 | # 12 | # You should have received a copy of the MIT License (Expat) 13 | # along with galaxy-launcher. If not, see 14 | # . 15 | # ..... 16 | 17 | - name: Remove docker container before migrating 18 | docker_container: 19 | name: "{{galaxy_docker_container_name}}" 20 | state: absent 21 | keep_volumes: True 22 | 23 | - name: moving to another export folder for testing 24 | import_tasks: test.yml 25 | when: galaxy_docker_test_upgrade 26 | become: "{{galaxy_docker_become}}" 27 | become_user: "{{galaxy_docker_web_user}}" 28 | vars: 29 | ansible_user: "{{galaxy_docker_web_ssh_user}}" 30 | ansible_ssh_private_key_file: "{{galaxy_docker_web_user_private_key}}" 31 | 32 | - name: delete .distribution_config folder 33 | docker_container: 34 | volumes: "{{galaxy_docker_export_location}}:/export/" 35 | image: "{{galaxy_docker_docker_image}}" 36 | name: "{{galaxy_docker_container_name}}" 37 | state: started 38 | command: bash -c "rm -rf /export/.distribution_config" 39 | when: not galaxy_docker_test_upgrade 40 | 41 | - name: Start docker container 42 | docker_container: 43 | volumes: "{{galaxy_docker_export_location}}:/export/" 44 | image: "{{galaxy_docker_docker_image}}" 45 | name: "{{galaxy_docker_container_name}}" 46 | state: started 47 | command: "/usr/bin/startup" 48 | detach: True 49 | 50 | - name: Check if postgres is online 51 | command: "docker exec {{galaxy_docker_container_name}} service postgresql status" 52 | register: result 53 | until: '"online" in result.stdout' 54 | retries: 20 55 | changed_when: false 56 | 57 | - name: upgrade the database on the export location 58 | command: "docker exec {{name}} {{command}}" 59 | vars: 60 | volumes: "{{galaxy_docker_export_location}}:/export/" 61 | image: "{{galaxy_docker_docker_image}}" 62 | name: "{{galaxy_docker_container_name}}" 63 | state: started 64 | command: "bash -c 'bash $GALAXY_ROOT/manage_db.sh upgrade'" 65 | register: migration_result 66 | tags: 67 | - skip_ansible_lint # Does not create files 68 | 69 | - name: show migration results 70 | debug: 71 | var: migration_result.stdout 72 | verbosity: 0 73 | 74 | - name: Stop docker container 75 | docker_container: 76 | name: "{{galaxy_docker_container_name}}" 77 | state: stopped 78 | 79 | - import_tasks: add_new_config.yml 80 | become: "{{galaxy_docker_become}}" 81 | become_user: "{{galaxy_docker_web_user}}" 82 | vars: 83 | ansible_user: "{{galaxy_docker_web_ssh_user}}" 84 | ansible_ssh_private_key_file: "{{galaxy_docker_web_user_private_key}}" 85 | --------------------------------------------------------------------------------