Skip to content

Commit a2784aa

Browse files
committed
added slurm role and some refactorings
1 parent bf03c59 commit a2784aa

File tree

11 files changed

+138
-39
lines changed

11 files changed

+138
-39
lines changed

.gitmodules

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
[submodule "galaxy/roles/galaxyproject.galaxyextras"]
2-
path = galaxy/roles/galaxyprojectdotorg.galaxyextras
1+
[submodule "galaxy/ansible/roles/galaxyproject.galaxyextras"]
2+
path = galaxy/ansible/roles/galaxyprojectdotorg.galaxyextras
33
url = https://github.com/jyotipm29/ansible-galaxy-extras
44
branch = 24.1
55

6-
[submodule "galaxy/roles/galaxy-postgresql"]
7-
path = galaxy/roles/galaxy-postgresql
6+
[submodule "galaxy/ansible/roles/galaxy-postgresql"]
7+
path = galaxy/ansible/roles/galaxy-postgresql
88
url = https://github.com/galaxyproject/ansible-postgresql
99

10-
[submodule "galaxy/roles/galaxy-tusd"]
11-
path = galaxy/roles/galaxy-tusd
10+
[submodule "galaxy/ansible/roles/galaxy-tusd"]
11+
path = galaxy/ansible/roles/galaxy-tusd
1212
url = https://github.com/galaxyproject/ansible-role-tusd
1313

14-
[submodule "galaxy/roles/galaxy-flower"]
15-
path = galaxy/roles/galaxy-flower
14+
[submodule "galaxy/ansible/roles/galaxy-flower"]
15+
path = galaxy/ansible/roles/galaxy-flower
1616
url = https://github.com/usegalaxy-eu/flower-ansible-role
1717

18-
[submodule "galaxy/roles/galaxy-redis"]
19-
path = galaxy/roles/galaxy-redis
18+
[submodule "galaxy/ansible/roles/galaxy-redis"]
19+
path = galaxy/ansible/roles/galaxy-redis
2020
url = https://github.com/geerlingguy/ansible-role-redis
21+
22+
[submodule "galaxy/ansible/roles/galaxy-repos"]
23+
path = galaxy/ansible/roles/galaxy-repos
24+
url = https://github.com/galaxyproject/ansible-repos
25+
26+
[submodule "galaxy/ansible/roles/galaxy-slurm"]
27+
path = galaxy/ansible/roles/galaxy-slurm
28+
url = https://github.com/galaxyproject/ansible-slurm

galaxy/Dockerfile

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,14 @@ RUN groupadd -r postgres -g $GALAXY_POSTGRES_GID \
9191
&& apt-get -qq update && apt-get install --no-install-recommends -y software-properties-common gpg-agent curl sudo \
9292
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
9393
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
94-
&& sudo add-apt-repository ppa:natefoo/slurm-drmaa \
9594
&& curl -fsSL https://research.cs.wisc.edu/htcondor/repo/keys/HTCondor-current-Key | sudo apt-key add - \
9695
&& sudo add-apt-repository "deb https://research.cs.wisc.edu/htcondor/repo/ubuntu/current jammy main" \
9796
&& apt-get update -qq \
9897
## && apt-get purge -y software-properties-common gpg-agent \
9998
## && apt-get install postgresql-10 --no-install-recommends -y \
10099
&& apt-get install nginx-extras nginx-common --no-install-recommends -y \
101100
&& apt-get install docker-ce --no-install-recommends -y \
102-
&& apt-get install slurm-client slurmd slurmctld slurm-drmaa1 --no-install-recommends -y \
103-
&& ln -s /usr/lib/slurm-drmaa/lib/libdrmaa.so.1 /usr/lib/slurm-drmaa/lib/libdrmaa.so \
104101
&& apt-get install proftpd proftpd-mod-pgsql proftpd-mod-crypto --no-install-recommends -y \
105-
&& apt-get install munge libmunge-dev --no-install-recommends -y \
106102
&& apt-get install nano --no-install-recommends -y \
107103
&& apt-get install htcondor --no-install-recommends -y \
108104
&& apt-get install git --no-install-recommends -y \
@@ -177,11 +173,10 @@ RUN chmod 0644 $GALAXY_CONFIG_DIR/reports.yml $GALAXY_HOME/ephemeris/sample_tool
177173
# Make python3 standard
178174
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
179175

