Skip to content
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

Job Status Update: Implement RabbitMQ Action #1284

Merged
merged 6 commits into from
Jul 22, 2024

Conversation

despadam
Copy link
Member

@despadam despadam commented Jun 26, 2024

Description

Fixes #1121

Motivation

The RabbitMQ action is a requirement for PSI

Fixes:

The changes made in JobOperation class in jobconfig.ts and in job-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 action
  • jobs.controller: added function to call the relevant actions on job update
  • rabbitmqaction.ts: makes a RabbitMQ connection, creates a channel and sends a message in the queue

Important: In order to spin up RabbitMQ, one needs to update the .env and docker-compose.yaml files in scicat-ci. These changes have been made in despadam/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.

@despadam despadam changed the title implement rabbitmq action Job Status Update: Implement RabbitMQ Action Jun 26, 2024
@despadam despadam self-assigned this Jun 26, 2024
@despadam despadam added Release Jobs Jobs migration labels Jun 26, 2024
@despadam despadam requested review from sbliven and nitrosx June 26, 2024 10:40
src/jobs/actions/rabbitmqaction.ts Outdated Show resolved Hide resolved
src/jobs/actions/rabbitmqaction.ts Outdated Show resolved Hide resolved
src/jobs/actions/rabbitmqaction.ts Outdated Show resolved Hide resolved
src/jobs/interceptors/job-create.interceptor.ts Outdated Show resolved Hide resolved
@despadam despadam requested review from nitrosx and Junjiequan July 1, 2024 08:51
@despadam despadam merged commit a1dfaf6 into release-jobs Jul 22, 2024
1 check passed
@despadam despadam deleted the 1121-implement-rabbitmq-action branch July 22, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Jobs Jobs migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants