-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-bioshell.yml
More file actions
747 lines (637 loc) · 23.6 KB
/
build-bioshell.yml
File metadata and controls
747 lines (637 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
---
- name: Build BioShell
hosts: all
become: true
tasks:
- name: Wait for apt lock to be released
become: true
shell: |
while fuser /var/lib/apt/lists/lock >/dev/null 2>&1 || \
fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 || \
fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
sleep 5
done
changed_when: false
- name: Update apt repository
apt:
update_cache: yes
register: apt_update
retries: 3
delay: 10
until: apt_update is succeeded
- name: Ensure necessary packages are installed
apt:
name:
- lmod
- build-essential
- libssl-dev
- uuid-dev
- libgpgme11-dev
- squashfs-tools
- git
- wget
- autoconf
- automake
- cryptsetup
- fuse2fs
- fuse
- libfuse-dev
- libglib2.0-dev
- libtool
- pkg-config
- runc
- squashfs-tools-ng
- uidmap
- zlib1g-dev
- libseccomp-dev
- nano
- jupyter
- snakemake
- r-base
- python3
- python3-pip
- python3-venv
- ansible
- tree
state: present
- name: Install build dependencies for R packages
apt:
name:
- build-essential
- cmake
- gdal-bin
- libcurl4-openssl-dev
- libxml2-dev
- libfontconfig1-dev
- libfreetype6-dev
- libharfbuzz-dev
- libfribidi-dev
- libudunits2-dev
- libglpk-dev
- libblas-dev
- liblapack-dev
- libopenblas-dev
- libtiff5-dev
- libjpeg-dev
- libpng-dev
- libcairo2-dev
state: present
update_cache: yes
- name: Ensure the /opt/Modules/modulefiles directory exists
file:
path: /opt/Modules/modulefiles
state: directory
- name: Ensure the /apps/Modules/modulefiles directory exists
file:
path: /apps/Modules/modulefiles
state: directory
# Install RStudio
- name: Install RStudio Server dependencies
apt:
name:
- gdebi-core
- libclang-dev
state: present
- name: Set RStudio Server version
set_fact:
rstudio_version: "2023.12.1-402"
- name: Download RStudio Server
get_url:
url: "https://download2.rstudio.org/server/jammy/amd64/rstudio-server-{{ rstudio_version }}-amd64.deb"
dest: "/tmp/rstudio-server.deb"
- name: Install RStudio Server
apt:
deb: /tmp/rstudio-server.deb
- name: Clean up RStudio Server installer
file:
path: /tmp/rstudio-server.deb
state: absent
- name: Enable and start RStudio Server
systemd:
name: rstudio-server
enabled: no
state: stopped
# Install Singularity
- name: Check if /apps/go exists
stat:
path: /apps/go
register: go_apps_dir
- name: Check if /usr/local/go exists
stat:
path: /usr/local/go
register: go_local_dir
- name: Report status of /apps/go
debug:
msg: "/apps/go exists: {{ go_apps_dir.stat.exists }}"
- name: Report status of /usr/local/go
debug:
msg: "/usr/local/go exists: {{ go_local_dir.stat.exists }}"
- name: Take action based on Go installation paths
debug:
msg: >
Go is installed in:
{% if go_apps_dir.stat.exists %}
- /apps/go
{% endif %}
{% if go_local_dir.stat.exists %}
- /usr/local/go
{% endif %}
{% if not (go_apps_dir.stat.exists or go_local_dir.stat.exists) %}
- Neither path exists.
{% endif %}
- name: Install Go
block:
- name: Set Go version and architecture
set_fact:
go_version: "1.22.7"
os: "linux"
arch: "amd64"
- name: Download Go binary
get_url:
url: "https://dl.google.com/go/go{{ go_version }}.{{ os }}-{{ arch }}.tar.gz"
dest: /tmp/go{{ go_version }}.{{ os }}-{{ arch }}.tar.gz
- name: Extract Go binary to /apps/
unarchive:
src: /tmp/go{{ go_version }}.{{ os }}-{{ arch }}.tar.gz
dest: /apps/
remote_src: yes
- name: Create directories for Singularity
shell: |
export VERSION=4.2.1 && \
export GOPATH=${HOME}/go && \
mkdir -p $GOPATH/src/github.com/sylabs && \
cd $GOPATH/src/github.com/sylabs && \
wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
tar -xzf singularity-ce-${VERSION}.tar.gz && \
cd ./singularity-ce-${VERSION}
- name: Compile the SingularityCE source code
shell: |
export VERSION=4.2.1
export GOPATH=${HOME}/go
export PATH=/apps/go/bin:${PATH}:${GOPATH}/bin
cd $GOPATH/src/github.com/sylabs/singularity-ce-${VERSION} && \
./mconfig --prefix=/opt/singularity/4.2.1 && \
make -C ./builddir && \
make -C ./builddir install
args:
executable: /bin/bash
- name: Clean up Singularity source code
file:
path: /tmp/singularity
state: absent
- name: Clean up go source code
file:
path: /apps/go
state: absent
- name: Create modulefile for Singularity
copy:
dest: /opt/Modules/modulefiles/singularity
content: |
#%Module1.0
proc ModulesHelp { } {
puts stderr "\tThis module makes available commands to run Singularity\n"
}
module-whatis "Sets up the Singularity system in your environment"
prepend-path PATH "/opt/singularity/4.2.1/bin"
# Install Spack
- name: Install Spack
block:
- name: Clone Spack repository
shell: |
git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git /usr/local/spack
# Intall Nextflow
- name: Install Java 21 (required for Nextflow)
apt:
name: openjdk-21-jdk
state: present
become: yes
when: ansible_os_family == "Debian"
- name: Ensure Java 21 is default JVM
alternatives:
name: java
path: /usr/lib/jvm/java-21-openjdk-amd64/bin/java
become: yes
when: ansible_os_family == "Debian"
# Make Nextflowfolder
- name: Create Nextflow folder
shell: |
mkdir -p /apps/Modules/modulefiles/nextflow
mkdir -p /apps/nextflow/24.10.2/bin
args:
executable: /bin/bash
- name: Download Nextflow
get_url:
url: https://get.nextflow.io
dest: /tmp/nextflow
mode: '0755'
- name: Move Nextflow to /apps
copy:
src: /tmp/nextflow
dest: /apps/nextflow/24.10.2/bin
mode: '0755'
remote_src: yes
- name: Verify Nextflow installation with user-writable paths
shell: |
export NXF_VER=24.10.2
export NXF_AUTOINSTALL=false
export NXF_DIST=$HOME/nextflow/framework
export CAPSULE_CACHE_DIR=$HOME/nextflow/capsule
export PATH=/apps/nextflow/24.10.2/bin:${PATH}
mkdir -p "$NXF_DIST" "$CAPSULE_CACHE_DIR"
nextflow -version
register: nextflow_version
args:
executable: /bin/bash
- name: Clean up temporary files
file:
path: /tmp/nextflow
state: absent
- name: Create modulefile for Nextflow
copy:
dest: /apps/Modules/modulefiles/nextflow/24.10.2
content: |
#%Module1.0
module-whatis "Nextflow"
prepend-path PATH "/apps/nextflow/24.10.2/bin"
setenv NXF_DIST /apps/nextflow/24.10.2/framework
setenv CAPSULE_CACHE_DIR /apps/nextflow/24.10.2/capsule
# add nf-core modulefile
- name: Create nf-core install directory
file:
path: /apps/nf-core/3.5.2
state: directory
recurse: yes
- name: Install Python venv dependency
apt:
name: python3-venv
state: present
update_cache: yes
- name: Create nf-core virtual environment
command: python3 -m venv /apps/nf-core/3.5.2
args:
creates: /apps/nf-core/3.5.2/bin/activate
- name: Install nf-core into venv
command: /apps/nf-core/3.5.2/bin/pip install nf-core==3.5.2
- name: Create symlink for nfcore alias (optional)
file:
src: /apps/nf-core/3.5.2/bin/nf-core
dest: /apps/nf-core/3.5.2/bin/nfcore
state: link
# ---------------------------
# Create modulefile directory
# ---------------------------
- name: Create nf-core modulefile directory
file:
path: /apps/Modules/modulefiles/nf-core
state: directory
- name: Create nf-core modulefile
copy:
dest: /apps/Modules/modulefiles/nf-core/3.5.2
content: |
#%Module1.0
module-whatis "nf-core 3.5.2"
prepend-path PATH "/apps/nf-core/3.5.2/bin"
if { [ module-info mode load ] } {
module load nextflow
}
# Install shpc
- name: Install shpc
shell: |
mkdir -p /opt/shpc/bin
cd /opt/shpc
git clone -b 0.1.28 https://github.com/singularityhub/singularity-hpc.git
cd singularity-hpc
pip install -e .[all]
ln -s /opt/shpc/bin/shpc /usr/local/bin/shpc
cp /opt/shpc/singularity-hpc/shpc/settings.yml /opt/shpc/singularity-hpc/shpc/settings-default.yml
cp /opt/shpc/singularity-hpc/shpc/main/modules/templates/singularity.lua /opt/shpc/singularity-hpc/shpc/main/modules/templates/singularity-original.lua
- name: update module_base
lineinfile:
path: /opt/shpc/singularity-hpc/shpc/settings.yml
regexp: '^module_base: \$root_dir/modules'
line: 'module_base: $HOME/shpc/modules'
state: present
- name: update container_base
lineinfile:
path: /opt/shpc/singularity-hpc/shpc/settings.yml
regexp: '^container_base: \$root_dir/containers'
line: 'container_base: $HOME/shpc/containers'
state: present
- name: update wrapper_base
lineinfile:
path: /opt/shpc/singularity-hpc/shpc/settings.yml
regexp: '^wrapper_base: \$root_dir/modules'
line: 'wrapper_base: $HOME/shpc/wrappers'
state: present
- name: update view_base
lineinfile:
path: /opt/shpc/singularity-hpc/shpc/settings.yml
regexp: '^views_base: \$root_dir/views'
line: 'views_base: $HOME/shpc/views'
state: present
- name: Check if singularity.lua exists
stat:
path: "/opt/shpc/singularity-hpc/shpc/main/modules/templates/singularity.lua"
register: lua_file
- name: Create singularity.lua if it does not exist
copy:
dest: "/opt/shpc/singularity-hpc/shpc/main/modules/templates/singularity.lua"
content: |
-- Default content for singularity.lua
local moduleDir = subprocess("realpath " .. myFileName()):match("(.*[/])") or "."
when: not lua_file.stat.exists
- name: Replace line starting with 'local moduleDir'
lineinfile:
path: "/opt/shpc/singularity-hpc/shpc/main/modules/templates/singularity.lua"
regexp: '^local moduleDir.*'
line: 'local moduleDir = myFileName():match("(.*[/])") or "."'
state: present
- name: Create shpc modulefile
copy:
dest: "/opt/Modules/modulefiles/shpc"
content: |
#%Module1.0
module-whatis "Singularity HPC"
prepend-path PATH "/opt/shpc/bin"
if { [ module-info mode load ] } {
module load singularity
}
- name: Create /apps paths and symlink system binaries
shell: |
mkdir -p /apps/R/4.1.2/bin /apps/Modules/modulefiles/R
ln -sf /usr/bin/R /apps/R/4.1.2/bin/R
mkdir -p /apps/jupyter/2024.10/bin /apps/Modules/modulefiles/jupyter
ln -sf /usr/bin/jupyter /apps/jupyter/2024.10/bin/jupyter
mkdir -p /apps/snakemake/6.15.1/bin /apps/Modules/modulefiles/snakemake
ln -sf /usr/bin/snakemake /apps/snakemake/6.15.1/bin/snakemake
mkdir -p /apps/ansible/2.10.8/bin /apps/Modules/modulefiles/ansible
ln -sf /usr/bin/ansible /apps/ansible/2.10.8/bin/ansible
mkdir -p /apps/RStudio/2023.12.1/bin /apps/Modules/modulefiles/rstudio
ln -sf /usr/sbin/rstudio-server /apps/RStudio/2023.12.1/bin/rstudio-server
args:
executable: /bin/bash
- name: Create R modulefile
copy:
dest: "/apps/Modules/modulefiles/R/4.1.2"
content: |
#%Module1.0
prepend-path PATH "/apps/R/4.1.2/bin"
- name: Create jupyter modulefile
copy:
dest: "/apps/Modules/modulefiles/jupyter/2024.10"
content: |
#%Module1.0
prepend-path PATH "/apps/jupyter/2024.10/bin"
- name: Create snakemake modulefile
copy:
dest: "/apps/Modules/modulefiles/snakemake/6.15.1"
content: |
#%Module1.0
prepend-path PATH "/apps/snakemake/6.15.1/bin"
- name: Create R modulefile
copy:
dest: "/apps/Modules/modulefiles/ansible/2.10.8"
content: |
#%Module1.0
prepend-path PATH "/apps/ansible/2.10.8/bin"
- name: Create RStudio modulefile
become: yes
copy:
dest: "/apps/Modules/modulefiles/rstudio/2023.12.1"
owner: root
group: root
mode: '0644'
content: |
#%Module1.0
module-whatis "RStudio Server 2023.12.1"
prepend-path PATH "/usr/lib/rstudio-server/bin:/usr/lib/rstudio-server/bin"
set ip [exec /bin/bash -c "
curl -fsS --max-time 0.5 http://169.254.169.254/latest/meta-data/public-ipv4 2>/dev/null || true
"]
if { $ip eq "" } {
set ip [exec /bin/bash -c "hostname -I 2>/dev/null | awk '{print \$1}'"]
}
puts stderr ""
puts stderr "RStudio Server"
puts stderr "----------------------------------"
puts stderr "Login Details:"
puts stderr ""
puts stderr " Username: $env(USER)"
puts stderr " Password: Your Linux account password"
puts stderr ""
puts stderr "If you have not set a password yet, run:"
puts stderr ""
puts stderr " sudo passwd $env(USER)"
puts stderr ""
puts stderr "To start RStudio Server:"
puts stderr ""
puts stderr " sudo rstudio-server start"
puts stderr ""
puts stderr "Then open in your browser:"
puts stderr ""
puts stderr " http://$ip:8787"
puts stderr ""
#Install cvmfs and configure with Galaxy, AARNET training, EESSI access
- name: Download CVMFS release package
get_url:
url: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
dest: /tmp/cvmfs-release-latest_all.deb
- name: Install CVMFS release package
apt:
deb: /tmp/cvmfs-release-latest_all.deb
- name: Remove CVMFS release package
file:
path: /tmp/cvmfs-release-latest_all.deb
state: absent
- name: Update apt cache
apt:
update_cache: yes
- name: Install CVMFS
apt:
name: cvmfs
state: present
- name: Write default.local
copy:
dest: /etc/cvmfs/default.local
content: |
CVMFS_REPOSITORIES=data.biocommons.aarnet.edu.au,data.galaxyproject.org,singularity.galaxyproject.org
CVMFS_HTTP_PROXY='DIRECT'
CVMFS_QUOTA_LIMIT=4096
CVMFS_USE_GEOAPI=yes
- name: set up cvmfs and set autofs
shell: |
cvmfs_config setup
sed -i 's%#+dir:/etc/auto.master.d%+dir:/etc/auto.master.d%' /etc/auto.master
systemctl restart autofs
- name: Write data.biocommons.aarnet.edu.au.conf
copy:
dest: /etc/cvmfs/config.d/data.biocommons.aarnet.edu.au.conf
content: |
CVMFS_SERVER_URL="http://bcws.test.aarnet.edu.au/cvmfs/@fqrn@"
CVMFS_PUBLIC_KEY="/etc/cvmfs/keys/data.biocommons.aarnet.edu.au/data.biocommons.aarnet.edu.au.pub"
- name: Write galaxyproject.org.conf
copy:
dest: /etc/cvmfs/domain.d/galaxyproject.org.conf
content: |
CVMFS_SERVER_URL="http://cvmfs1-tacc0.galaxyproject.org/cvmfs/@fqrn@;http://cvmfs1-iu0.galaxyproject.org/cvmfs/@fqrn@;http://cvmfs1-psu0.galaxyproject.org/cvmfs/@fqrn@;http://galaxy.jrc.ec.europa.eu:8008/cvmfs/@fqrn@;http://cvmfs1-mel0.gvl.org.au/cvmfs/@fqrn@"
CVMFS_KEYS_DIR="/etc/cvmfs/keys/galaxyproject.org"
- name: Ensure the /etc/cvmfs/keys/data.biocommons.aarnet.edu.au directory exists
file:
path: /etc/cvmfs/keys/data.biocommons.aarnet.edu.au
state: directory
- name: data.biocommons.aarnet.edu.au key
copy:
dest: /etc/cvmfs/keys/data.biocommons.aarnet.edu.au/data.biocommons.aarnet.edu.au.pub
content: |
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3JEVgVhOjigVTX4OPVpj
EPIZEuhGzqhuvzu4ujovyEjrYoeXIfG+YSFIj9a3YxgPxRl1LVsBm59g+tqrUs25
//xUFIQVomaw8gLRy9txflDe2SWVh4m40IIEGGQQoXyY/Iv26i8vtcVhAJnvL+lM
Iu25nG3MM8rcuuGrYnQQekeoSZLd5Tg4JHC+YEy9n1jUkxCBUTr5XFIXCEQkR2Nr
9p6Hgol/NqUKZT76K3yWNfbRS/kXEB3ZOP6h0QDvVgwzfgTifoLge1cfJuiy/KtM
/UJr1k/cVp4l5ssL7Qqx582eGRJ/rn7K2BVNVF8XI+Fvgpp9DQPxu6U4S4WANKBE
OQIDAQAB
-----END PUBLIC KEY-----
- name: Ensure the /etc/cvmfs/keys/galaxyproject.org exists
file:
path: /etc/cvmfs/keys/galaxyproject.org
state: directory
- name: Write data.galaxyproject.org key
copy:
dest: /etc/cvmfs/keys/galaxyproject.org/data.galaxyproject.org.pub
content: |
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5LHQuKWzcX5iBbCGsXGt
6CRi9+a9cKZG4UlX/lJukEJ+3dSxVDWJs88PSdLk+E25494oU56hB8YeVq+W8AQE
3LWx2K2ruRjEAI2o8sRgs/IbafjZ7cBuERzqj3Tn5qUIBFoKUMWMSIiWTQe2Sfnj
GzfDoswr5TTk7aH/FIXUjLnLGGCOzPtUC244IhHARzu86bWYxQJUw0/kZl5wVGcH
maSgr39h1xPst0Vx1keJ95AH0wqxPbCcyBGtF1L6HQlLidmoIDqcCQpLsGJJEoOs
NVNhhcb66OJHah5ppI1N3cZehdaKyr1XcF9eedwLFTvuiwTn6qMmttT/tHX7rcxT
owIDAQAB
-----END PUBLIC KEY-----
- name: Write singularity.galaxyproject.org.pub key
copy:
dest: /etc/cvmfs/keys/galaxyproject.org/singularity.galaxyproject.org.pub
content: |
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuJZTWTY3/dBfspFKifv8
TWuuT2Zzoo1cAskKpKu5gsUAyDFbZfYBEy91qbLPC3TuUm2zdPNsjCQbbq1Liufk
uNPZJ8Ubn5PR6kndwrdD13NVHZpXVml1+ooTSF5CL3x/KUkYiyRz94sAr9trVoSx
THW2buV7ADUYivX7ofCvBu5T6YngbPZNIxDB4mh7cEal/UDtxV683A/5RL4wIYvt
S5SVemmu6Yb8GkGwLGmMVLYXutuaHdMFyKzWm+qFlG5JRz4okUWERvtJ2QAJPOzL
mAG1ceyBFowj/r3iJTa+Jcif2uAmZxg+cHkZG5KzATykF82UH1ojUzREMMDcPJi2
dQIDAQAB
-----END PUBLIC KEY-----
- name: setup cvmfs and probe resources
shell: |
cvmfs_config setup
cvmfs_config probe data.galaxyproject.org
cvmfs_config probe singularity.galaxyproject.org
- name: Update PATH to remove /usr/local/games and add /usr/local/spack/bin
lineinfile:
path: /etc/environment
regexp: '^PATH='
line: 'PATH="{{ updated_path }}"'
state: present
vars:
current_path: "{{ ansible_env.PATH }}"
updated_path: "{{ current_path | replace('/usr/local/games', '') | trim | replace('::', ':') | regex_replace('^:|:$', '') | regex_replace('^:', '') | regex_replace(':$', '') }}:/usr/local/spack/bin"
- name: Comment out existing module paths
lineinfile:
path: /etc/lmod/modulespath
regexp: '^(.*(/etc/lmod/modules|/usr/share/lmod/lmod/modulefiles).*)'
line: '# \1'
backrefs: yes
state: present
- name: Add new module paths
lineinfile:
path: /etc/lmod/modulespath
line: "{{ item }}"
state: present
loop:
- '/apps/Modules/modulefiles'
- '/opt/Modules/modulefiles'
# ==============================
# Install Shelley Bio
# ==============================
- name: Ensure Python 3 and pip are installed
apt:
name:
- python3
- python3-pip
state: present
update_cache: yes
- name: Ensure Git is installed
apt:
name: git
state: present
- name: Create installation directory for Shelley Bio
file:
path: /opt/shelley-bio
state: directory
owner: root
group: root
mode: '0755'
- name: Clone Shelley Bio repository
git:
repo: https://github.com/Sydney-Informatics-Hub/shelley-bio.git
dest: /opt/shelley-bio
version: main
force: yes
depth: 1
- name: Install Shelley Bio dependencies globally
pip:
requirements: /opt/shelley-bio/requirements.txt
state: present
executable: pip3
- name: Install Shelley Bio package globally
pip:
name: /opt/shelley-bio
editable: yes
state: present
executable: pip3
- name: Create system-wide launcher script
copy:
dest: /usr/local/bin/shelley-bio
owner: root
group: root
mode: '0755'
content: |
#!/usr/bin/env bash
exec python3 -m shelley_bio.client.cli "$@"
- name: Test Shelley Bio CLI
command: shelley-bio search "quality control"
register: shelley_cli_test
ignore_errors: yes
- name: Show Shelley Bio CLI test output
debug:
var: shelley_cli_test.stdout_lines
- name: Add BioShell welcome message with turtle
copy:
dest: /etc/motd
owner: root
group: root
mode: '0644'
content: |
##################################################################
# #
# Welcome to BioShell! #
# #
# A range of commonly used bioinformatics software is available #
# via CVMFS. #
# #
# To make the software folders visible, run: #
# cvmfs_config probe #
# #
# If you need help finding and installing software, #
# ask Shelley-Bio #
# _ .----. #
# (_ \/ \_, #
# `uu----uu' #
# Basic commands: #
# shelley-bio find <tool> #
# shelley-bio search "<function>" #
# shelley-bio versions <tool> #
# shelley-bio build <tool> #
# shelley-bio interactive #
##################################################################