180-
ADD roles/ /ansible/roles
181176
ADD ansible/ /ansible/
182177

183178
# Install ansible and related dependencies
184-
RUN apt update -qq && apt install --no-install-recommends -y software-properties-common dirmngr gpg gpg-agent \
179+
RUN apt update -qq && apt install --no-install-recommends -y software-properties-common dirmngr gpg gpg-agent bsdmainutils \
185180
&& sudo add-apt-repository ppa:ansible/ansible \
186181
&& apt install --no-install-recommends -y ansible \
187182
&& apt purge -y systemd
@@ -209,28 +204,16 @@ RUN ansible-playbook /ansible/redis_provision.yml \
209204
--extra-vars redis_venv_dir=$GALAXY_VIRTUAL_ENV \
210205
--extra-vars redis_user=$GALAXY_USER
211206

212-
# cleanup dance
213-
RUN apt purge ansible software-properties-common dirmngr gpg gpg-agent -y && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
214-
&& find $GALAXY_ROOT_DIR/ -name '*.pyc' -delete | true \
215-
&& find /usr/lib/ -name '*.pyc' -delete | true \
216-
&& find $GALAXY_VIRTUAL_ENV -name '*.pyc' -delete | true \
217-
&& rm -rf /tmp/* /root/.cache/ /var/cache/* $GALAXY_ROOT_DIR/client/node_modules/ $GALAXY_VIRTUAL_ENV/src/ /home/galaxy/.cache/ /home/galaxy/.npm
218-
219-
220-
# Include all needed scripts from the host
221-
ADD ./setup_postgresql.py /usr/local/bin/setup_postgresql.py
222-
223-
# Configure PostgreSQL
224-
# 1. Remove all old configuration
225-
# 2. Create DB-user 'galaxy' with password 'galaxy' in database 'galaxy'
226-
# 3. Create Galaxy Admin User '[email protected]' with password 'admin' and API key 'admin'
207+
# Install slurm
208+
RUN ansible-playbook /ansible/slurm_provision.yml \
209+
--extra-vars galaxy_user_name=$GALAXY_USER
227210

228211
RUN mkdir -p /shed_tools $EXPORT_DIR/ftp/ \
229212
&& chown $GALAXY_USER:$GALAXY_USER /shed_tools $EXPORT_DIR/ftp \
230213
&& ln -s /tool_deps/ $EXPORT_DIR/tool_deps \
231214
# Configure Galaxy to use the Tool Shed
232215
&& chown $GALAXY_USER:$GALAXY_USER $EXPORT_DIR/tool_deps \
233-
&& apt update -qq && apt install --no-install-recommends -y ansible gpg gpg-agent g++ make bsdmainutils \
216+
&& apt update -qq && apt install --no-install-recommends -y g++ make \
234217
&& ansible-playbook /ansible/provision.yml \
235218
--extra-vars galaxy_venv_dir=$GALAXY_VIRTUAL_ENV \
236219
--extra-vars galaxy_log_dir=$GALAXY_LOGS_DIR \
@@ -258,27 +241,36 @@ RUN mkdir -p /shed_tools $EXPORT_DIR/ftp/ \
258241
--extra-vars nginx_use_remote_header=True \
259242
--extra-vars tus_upload_store_path=$GALAXY_CONFIG_TUS_UPLOAD_STORE \
260243
--extra-vars gx_it_proxy_sessions_path=$GALAXY_CONFIG_INTERACTIVETOOLS_MAP \
261-
--tags=galaxyextras,cvmfs --skip-tags=tusd,flower,redis -c local \
244+
--tags=galaxyextras,cvmfs --skip-tags=tusd,flower,redis,slurm -c local \
262245
&& . $GALAXY_VIRTUAL_ENV/bin/activate \
263246
&& pip install WeasyPrint \
264247
&& deactivate \
265248
# TODO: no clue why this is needed here again
266249
&& cd $GALAXY_ROOT_DIR && ./scripts/common_startup.sh \
267250
&& cd config && find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + \
268251
&& find . -name '.cache' -type d -prune -exec rm -rf '{}' + \
269-
&& cd / \
270-
&& rm $PG_DATA_DIR_DEFAULT -rf \
271-
&& python /usr/local/bin/setup_postgresql.py --dbuser galaxy --dbpassword galaxy --db-name galaxy --dbpath $PG_DATA_DIR_DEFAULT --dbversion $PG_VERSION \
272-
&& service postgresql start \
273-
&& service postgresql stop \
274-
&& apt purge gpg gpg-agent g++ make gcc -y && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf ~/.cache/ \
252+
&& apt purge software-properties-common dirmngr gpg gpg-agent g++ make gcc -y && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache/ \
275253
# cleanup dance
276254
&& find $GALAXY_ROOT_DIR/ -name '*.pyc' -delete | true \
277255
&& find /usr/lib/ -name '*.pyc' -delete | true \
278256
&& find /var/log/ -name '*.log' -delete | true \
279257
&& find $GALAXY_VIRTUAL_ENV -name '*.pyc' -delete | true \
280258
&& rm -rf /tmp/* /root/.cache/ /var/cache/* $GALAXY_ROOT_DIR/client/node_modules/ $GALAXY_VIRTUAL_ENV/src/ /home/galaxy/.cache/ /home/galaxy/.npm
281259

260+
# Include all needed scripts from the host
261+
ADD ./setup_postgresql.py /usr/local/bin/setup_postgresql.py
262+
263+
# Configure PostgreSQL
264+
# 1. Remove all old configuration
265+
# 2. Create DB-user 'galaxy' with password 'galaxy' in database 'galaxy'
266+
# 3. Create Galaxy Admin User '[email protected]' with password 'admin' and API key 'admin'
267+
268+
RUN cd / \
269+
&& rm $PG_DATA_DIR_DEFAULT -rf \
270+
&& python /usr/local/bin/setup_postgresql.py --dbuser galaxy --dbpassword galaxy --db-name galaxy --dbpath $PG_DATA_DIR_DEFAULT --dbversion $PG_VERSION \
271+
&& service postgresql start \
272+
&& service postgresql stop
273+
282274
RUN touch /var/log/condor/StartLog /var/log/condor/StarterLog /var/log/condor/CollectorLog /var/log/condor/NegotiatorLog && \
283275
mkdir -p /var/run/condor/ /var/lock/condor/ && \
284276
chown -R condor: /var/log/condor/StartLog /var/log/condor/StarterLog /var/log/condor/CollectorLog /var/log/condor/NegotiatorLog /var/run/condor/ /var/lock/condor/

galaxy/ansible/roles/galaxy-repos

Submodule galaxy-repos added at 4ffac67

galaxy/ansible/roles/galaxy-slurm

Submodule galaxy-slurm added at 2f051cb

galaxy/ansible/slurm_provision.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
- hosts: localhost
2+
connection: local
3+
remote_user: root
4+
vars:
5+
slurm_roles: ['controller', 'exec']
6+
slurm_config:
7+
SlurmctldHost: localhost
8+
SlurmUser: '{{ galaxy_user_name }}'
9+
SelectType: select/cons_tres
10+
SelectTypeParameters: CR_Core_Memory
11+
StateSaveLocation: /tmp/slurm
12+
ReturnToService: 1
13+
roles:
14+
- role: galaxy-repos
15+
- role: galaxy-slurm
16+
tasks:
17+
- name: Install slurm-drmaa package
18+
package:
19+
name: slurm-drmaa1
20+
state: present
21+
22+
- name: Create symbolic link for libdrmaa.so
23+
file:
24+
src: /usr/lib/slurm-drmaa/lib/libdrmaa.so.1
25+
dest: /usr/lib/slurm-drmaa/lib/libdrmaa.so
26+
state: link
27+
28+
- name: Setup tmp area for slurm
29+
file: path=/tmp/slurm state=directory owner={{ galaxy_user_name }} group={{ galaxy_user_name }}
30+
31+
- name: Add script to update slurm configuration file
32+
template: src=configure_slurm.py.j2 dest=/usr/sbin/configure_slurm.py mode=0755
33+
34+
- name: Setup Munge permissions and folder
35+
file: path={{ item }} state=directory owner=root group=root recurse=yes
36+
with_items:
37+
- /var/run/munge
38+
- /var/lib/munge
39+
- /var/log/munge
40+
- /var/run/munge
41+
- /etc/munge

0 commit comments

Comments
 (0)