Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
228 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
--- | ||
# Manage Galaxy download | ||
|
||
- name: Check for Galaxy download receipt | ||
stat: | ||
path: "{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt" | ||
register: download_receipt | ||
|
||
- name: Replace current version of Galaxy | ||
shell: "rm -rf '{{ galaxy_server_dir }}' && mkdir '{{ galaxy_server_dir }}' && wget -q -O - {{ galaxy_download_url }} | tar xzf - --strip-components=1 -C {{ galaxy_server_dir }} && touch '{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt'" | ||
- name: Create Galaxy server directory | ||
file: | ||
path: "{{ galaxy_server_dir }}" | ||
state: directory | ||
|
||
- name: Install current version of Galaxy | ||
unarchive: | ||
src: "{{ galaxy_download_url }}" | ||
dest: "{{ galaxy_server_dir }}" | ||
extra_opts: --strip-components=1 | ||
remote_src: yes | ||
when: not download_receipt.stat.exists | ||
|
||
- name: Create Galaxy download receipt | ||
file: | ||
path: "{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt" | ||
state: touch | ||
when: not download_receipt.stat.exists | ||
|
||
- name: Include virtualenv setup tasks | ||
include_tasks: virtualenv.yml | ||
|
||
- name: Remove orphaned .pyc files and compile bytecode | ||
script: makepyc.py {{ galaxy_server_dir }}/lib | ||
environment: | ||
PATH: "{{ galaxy_venv_dir }}/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
# Configure any unset variables using layout defaults | ||
|
||
- name: Include layout vars | ||
include_vars: "layout-{{ galaxy_layout | default('legacy') }}.yml" | ||
|
||
- name: Set any unset variables from layout defaults | ||
set_fact: | ||
"{{ item }}": "{{ lookup('vars', '__' ~ item) }}" | ||
when: item not in vars | ||
with_items: | ||
- galaxy_venv_dir | ||
- galaxy_server_dir | ||
- galaxy_config_dir | ||
- galaxy_mutable_config_dir | ||
- galaxy_mutable_data_dir | ||
- galaxy_shed_tools_dir | ||
- galaxy_cache_dir | ||
|
||
- name: Check that any explicitly set Galaxy config options match the values of explicitly set variables | ||
assert: | ||
that: | ||
- lookup('vars', 'galaxy_' ~ item) == galaxy_config[galaxy_app_config_section][item] | ||
msg: "Value of '{{ 'galaxy_' ~ item }}' does not match value of '{{ item }}' in galaxy_config: {{ lookup('vars', 'galaxy_' ~ item) }} != {{ galaxy_config[galaxy_app_config_section][item] }}" | ||
# TODO: requires Ansible 2.7 | ||
#success_msg: "Value of '{{ 'galaxy_' ~ item }}' matches galaxy_config value of '{{ item }}' in galaxy_config" | ||
when: "'galaxy_' ~ item in vars and item in ((galaxy_config | default({}))[galaxy_app_config_section] | default({}))" | ||
with_items: | ||
- tool_dependency_dir | ||
- file_path | ||
- job_working_directory | ||
|
||
- name: Set any unset variables corresponding to Galaxy config options from galaxy_config or layout defaults | ||
set_fact: | ||
"{{ 'galaxy_' ~ item }}": "{{ ((galaxy_config | default({}))[galaxy_app_config_section] | default({}))[item] | default(lookup('vars', '__galaxy_' ~ item)) }}" | ||
when: "'galaxy_' ~ item not in vars" | ||
with_items: | ||
- tool_dependency_dir | ||
- file_path | ||
- job_working_directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
# Reasonable defaults for custom layouts. To use, you must define: | ||
# | ||
# - galaxy_server_dir | ||
# - galaxy_venv_dir | ||
# - galaxy_config_dir | ||
# - galaxy_mutable_data_dir | ||
|
||
# Layout defaults | ||
__galaxy_mutable_config_dir: "{{ galaxy_mutable_data_dir }}/config" | ||
__galaxy_cache_dir: "{{ galaxy_mutable_data_dir }}/cache" | ||
__galaxy_shed_tools_dir: "{{ galaxy_mutable_data_dir }}/shed_tools" | ||
|
||
# These correspond to galaxy config options | ||
__galaxy_tool_dependency_dir: "{{ galaxy_mutable_data_dir }}/dependencies" | ||
__galaxy_file_path: "{{ galaxy_mutable_data_dir }}/datasets" | ||
__galaxy_job_working_directory: "{{ galaxy_mutable_data_dir }}/jobs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
# Layout defaults | ||
__galaxy_venv_dir: "{{ galaxy_server_dir }}/.venv" | ||
__galaxy_config_dir: "{{ galaxy_server_dir }}/config" | ||
__galaxy_mutable_data_dir: "{{ galaxy_server_dir }}/database" | ||
__galaxy_mutable_config_dir: "{{ galaxy_server_dir }}/config" | ||
__galaxy_cache_dir: "{{ galaxy_mutable_data_dir }}" | ||
__galaxy_shed_tools_dir: "{{ galaxy_mutable_data_dir }}/shed_tools" | ||
|
||
# These correspond to galaxy config options | ||
__galaxy_tool_dependency_dir: "{{ galaxy_mutable_data_dir }}/dependencies" | ||
__galaxy_file_path: "{{ galaxy_mutable_data_dir }}/datasets" | ||
__galaxy_job_working_directory: "{{ galaxy_mutable_data_dir }}/jobs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
# Layout defaults | ||
__galaxy_venv_dir: "{{ galaxy_server_dir }}/.venv" | ||
__galaxy_config_dir: "{{ galaxy_server_dir }}" | ||
__galaxy_mutable_data_dir: "{{ galaxy_server_dir }}/database" | ||
__galaxy_mutable_config_dir: "{{ galaxy_server_dir }}" | ||
__galaxy_cache_dir: "{{ galaxy_mutable_data_dir }}" | ||
__galaxy_shed_tools_dir: "{{ galaxy_server_dir }}/../shed_tools" | ||
|
||
# These correspond to galaxy config options | ||
__galaxy_tool_dependency_dir: "{{ galaxy_mutable_data_dir }}/dependencies" | ||
__galaxy_file_path: "{{ galaxy_mutable_data_dir }}/datasets" | ||
__galaxy_job_working_directory: "{{ galaxy_mutable_data_dir }}/jobs" |
Oops, something went wrong.