Jenkins job executed every night at ~ 4:00 CET.
It runs ansible playbook sn06.yml
from infrastructure-playbook repository. The playbook updates Galaxy server and runs all the included roles.
The configuration overview of the usegalaxy.it-sn06
Jenkins job:
General:
7
Source Code Management:
https://github.com/usegalaxy-it/infrastructure-playbook
*/master
Build Triggers:
H 2 * * *
(every night at ~2:00 UTC == ~4:00 CET, minutes are set randomly)Build Environment:
<ANSIBLE_VAULT_PASS>
<vault_pass>
Build Steps:
Python-3.8.10
Shell
python -m pip install -r requirements.txt
ansible-galaxy install -r requirements.yaml
cp $VAULT_PASS .vault_password
ansible-playbook -i hosts sn06.yml --extra-vars "__galaxy_dir_perms='0755'"
rm -d .vault_password
Post-build Actions:
<admin1@gmail.com>, <admin1@gmail.com>
Jenkins jobs run every night at ~ 3:00 CET.
usegalaxy.it-tools
installs and updates tools, saving the logs and updating tools repo with new lockfiles. It sends an email to a specified list of recipients in case of job failure.
usegalaxy.it-restart-gunicorns
is triggered if the previous job is successful. It restarts gunicorns one by one in order to make the newly installed tools visible and accessible by users.
usegalaxy.it-tools-reports
job runs if the previous job is successful and transforms logs into the Markdown report, saving it to github repo.
The configuration overview of the usegalaxy.it-tools
Jenkins job:
General:
7
Source Code Management:
git@github.com:<tools_repo>.git
<SSH_KEY>
*/main
Build Triggers:
H 1 * * *
(every night at ~1:00 UTC == ~3:00 CET, minutes are set randomly)Build Environment:
<API_KEY>
<API_KEY>
Build Steps:
Python-3.8.10
Shell
git checkout main
pip install -r requirements.txt
# create lockfiles
make fix
# install tools
make install GALAXY_SERVER=$GALAXY_ADDR GALAXY_API_KEY=$GALAXY_API_KEY
# commit lockfiles on github, allow to fail if no changes
git add *.yaml.lock
git commit -m "Update lock files. Jenkins Build: ${BUILD_NUMBER}" -m "https://github.com/usegalaxy-it/usegalaxy.it-tools-reports/blob/main/reports-$(date +%Y-%m)/$(date +%Y-%m-%d-%H-%M)-tools-update.md" || true
Post-build Actions:
report.log
main
origin
<admin1@gmail.com>, <admin1@gmail.com>
The configuration overview of the usegalaxy.it-restart-gunicorns
Jenkins job:
General:
7
Source Code Management:
Build Triggers:
usegalaxy.it-tools
Build Environment:
Build Steps:
Python-3.8.10
Shell
# run gxadmin admin utility to restart gunicorns sequentially
ssh <usegalaxy.it_ssh_user>@<usegalaxy.it_IP> "sudo gxadmin gunicorn handler-restart"
The configuration overview of the usegalaxy.it-tools-reports
Jenkins job:
General:
5
Source Code Management:
git@github.com:<reports_repo>.git
<SSH_KEY>
*/main
Build Triggers:
usegalaxy.it-restart-gunicorns
Build Environment:
Build Steps:
Python-3.8.10
Shell
git checkout main
# make dir for each month
mkdir reports-$(date +%Y-%m) || true
# name of report file
POST="$(date +%Y-%m-%d-%H-%M)-tools-update.md"
# transform log file to markdown report
cat <absolute_path_to_workspace_dir_of_usegalaxy.it-tools>/report.log | python <absolute_path_to_workspace_dir_of_usegalaxy.it-tools>/scripts/generate-report.py > reports-$(date +%Y-%m)/${POST}
# commit report
git add .
git commit -m "Jenkins Build: ${BUILD_NUMBER}"
Post-build Actions:
main
origin
Email notifications are enables by mailer
Jenkins plugin.
To send email notifications from gmail account, some steps need to be performed with gmail account and Jenkins settings. They are generally described below:
Jenkins mailer setup:
smtp.gmail.com
<the_gmail_address_you_configured>
<application-specific_password_generated_in_step_1>
465
Now you’ll get messages in case of failure, and when the project is back to normal