Job Status Update: Implement RabbitMQ Action #1284
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1121
Motivation
The RabbitMQ action is a requirement for PSI
Fixes:
The changes made in
JobOperation class
injobconfig.ts
and injob-create.interceptor.ts
fix the way we are storing the configuration in each job created in the database. Previously, the part of configuration file for actions was replaced by the action instance information, which in some cases makes the result we see in the database incomprehensible. We now store the action information exactly as it comes from the json file. This fix provides readability and reproducibility.Changes:
jobConfig.example.json
: added configuration for the rabbitMQ actionjobs.controller
: added function to call the relevant actions on job updaterabbitmqaction.ts
: makes a RabbitMQ connection, creates a channel and sends a message in the queueImportant: In order to spin up RabbitMQ, one needs to update the
.env
anddocker-compose.yaml
files inscicat-ci
. These changes have been made indespadam/scicat-ci:dev-docs
fork and should be merged as well.Tests:
To test whether the message has been published, one can login to the RabbitMQ management page on
localhost:15672
with the default credentials and inspect the queue.Notes:
The discussion about whether we should store the full configuration in each job should remain open. Storing configuration per job means that each job can run with different configuration. However, even if this has been implemented in the job schema (see also the fix mentioned above), we tend to not utilize it. More specifically, authorization in
casl-factory
and action initialization are still using the SciCat running instance configuration, instead of the job specific one, which is contradictory.