Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24 01 #57

Merged
merged 10 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,30 @@ The variables that can be passed to this role and a brief description about them
# Galaxy export dir
galaxy_export_dir: /mnt/export
# Version of the Galaxy portal docker image to use
galaxy_image_version: 20.09-19.05.5 # or 20.09-20.02.7
galaxy_image_version: "24.1"
# ENV variables for the Docker Galaxy
galaxy_docker_env_vars:
NONUSE: reports
GALAXY_LOGGING: full
DOCKER_PARENT: True
GALAXY_CONFIG_HOST: 0.0.0.0
GALAXY_DEFAULT_ADMIN_USER: "{{galaxy_admin}}"
GALAXY_DEFAULT_ADMIN_PASSWORD: "{{galaxy_admin_password}}"
GALAXY_DEFAULT_ADMIN_KEY: "{{galaxy_admin_password}}"
GALAXY_CONFIG_ADMIN_USERS: "{{galaxy_admin}}"
GALAXY_CONFIG_MASTER_API_KEY: "{{galaxy_admin_api_key}}"
USE_HTTPS: "True"
GALAXY_CONFIG_BRAND: "Galaxy"
NONUSE: "reports,slurmd,slurmctld,nodejs,condor"
GALAXY_LOGGING: "full"
DOCKER_PARENT: "True"
GALAXY_CONFIG_HOST: "0.0.0.0"
GALAXY_DEFAULT_ADMIN_USER: "{{galaxy_admin}}"
GALAXY_DEFAULT_ADMIN_PASSWORD: "{{galaxy_admin_password}}"
GALAXY_DEFAULT_ADMIN_KEY: "{{galaxy_admin_password}}"
GALAXY_CONFIG_ADMIN_USERS: "{{galaxy_admin}}"
GALAXY_CONFIG_MASTER_API_KEY: "{{galaxy_admin_api_key}}"
GALAXY_DESTINATIONS_DEFAULT: "local_no_container"
GALAXY_RUNNERS_ENABLE_SLURM: "False"
GALAXY_RUNNERS_ENABLE_K8: "False"
GALAXY_RUNNERS_ENABLE_PBS: "False"

# ENV variables for the Docker Galaxy in case of using slurm
slurm_galaxy_docker_env_vars:
NONUSE: slurmctld,reports
GALAXY_DESTINATIONS_DEFAULT: "slurm_cluster_docker"
NONUSE: "reports,slurmctld,slurmd,nodejs,condor"
GALAXY_DESTINATIONS_DEFAULT: "slurm_cluster"
GALAXY_RUNNERS_ENABLE_SLURM: "True"

galaxy_docker_volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
Expand Down
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ galaxy_image_version: "24.1"
# ENV variables for the Docker Galaxy
galaxy_docker_env_vars:
USE_HTTPS: "True"
NONUSE: "reports,slurmd,slurmctld,nodejs,condor"
GALAXY_CONFIG_BRAND: "Galaxy"
NONUSE: "reports,slurmd,slurmctld,nodejs,condor,proftp,flower"
GALAXY_LOGGING: "full"
DOCKER_PARENT: "True"
GALAXY_CONFIG_HOST: "0.0.0.0"
Expand All @@ -43,7 +44,7 @@ galaxy_docker_env_vars:

# ENV variables for the Docker Galaxy in case of using slurm
slurm_galaxy_docker_env_vars:
NONUSE: "reports,slurmctld,slurmd,nodejs,condor"
NONUSE: "reports,slurmctld,slurmd,nodejs,condor,proftp,flower"
GALAXY_DESTINATIONS_DEFAULT: "slurm_cluster"
GALAXY_RUNNERS_ENABLE_SLURM: "True"

Expand Down
103 changes: 89 additions & 14 deletions tasks/portal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,92 @@
- include_tasks: slurm.yml
when: galaxy_lrms == "slurm"

- name: Start galaxy container
docker_container:
name: galaxy
image: "quay.io/bgruening/galaxy:{{galaxy_image_version}}"
ports:
- "8443:443"
- "8080:80"
- "8022:22"
- "8021:21"
- "9002:9002"
# - "8800:8800"
env: "{{galaxy_docker_env_vars}}"
volumes: "{{galaxy_docker_volumes}}"
privileged: yes
- name: Set public_ip_address to default IP
set_fact:
public_ip_address: "{{ ansible_default_ipv4.address }}"
- name: Set public_ip_address to Public IP
set_fact:
public_ip_address: "{{ IM_NODE_PUBLIC_IP }}"
when: IM_NODE_PUBLIC_IP is defined and IM_NODE_PUBLIC_IP != ""
- name: Set default DNS name (nip.io)
set_fact:
dns_name: "galaxy.{{ public_ip_address }}.nip.io"
when: galaxy_dns_name is not defined or galaxy_dns_name == ""
- name: Set custom DNS name
set_fact:
dns_name: "{{ galaxy_dns_name }}"
when: galaxy_dns_name is defined and galaxy_dns_name != ""

- name: Create galaxy directory
file:
path: /opt/galaxy
state: directory
mode: '755'

- name: Create docker-compose file
copy:
content: |
version: '3.3'
services:
galaxy:
restart: on-failure
privileged: true
image: quay.io/bgruening/galaxy:{{galaxy_image_version}}
container_name: galaxy_portal
environment: {{ galaxy_docker_env_vars | to_yaml }}
expose:
- "443"
ports:
- "8022:22"
- "8021:21"
- "9002:9002"
networks:
- frontend
volumes: {{ galaxy_docker_volumes }}
labels:
- "traefik.enable=true"
- "traefik.http.routers.galaxy.service=galaxy"
- "traefik.http.routers.galaxy.rule=Host(`{{ dns_name }}`)"
- "traefik.http.routers.galaxy.entrypoints=websecure"
- "traefik.http.routers.galaxy.tls.certresolver=myresolver"
- "traefik.http.services.galaxy.loadbalancer.server.port=443"
- "traefik.http.services.galaxy.loadbalancer.server.scheme=https"
- "traefik.docker.network=mlflow_frontend"
traefik:
image: "traefik:v2.11"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--serversTransport.insecureSkipVerify=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.galaxy.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.galaxy.http.redirections.entryPoint.to=websecure"
- "--entrypoints.galaxy.http.redirections.entryPoint.scheme=https"
- "--entrypoints.galaxy.http.redirections.entrypoint.permanent=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=galaxy"
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email={{ galaxy_admin }}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- frontend
networks:
frontend:
driver: bridge
dest: /opt/galaxy/docker-compose.yaml
mode: '644'

- name: Exec docker-compose up
docker_compose:
project_src: /opt/galaxy/
state: present
Loading