-
Notifications
You must be signed in to change notification settings - Fork 108
add object store cleanup script #1734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
1c37cff
76be6f5
fc16410
85a8530
79ea697
254be6b
745dbe2
2914b70
e715b08
0e0b09b
16b5891
f3e3b10
cc7f9b6
fc12672
5199a0d
7e0842a
539498e
932572e
2d91941
7e9c087
a40f5c5
15d56b5
6f5e991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| # Example: | ||
| # galaxy_cleanup_scratchstorage: | ||
| # - objectstore_id: '' | ||
| # days: 60 | ||
|
|
||
| # ***************************************************************************************** | ||
| # WARNING: Adding or modifying entries in `galaxy_cleanup_objectstores` will cause data | ||
| # in the specified object stores to be **deleted** after the defined retention | ||
| # period (e.g., `days: 60`). Ensure you only include object stores that are meant | ||
| # to be cleaned up, and double‑check the `objectstore_id` values before saving. | ||
| # ***************************************************************************************** | ||
| galaxy_cleanup_scratchstorage: [] | ||
|
|
||
| # Cron schedule for galaxy cleanup objectstores script | ||
| # Default: runs daily at 1:00 AM | ||
| galaxy_cleanup_minute: 0 | ||
| galaxy_cleanup_hour: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| - name: Check that all objectstore_id include 'scratch' | ||
| assert: | ||
| that: | ||
| - galaxy_cleanup_scratchstorage | length > 0 | ||
| - galaxy_cleanup_scratchstorage | ||
| | rejectattr('objectstore_id', 'search', 'scratch') | ||
| | list | ||
| | length == 0 | ||
| fail_msg: "Found objectstore_id entries that do NOT contain 'scratch'" | ||
| success_msg: "All objectstore_id values contain 'scratch'" | ||
|
|
||
| - name: Install cleanup scratch script | ||
| template: | ||
| src: "clean_scratch_storage.sh.j2" | ||
| dest: "/usr/local/bin/clean_scratch_storage.sh" | ||
| mode: "0555" | ||
|
|
||
| - name: Schedule Galaxy cleanup objectstore script | ||
| ansible.builtin.cron: | ||
| name: "Galaxy cleanup scratch" | ||
| job: "/usr/local/bin/clean_scratch_storage.sh" | ||
| minute: "{{ galaxy_cleanup_minute }}" | ||
| hour: "{{ galaxy_cleanup_hour }}" | ||
| user: "{{ galaxy_user.name }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/sh | ||
| ## | ||
| ## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN | ||
| ## | ||
| set -e | ||
|
|
||
| {% for item in galaxy_cleanup_scratchstorage %} | ||
| {{ galaxy_venv_dir }}/bin/python {{ galaxy_server_dir }}/scripts/cleanup_datasets/pgcleanup.py -c {{ galaxy_config_file }} -o {{ item.days }} -l {{ galaxy_log_dir }} -w 128MB --object-store-id {{ item.objectstore_id }} purge_old_hdas 2>&1 | tee -a {{ galaxy_log_dir }}/cleanup-$(date --rfc-3339=seconds)-purge_old_hdas.log | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens if item.objectstore_id is empty or wrong/does-not-exist?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that the jinja will try to render nothing (empty string, thus becoming We can add and extra tasks that checks if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This template task should not be executed if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the following failures are expected in these kind of cases (so we should be fine).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a complete playbook failure is the only way we can reliably see broken roles / variables in Jenkins.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we pass a faulty
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It failed pretty quickly and just roolbacks the changes |
||
| {% endfor %} | ||
Uh oh!
There was an error while loading. Please reload this page.