-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from dometto/prebuilt_client
Support prebuilt client
- Loading branch information
Showing
9 changed files
with
211 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
- name: Install dependencies (yum) | ||
yum: | ||
# For completeness this should include git, but on EL7 we install a newer git from SCL in the Dockerfile to deal | ||
# with automatic line ending conversion in the default git 1.8 breaking idempotence | ||
#name: [sudo, git, make, bzip2] | ||
name: [sudo, make, bzip2] | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", "<") | ||
- name: Install dependencies (dnf) | ||
dnf: | ||
name: [sudo, git, make, bzip2] | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", ">=") | ||
- name: Install dependencies (apt) | ||
apt: | ||
name: | ||
- sudo | ||
- git | ||
- make | ||
- python3-venv | ||
- python3-setuptools | ||
- python3-dev | ||
- python3-psycopg2 | ||
- gcc | ||
- acl | ||
- gnutls-bin | ||
- libmagic-dev | ||
when: ansible_os_family == "Debian" | ||
|
||
# This is to cheat at idempotence, which will fail if a commit is merged between converge and idempotence. | ||
- name: Check whether server dir exists | ||
stat: | ||
path: "{{ galaxy_root }}/server" | ||
register: __molecule_dir_check | ||
- name: Collect current commit id | ||
git: | ||
clone: false | ||
depth: "{{ galaxy_clone_depth }}" | ||
dest: "{{ galaxy_root }}/server" | ||
repo: https://github.com/galaxyproject/galaxy.git | ||
changed_when: false | ||
become: "{{ __molecule_dir_check.stat.exists }}" | ||
become_user: "{{ galaxy_privsep_user }}" | ||
register: __molecule_git_check | ||
- name: Set galaxy_commit_id | ||
set_fact: | ||
galaxy_commit_id: "{{ __molecule_git_check.before or ((__galaxy_version == 'dev') | ternary('dev', 'release_' ~ __galaxy_version)) }}" |
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,32 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
galaxy_client_use_prebuilt: true # This scenario tests with the prebuilt client | ||
__galaxy_version: "{{ lookup('env', 'GALAXY_VERSION') }}" | ||
galaxy_create_user: yes | ||
galaxy_manage_paths: yes | ||
galaxy_manage_clone: yes | ||
galaxy_manage_download: no | ||
galaxy_manage_existing: no | ||
galaxy_manage_systemd: yes | ||
# role default is < 22.05 | ||
galaxy_manage_gravity: "{{ false if __galaxy_major_version is version('22.01', '<') else true }}" | ||
galaxy_systemd_mode: "{{ 'mule' if __galaxy_major_version is version('22.01', '<') else 'gravity' }}" | ||
galaxy_config_style: yaml | ||
galaxy_layout: root-dir | ||
galaxy_root: /srv/galaxy | ||
galaxy_separate_privileges: yes | ||
galaxy_user: galaxy | ||
galaxy_group: galaxy | ||
galaxy_privsep_user: gxpriv | ||
galaxy_clone_depth: 1 | ||
galaxy_config: | ||
galaxy: | ||
database_connection: sqlite:///{{ galaxy_mutable_data_dir }}/universe.sqlite | ||
conda_auto_init: false | ||
pip_virtualenv_command: /usr/bin/python3 -m venv | ||
pre_tasks: | ||
- include_tasks: "../_common/_inc_pre_tasks.yml" | ||
roles: | ||
- role: galaxyproject.galaxy |
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,26 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
options: | ||
force: false # don't fetch every time | ||
role-file: molecule/_common/requirements.yml | ||
requirements-file: molecule/_common/requirements.yml | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: galaxy-scenario-prebuilt_client | ||
image: ${FROM_IMAGE:-centos:7} | ||
platform: linux/amd64 | ||
# override default sleep loop, use Dockerfile CMD | ||
command: "" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:rw | ||
privileged: true | ||
dockerfile: ../_common/Dockerfile.j2 | ||
pre_build_image: false | ||
provisioner: | ||
name: ansible | ||
env: | ||
GALAXY_VERSION: ${GALAXY_VERSION:-dev} | ||
verifier: | ||
name: ansible |
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,16 @@ | ||
--- | ||
|
||
- name: Verify | ||
hosts: all | ||
vars: | ||
__galaxy_version: "{{ lookup('env', 'GALAXY_VERSION') }}" | ||
tasks: | ||
- name: Check version | ||
uri: | ||
url: http://localhost:8080/api/version | ||
register: response | ||
failed_when: response.status != 200 or (__galaxy_version != 'dev' and response.json.version_major != lookup('env', 'GALAXY_VERSION')) | ||
# this is just to wait until the server is up, we can stop retrying on any response | ||
until: response.status > 0 | ||
retries: 60 | ||
delay: 1 |
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 @@ | ||
--- | ||
|
||
- name: Install client build tools | ||
block: | ||
- name: Ensure galaxy_node_version is set | ||
include_tasks: _inc_node_version.yml | ||
when: galaxy_node_version is undefined | ||
|
||
- name: Check if node is installed | ||
stat: | ||
path: "{{ galaxy_venv_dir }}/bin/node" | ||
register: __galaxy_node_is_installed | ||
|
||
- name: Collect installed node version | ||
command: "{{ galaxy_venv_dir }}/bin/node --version" | ||
when: __galaxy_node_is_installed.stat.exists | ||
changed_when: false | ||
register: __galaxy_installed_node_version | ||
|
||
- name: Remove node_modules directory when upgrading node | ||
file: | ||
path: "{{ galaxy_venv_dir }}/lib/node_modules" | ||
state: absent | ||
when: (not __galaxy_node_is_installed.stat.exists) or (('v' ~ galaxy_node_version) != __galaxy_installed_node_version.stdout) | ||
|
||
- name: Install or upgrade node | ||
command: "nodeenv -n {{ galaxy_node_version }} -p" | ||
environment: | ||
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}" | ||
VIRTUAL_ENV: "{{ galaxy_venv_dir }}" | ||
when: (not __galaxy_node_is_installed.stat.exists) or (('v' ~ galaxy_node_version) != __galaxy_installed_node_version.stdout) | ||
|
||
- name: Install yarn | ||
npm: | ||
executable: "{{ galaxy_venv_dir }}/bin/npm" | ||
name: yarn | ||
global: yes | ||
environment: | ||
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}" | ||
VIRTUAL_ENV: "{{ galaxy_venv_dir }}" |
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