Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ paprikant.beacon
```yaml

script_user: beacon-import
script_dir: /opt/beacon-import/
script_dir: /opt/beacon-import/

galaxy_api_key: 123213hiufho12h31h321
galaxy_api_url: usegalaxy.eu
Expand Down
2 changes: 1 addition & 1 deletion files/beacon-import.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.9
#!/usr/bin/env python3
"""Pushes genomic variant information from a galaxy to a beacon instance.

Usage:
Expand Down
10 changes: 5 additions & 5 deletions files/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
argparse
asyncio
asyncpg
datetime
dataclasses
numpy
typing
git+https://github.com/CSCfi/beacon-python
asyncpg>=0.28.0
numpy
bioblend
cyvcf2

cyvcf2>=0.32.1
aiohttp>=3.8.6
uvloop>=0.17.0
Comment on lines 1 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argparse<2.0.0
asyncio<5.0.0
DateTime<7.0.0
dataclasses<1.0.0
typing<4.0.0
asyncpg>=0.28.0,<1.0.0
numpy<3.0.0
bioblend<2.0.0
cyvcf2>=0.32.1,<1.0.0
aiohttp>=3.8.6,<4.0.0
uvloop>=0.17.0,<1.0.0

Just in case you think it is useful.

37 changes: 27 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
# tasks file for beacon
#

- name: Install python
ansible.builtin.package:
name: "{{ item }}"
state: present
loop:
- python39
- python3
- python3-pip
- python3-setuptools

- python3-devel
- gcc

- name: Install cronie
ansible.builtin.package:
name: cronie
state: present

- name: Ensure script user exists
- name: Ensure script user exists
ansible.builtin.user:
name: "{{ script_user }}"
create_home: true
Expand All @@ -40,24 +39,42 @@
ansible.builtin.package:
name: git
state: present

# this is no mistake

- name: Create virtualenv and bootstrap pip tooling
ansible.builtin.pip:
name:
- pip
- setuptools
- wheel
state: latest
virtualenv: "{{ script_dir }}/venv"
virtualenv_command: /usr/bin/python3 -m venv

- name: Install beacon-python without deps
ansible.builtin.pip:
name: "git+https://github.com/CSCfi/beacon-python"
extra_args: "--no-deps"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

el10 does not come with python 3.9 and the beacon as some pinned versions that do not work in newer versions of python

I see, therefore --no-deps 👍.

virtualenv: "{{ script_dir }}/venv"
virtualenv_command: /usr/bin/python3 -m venv

- name: Install python deps
ansible.builtin.pip:
requirements: "{{ script_dir }}/requirements.txt"
executable: /usr/bin/pip3.9
virtualenv: "{{ script_dir }}/venv"
virtualenv_command: /usr/bin/python3 -m venv

- name: Create a cronjob for daily executions
- name: Create a cronjob for daily executions
ansible.builtin.cron:
user: "{{ script_user }}"
name: "check dirs"
minute: "0"
hour: "5"
job: "{{ script_dir }}/beacon-import.py -k {{ galaxy_api_key }} -u {{ galaxy_api_url }} rebuild -H {{ beacon_db_host }} -P {{ beacon_db_port }} -U {{beacon_db_user }} -W {{ beacon_db_password }} -N {{ beacon_db_name }} || touch /tmp/job_error"
job: "{{ script_dir }}/venv/bin/python {{ script_dir }}/beacon-import.py -k {{ galaxy_api_key }} -u {{ galaxy_api_url }} rebuild -H {{ beacon_db_host }} -P {{ beacon_db_port }} -U {{ beacon_db_user }} -W {{ beacon_db_password }} -N {{ beacon_db_name }} || touch /tmp/job_error"

- name: Make sure crond is started and enabled
ansible.builtin.systemd:
name: crond
name: crond
state: started
enabled: yes

Expand Down
Loading