Skip to content

Commit a0852eb

Browse files
committed
Merge branch 'dev'
2 parents 1cbaa36 + 96de8c5 commit a0852eb

20 files changed

+3465
-240
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# 15-pre
22

33
- Fancy [new docs site](https://usegalaxy-eu.github.io/gxadmin/#/)
4+
- Added:
5+
- search :(
6+
- query server-groups-allocated-cpu, thanks @selten
7+
- query server-groups-disk-usage, thanks @selten
8+
- query user-disk-quota, thanks @selten
9+
- query job-info, thanks @selten
10+
- query queue-detail-by-handler
11+
- mutate reassign-job-to-handler
12+
- a LOT of query pg-... commands from [heroku's pg-extras](https://github.com/heroku/heroku-pg-extras/tree/master/commands)
13+
- mutate drop-extraneous-workflow-step-output-associations
14+
- mutate reassign-workflows-to-handler
15+
- query data-origin-distribution
16+
- query data-origin-distribution-summary
17+
- query user-history-list
418

519
# 14
620

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
Please make PRs to the `dev` branch, `master` will be reserved for release-ready versions.
1+
Please:
2+
3+
1. Make PRs to the `dev` branch, `master` will be reserved for release-ready versions.
4+
2. Update the changelog for your additions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PARTS=$(sort $(wildcard parts/*.sh))
22
TMP := $(shell mktemp)
33

4-
all: test README.md
4+
all: gxadmin test README.md
55

66
README.md:
77
@cat $(PARTS) > .tmpgxadmin

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ Example .pgpass:
6262
<pg_host>:5432:*:<pg_user>:<pg_password>
6363
```
6464

65+
### InfluxDB
66+
67+
In order to use functions like `gxadmin meta influx-post`, `gxadmin` requires
68+
a few environment variables to be set. Namely
69+
* `INFLUX_URL`
70+
* `INFLUX_PASS`
71+
* `INFLUX_USER`
72+
* `INFLUX_DB`
73+
6574
### GDPR
6675

6776
You may want to set `GDPR_MODE=1`. Please determine your own legal responsibilities, the authors take no responsibility for anything you may have done wrong.
@@ -136,6 +145,7 @@ Command | Description
136145
[`meta iquery-grt-export`](docs/README.meta.md#meta-iquery-grt-export) | Export data from a GRT database for sending to influx
137146
[`meta slurp-current`](docs/README.meta.md#meta-slurp-current) | Executes what used to be "Galaxy Slurp"
138147
[`meta slurp-day`](docs/README.meta.md#meta-slurp-day) | Slurps data on a specific date.
148+
[`meta slurp-initial`](docs/README.meta.md#meta-slurp-initial) | Slurps data starting at the first date until the second date.
139149
[`meta slurp-upto`](docs/README.meta.md#meta-slurp-upto) | Slurps data up to a specific date.
140150
[`meta update`](docs/README.meta.md#meta-update) | Update the script
141151
[`meta whatsnew`](docs/README.meta.md#meta-whatsnew) | What's new in this version of gxadmin
@@ -147,22 +157,27 @@ Command | Description
147157
[`mutate approve-user`](docs/README.mutate.md#mutate-approve-user) | Approve a user in the database
148158
[`mutate assign-unassigned-workflows`](docs/README.mutate.md#mutate-assign-unassigned-workflows) | Randomly assigns unassigned workflows to handlers. Workaround for galaxyproject/galaxy#8209
149159
[`mutate delete-group-role`](docs/README.mutate.md#mutate-delete-group-role) | Remove the group, role, and any user-group + user-role associations
160+
[`mutate drop-extraneous-workflow-step-output-associations`](docs/README.mutate.md#mutate-drop-extraneous-workflow-step-output-associations) | #8418, drop extraneous connection
150161
[`mutate fail-history`](docs/README.mutate.md#mutate-fail-history) | Mark all jobs within a history to state error
151162
[`mutate fail-job`](docs/README.mutate.md#mutate-fail-job) | Sets a job state to error
152163
[`mutate fail-terminal-datasets`](docs/README.mutate.md#mutate-fail-terminal-datasets) | Causes the output datasets of jobs which were manually failed, to be marked as failed
153164
[`mutate oidc-role-find-affected`](docs/README.mutate.md#mutate-oidc-role-find-affected) | Find users affected by galaxyproject/galaxy#8244
154165
[`mutate oidc-role-fix`](docs/README.mutate.md#mutate-oidc-role-fix) | Fix permissions for users logged in via OIDC. Workaround for galaxyproject/galaxy#8244
166+
[`mutate reassign-job-to-handler`](docs/README.mutate.md#mutate-reassign-job-to-handler) | Reassign a job to a different handler
167+
[`mutate reassign-workflows-to-handler`](docs/README.mutate.md#mutate-reassign-workflows-to-handler) | Reassign workflows in 'new' state to a different handler.
155168

156169
### query
157170

158171
Command | Description
159172
------- | -----------
160-
`query active-users` | Deprecated, use monthly-users-active
161173
[`query collection-usage`](docs/README.query.md#query-collection-usage) | Information about how many collections of various types are used
174+
[`query data-origin-distribution`](docs/README.query.md#query-data-origin-distribution) | data sources (uploaded vs derived)
175+
[`query data-origin-distribution-summary`](docs/README.query.md#query-data-origin-distribution-summary) | breakdown of data sources (uploaded vs derived)
162176
[`query datasets-created-daily`](docs/README.query.md#query-datasets-created-daily) | The min/max/average/p95/p99 of total size of datasets created in a single day.
163177
[`query disk-usage`](docs/README.query.md#query-disk-usage) | Disk usage per object store.
164178
[`query errored-jobs`](docs/README.query.md#query-errored-jobs) | Lists jobs that errored in the last N hours.
165179
[`query group-cpu-seconds`](docs/README.query.md#query-group-cpu-seconds) | Retrieve an approximation of the CPU time in seconds for group(s)
180+
[`query group-gpu-time`](docs/README.query.md#query-group-gpu-time) | Retrieve an approximation of the GPU time for users
166181
[`query groups-list`](docs/README.query.md#query-groups-list) | List all groups known to Galaxy
167182
[`query hdca-datasets`](docs/README.query.md#query-hdca-datasets) | List of files in a dataset collection
168183
[`query hdca-info`](docs/README.query.md#query-hdca-info) | Information on a dataset collection
@@ -171,6 +186,7 @@ Command | Description
171186
[`query history-runtime-system`](docs/README.query.md#query-history-runtime-system) | Sum of runtimes by all jobs in a history
172187
[`query history-runtime-wallclock`](docs/README.query.md#query-history-runtime-wallclock) | Time as elapsed by a clock on the wall
173188
[`query job-history`](docs/README.query.md#query-job-history) | Job state history for a specific job
189+
[`query job-info`](docs/README.query.md#query-job-info) | Retrieve information about jobs given some job IDs
174190
[`query job-inputs`](docs/README.query.md#query-job-inputs) | Input datasets to a specific job
175191
[`query job-outputs`](docs/README.query.md#query-job-outputs) | Output datasets from a specific job
176192
[`query jobs-max-by-cpu-hours`](docs/README.query.md#query-jobs-max-by-cpu-hours) | Top 10 jobs by CPU hours consumed (requires CGroups metrics)
@@ -183,17 +199,32 @@ Command | Description
183199
[`query latest-users`](docs/README.query.md#query-latest-users) | 40 recently registered users
184200
[`query monthly-cpu-years`](docs/README.query.md#query-monthly-cpu-years) | CPU years allocated to tools by month
185201
[`query monthly-data`](docs/README.query.md#query-monthly-data) | Number of active users per month, running jobs
202+
[`query monthly-gpu-years`](docs/README.query.md#query-monthly-gpu-years) | GPU years allocated to tools by month
186203
[`query monthly-jobs`](docs/README.query.md#query-monthly-jobs) | Number of jobs run each month
187204
[`query monthly-users-active`](docs/README.query.md#query-monthly-users-active) | Number of active users per month, running jobs
188-
`query monthly-users` | Deprecated, use monthly-users-active
189205
[`query monthly-users-registered`](docs/README.query.md#query-monthly-users-registered) | Number of users registered each month
190206
[`query old-histories`](docs/README.query.md#query-old-histories) | Lists histories that haven't been updated (used) for <weeks>
207+
[`query pg-cache-hit`](docs/README.query.md#query-pg-cache-hit) | Check postgres in-memory cache hit ratio
208+
[`query pg-index-size`](docs/README.query.md#query-pg-index-size) | show table and index bloat in your database ordered by most wasteful
209+
[`query pg-index-usage`](docs/README.query.md#query-pg-index-usage) | calculates your index hit rate (effective databases are at 99% and up)
210+
[`query pg-long-running-queries`](docs/README.query.md#query-pg-long-running-queries) | show all queries longer than five minutes by descending duration
211+
[`query pg-mandelbrot`](docs/README.query.md#query-pg-mandelbrot) | show the mandlebrot set
212+
[`query pg-stat-bgwriter`](docs/README.query.md#query-pg-stat-bgwriter) | Stats about the behaviour of the bgwriter, checkpoints, buffers, etc.
213+
[`query pg-stat-user-tables`](docs/README.query.md#query-pg-stat-user-tables) | stats about tables (tuples, index scans, vacuums, analyzes)
214+
[`query pg-table-bloat`](docs/README.query.md#query-pg-table-bloat) | show table and index bloat in your database ordered by most wasteful
215+
[`query pg-table-size`](docs/README.query.md#query-pg-table-size) | show the size of the tables (excluding indexes), descending by size
216+
[`query pg-unused-indexes`](docs/README.query.md#query-pg-unused-indexes) | show unused and almost unused indexes
217+
[`query pg-vacuum-stats`](docs/README.query.md#query-pg-vacuum-stats) | show dead rows and whether an automatic vacuum is expected to be triggered
191218
[`query queue`](docs/README.query.md#query-queue) | Brief overview of currently running jobs
192219
[`query queue-detail`](docs/README.query.md#query-queue-detail) | Detailed overview of running and queued jobs
220+
[`query queue-detail-by-handler`](docs/README.query.md#query-queue-detail-by-handler) | List jobs for a specific handler
193221
[`query queue-overview`](docs/README.query.md#query-queue-overview) | View used mostly for monitoring
194222
[`query queue-time`](docs/README.query.md#query-queue-time) | The average/95%/99% a specific tool spends in queue state.
195223
[`query recent-jobs`](docs/README.query.md#query-recent-jobs) | Jobs run in the past <hours> (in any state)
196224
[`query runtime-per-user`](docs/README.query.md#query-runtime-per-user) | computation time of user (by email)
225+
[`query server-groups-allocated-cpu`](docs/README.query.md#query-server-groups-allocated-cpu) | Retrieve an approximation of the CPU allocation for groups
226+
[`query server-groups-allocated-gpu`](docs/README.query.md#query-server-groups-allocated-gpu) | Retrieve an approximation of the GPU allocation for groups
227+
[`query server-groups-disk-usage`](docs/README.query.md#query-server-groups-disk-usage) | Retrieve an approximation of the disk usage for groups
197228
[`query tool-available-metrics`](docs/README.query.md#query-tool-available-metrics) | list all available metrics for a given tool
198229
[`query tool-errors`](docs/README.query.md#query-tool-errors) | Summarize percent of tool runs in error over the past weeks for all tools that have failed (most popular tools first)
199230
[`query tool-last-used-date`](docs/README.query.md#query-tool-last-used-date) | When was the most recent invocation of every tool
@@ -209,7 +240,10 @@ Command | Description
209240
[`query ts-repos`](docs/README.query.md#query-ts-repos) | Counts of toolshed repositories by toolshed and owner.
210241
[`query upload-gb-in-past-hour`](docs/README.query.md#query-upload-gb-in-past-hour) | Sum in bytes of files uploaded in the past hour
211242
[`query user-cpu-years`](docs/README.query.md#query-user-cpu-years) | CPU years allocated to tools by user
243+
[`query user-disk-quota`](docs/README.query.md#query-user-disk-quota) | Retrieves the 50 users with the largest quotas
212244
[`query user-disk-usage`](docs/README.query.md#query-user-disk-usage) | Retrieve an approximation of the disk usage for users
245+
[`query user-gpu-years`](docs/README.query.md#query-user-gpu-years) | GPU years allocated to tools by user
246+
[`query user-history-list`](docs/README.query.md#query-user-history-list) | Shows the ID of the history, it's size and when it was last updated.
213247
[`query user-recent-aggregate-jobs`](docs/README.query.md#query-user-recent-aggregate-jobs) | Show aggregate information for jobs in past N days for user
214248
[`query users-count`](docs/README.query.md#query-users-count) | Shows sums of active/external/deleted/purged accounts
215249
[`query users-total`](docs/README.query.md#query-users-total) | Total number of Galaxy users (incl deleted, purged, inactive)
@@ -235,7 +269,6 @@ Command | Description
235269
[`uwsgi memory`](docs/README.uwsgi.md#uwsgi-memory) | Current system memory usage
236270
[`uwsgi pids`](docs/README.uwsgi.md#uwsgi-pids) | Galaxy process PIDs
237271
[`uwsgi stats-influx`](docs/README.uwsgi.md#uwsgi-stats-influx) | InfluxDB formatted output for the current stats
238-
`uwsgi stats_influx` | Deprecated, use uwsgi stats-influx
239272
[`uwsgi stats`](docs/README.uwsgi.md#uwsgi-stats) | uwsgi stats
240273
[`uwsgi status`](docs/README.uwsgi.md#uwsgi-status) | Current system status
241274
[`uwsgi zerg-scale-up`](docs/README.uwsgi.md#uwsgi-zerg-scale-up) | Add another zergling to deal with high load

docs/README.galaxy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ galaxy cleanup-jwd - (NEW) Cleanup job working directories
7373
**NOTES**
7474

7575
Scans through a provided job working directory subfolder, e.g.
76-
job_working_directory/005/ to find all folders which were changed less
77-
recently than N months.
76+
job_working_directory/ without the 005 subdir to find all folders which
77+
were changed less recently than N months.
7878

79-
Then it takes the first 1000 entries and cleans them up. This was more
79+
Then it takes the first 1000 entries and cleans them up. This was more
8080
of a hack to handle the fact that the list produced by find is really
8181
long, and the for loop hangs until it's done generating the list.
8282

docs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ Example .pgpass:
6262
<pg_host>:5432:*:<pg_user>:<pg_password>
6363
```
6464

65+
### InfluxDB
66+
67+
In order to use functions like `gxadmin meta influx-post`, `gxadmin` requires
68+
a few environment variables to be set. Namely
69+
* `INFLUX_URL`
70+
* `INFLUX_PASS`
71+
* `INFLUX_USER`
72+
* `INFLUX_DB`
73+
6574
### GDPR
6675

6776
You may want to set `GDPR_MODE=1`. Please determine your own legal responsibilities, the authors take no responsibility for anything you may have done wrong.

docs/README.meta.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Command | Description
88
[`meta iquery-grt-export`](#meta-iquery-grt-export) | Export data from a GRT database for sending to influx
99
[`meta slurp-current`](#meta-slurp-current) | Executes what used to be "Galaxy Slurp"
1010
[`meta slurp-day`](#meta-slurp-day) | Slurps data on a specific date.
11+
[`meta slurp-initial`](#meta-slurp-initial) | Slurps data starting at the first date until the second date.
1112
[`meta slurp-upto`](#meta-slurp-upto) | Slurps data up to a specific date.
1213
[`meta update`](#meta-update) | Update the script
1314
[`meta whatsnew`](#meta-whatsnew) | What's new in this version of gxadmin
@@ -113,7 +114,7 @@ meta slurp-current - Executes what used to be "Galaxy Slurp"
113114

114115
**SYNOPSIS**
115116

116-
gxadmin meta slurp-current [--date]
117+
gxadmin meta slurp-current [--date] [slurp-name [2nd-slurp-name [...]]]
117118

118119
**NOTES**
119120

@@ -170,7 +171,7 @@ meta slurp-day - Slurps data on a specific date.
170171

171172
**SYNOPSIS**
172173

173-
gxadmin meta slurp-day <yyyy-mm-dd>
174+
gxadmin meta slurp-day <yyyy-mm-dd> [slurp-name [2nd-slurp-name [...]]]
174175

175176
**NOTES**
176177

@@ -215,13 +216,29 @@ date filter as well, or the metrics reported here will be less useful.
215216
server-workflows.daily,deleted=f,importable=f,published=f count=1
216217

217218

219+
## meta slurp-initial
220+
221+
meta slurp-initial - Slurps data starting at the first date until the second date.
222+
223+
**SYNOPSIS**
224+
225+
gxadmin meta slurp-initial <yyyy-mm-dd> <yyyy-mm-dd> [slurp-name [2nd-slurp-name [...]]]
226+
227+
**NOTES**
228+
229+
Obtains influx compatible metrics between dates and posts this to Influx.
230+
This function calls 'gxadmin meta slurp-upto' and 'gxadmin meta slurp-day'.
231+
232+
It requires a start and end date. Allows to run specific slurp queries.
233+
234+
218235
## meta slurp-upto
219236

220237
meta slurp-upto - Slurps data up to a specific date.
221238

222239
**SYNOPSIS**
223240

224-
gxadmin meta slurp-upto <yyyy-mm-dd>
241+
gxadmin meta slurp-upto <yyyy-mm-dd> [slurp-name [2nd-slurp-name [...]]]
225242

226243
**NOTES**
227244

docs/README.mutate.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ Command | Description
55
[`mutate approve-user`](#mutate-approve-user) | Approve a user in the database
66
[`mutate assign-unassigned-workflows`](#mutate-assign-unassigned-workflows) | Randomly assigns unassigned workflows to handlers. Workaround for galaxyproject/galaxy#8209
77
[`mutate delete-group-role`](#mutate-delete-group-role) | Remove the group, role, and any user-group + user-role associations
8+
[`mutate drop-extraneous-workflow-step-output-associations`](#mutate-drop-extraneous-workflow-step-output-associations) | #8418, drop extraneous connection
89
[`mutate fail-history`](#mutate-fail-history) | Mark all jobs within a history to state error
910
[`mutate fail-job`](#mutate-fail-job) | Sets a job state to error
1011
[`mutate fail-terminal-datasets`](#mutate-fail-terminal-datasets) | Causes the output datasets of jobs which were manually failed, to be marked as failed
1112
[`mutate oidc-role-find-affected`](#mutate-oidc-role-find-affected) | Find users affected by galaxyproject/galaxy#8244
1213
[`mutate oidc-role-fix`](#mutate-oidc-role-fix) | Fix permissions for users logged in via OIDC. Workaround for galaxyproject/galaxy#8244
14+
[`mutate reassign-job-to-handler`](#mutate-reassign-job-to-handler) | Reassign a job to a different handler
15+
[`mutate reassign-workflows-to-handler`](#mutate-reassign-workflows-to-handler) | Reassign workflows in 'new' state to a different handler.
1316

1417
## mutate approve-user
1518

@@ -54,6 +57,26 @@ mutate delete-group-role - Remove the group, role, and any user-group + user-ro
5457
Wipe out a group+role, and user associations.
5558

5659

60+
## mutate drop-extraneous-workflow-step-output-associations
61+
62+
mutate drop-extraneous-workflow-step-output-associations - #8418, drop extraneous connection
63+
64+
**SYNOPSIS**
65+
66+
gxadmin mutate drop-extraneous-workflow-step-output-associations [--commit]
67+
68+
**NOTES**
69+
70+
Per https://github.com/galaxyproject/galaxy/pull/8418, this drops the
71+
workflow step output associations that are not necessary.
72+
73+
This only needs to be run once, on servers which have run Galaxy<=19.05
74+
to remove duplicate entries in the following tables:
75+
76+
- workflow_invocation_step_output_dataset_association
77+
- workflow_invocation_step_output_dataset_collection_association
78+
79+
5780
## mutate fail-history
5881

5982
mutate fail-history - Mark all jobs within a history to state error
@@ -168,3 +191,27 @@ mutate oidc-role-fix - Fix permissions for users logged in via OIDC. Workaround
168191

169192
Workaround for https://github.com/galaxyproject/galaxy/issues/8244
170193

194+
195+
## mutate reassign-job-to-handler
196+
197+
mutate reassign-job-to-handler - Reassign a job to a different handler
198+
199+
**SYNOPSIS**
200+
201+
gxadmin mutate reassign-job-to-handler <job_id> <handler_id> [--commit]
202+
203+
204+
## mutate reassign-workflows-to-handler
205+
206+
mutate reassign-workflows-to-handler - Reassign workflows in 'new' state to a different handler.
207+
208+
**SYNOPSIS**
209+
210+
gxadmin mutate reassign-workflows-to-handler <handler_from> <handler_to> [--commit]
211+
212+
**NOTES**
213+
214+
Another workaround for https://github.com/galaxyproject/galaxy/issues/8209
215+
216+
Need to use the full handler names e.g. handler_main_0
217+

0 commit comments

Comments
 (0)