Skip to content

Commit

Permalink
Added simple Ansible playbooks for installing FastTree and smartmonto…
Browse files Browse the repository at this point in the history
…ols.
  • Loading branch information
Richard Liang committed Dec 1, 2023
1 parent 61a33ba commit dfce1db
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
23 changes: 21 additions & 2 deletions cluster-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,27 @@ the "main" playbook, and will take longer to run.

At this point, you should have a fresh, "empty" server, with Kive running. Several
`systemd`-based background tasks that perform Kive cleanup and backups should also be
in place. If that's your goal, then you can stop here. The next steps restore data
from an old server.
in place. If that's your goal, then you can stop here.

### Install FastTree

Our Phylowatch service requires [FastTree] 2.1.9 to be installed on the cluster (at the time
of writing). This is an older version so the binaries are not directly available on the
FastTree website; rather, we must compile it from [the source code][FastTreeSourceCode].
At the time of writing, the source code is available on their website, but if this ever
disappears, we maintain a vendored copy on macdatafile in the `Phylowatch` directory
as `FastTree-2.1.9.c`.

[FastTree]: https://microbesonline.org/fasttree/
[FastTreeSourceCode]: https://microbesonline.org/fasttree/FastTree-2.1.9.c

Put this file into the `deployment` directory on the head node, and run the
`install_fasttree.yaml` playbook to compile and install FastTree.

### Optional (but recommended): install smartmontools

To install the `smartmontools` package, which provides `smartctl`, use the
`install_smartmontools.yaml` playbook (or simply install it using `apt`).

## Restore from an old system

Expand Down
49 changes: 49 additions & 0 deletions cluster-setup/deployment/install_fasttree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---

- hosts: head
become: true
tasks:
- name: make a directory to hold the source code
file:
path: /usr/local/src/FastTree-2.1.9
owner: root
group: root
mode: '0755'
state: directory

- name: copy FastTree source code to the host
copy:
src: FastTree-2.1.9.c
dest: /usr/local/src/FastTree-2.1.9/FastTree.c
owner: root
group: root

- name: compile single-precision FastTree
command:
chdir: /usr/local/src/FastTree-2.1.9
cmd: gcc -O3 -finline-functions -funroll-loops -Wall -o FastTree.single FastTree.c -lm
creates: FastTree.single

- name: compile double-precision FastTree
command:
chdir: /usr/local/src/FastTree-2.1.9
cmd: gcc -DUSE_DOUBLE -O3 -finline-functions -funroll-loops -Wall -o FastTree.double FastTree.c -lm
creates: FastTree.double

- name: install FastTree.single
copy:
src: /usr/local/src/FastTree-2.1.9/FastTree.single
dest: /usr/local/bin/FastTree.single
mode: "0755"

- name: install FastTree.double
copy:
src: /usr/local/src/FastTree-2.1.9/FastTree.double
dest: /usr/local/bin/FastTree.double
mode: "0755"

- name: make an alias to FastTree.single
file:
src: /usr/local/bin/FastTree.single
path: /usr/local/bin/FastTree
state: link
9 changes: 9 additions & 0 deletions cluster-setup/deployment/install_smartmontools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- hosts: head
become: true
tasks:
- name: install smartmontools
apt:
name:
- smartmontools

0 comments on commit dfce1db

Please sign in to comment.