From 5bb59aa01a43ebe89491af00d6fedb39b75bf0d4 Mon Sep 17 00:00:00 2001 From: Spencer Bliven Date: Mon, 25 Nov 2024 21:42:48 +0100 Subject: [PATCH] Add jobConfig.yaml to be_next container --- dev/config/backend_next/.env | 1 + dev/config/backend_next/jobConfig.yaml | 70 ++++++++++++++++++++++++++ dev/docker-compose.yaml | 5 +- 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 dev/config/backend_next/jobConfig.yaml diff --git a/dev/config/backend_next/.env b/dev/config/backend_next/.env index 5e7757a..71b5501 100644 --- a/dev/config/backend_next/.env +++ b/dev/config/backend_next/.env @@ -16,5 +16,6 @@ CREATE_DATASET_GROUPS=group1,group2,group3 DELETE_GROUPS=archivemanager ACCESS_GROUPS_STATIC_VALUES="ess" CREATE_DATASET_WITH_PID_GROUPS="group2,group3" +JOB_CONFIGURATION_FILE=jobConfig.yaml DATASET_CREATION_VALIDATION_ENABLED=true DATASET_CREATION_VALIDATION_REGEX="^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" diff --git a/dev/config/backend_next/jobConfig.yaml b/dev/config/backend_next/jobConfig.yaml new file mode 100644 index 0000000..8bd1968 --- /dev/null +++ b/dev/config/backend_next/jobConfig.yaml @@ -0,0 +1,70 @@ +configVersion: v1.0 2024-03-01 6f3f38 +jobs: + - jobType: archive + create: + auth: "#datasetOwner" + actions: + - actionType: log + - actionType: url + url: http://localhost:3000/api/v3/health?jobid={{id}} + headers: + accept: application/json + - actionType: rabbitmq + hostname: rabbitmq + port: 5672 + username: guest + password: guest + exchange: jobs.write + queue: client.jobs.write + key: jobqueue + - actionType: email + auth: + user: user + password: password + to: "{{contactEmail}}" + from: from + subject: "[SciCat] Your {{type}} job was submitted successfully" + bodyTemplateFile: src/common/email-templates/job-template-simplified.html + statusUpdate: + auth: archivemanager + actions: + - actionType: rabbitmq + hostname: rabbitmq + port: 5672 + username: guest + password: guest + exchange: jobs.write + queue: client.jobs.write + key: jobqueue + - jobType: public + create: + auth: "#datasetPublic" + actions: + - actionType: validate + request: + jobParams.datasetList[*]: + type: object + required: + - pid + - files + statusUpdate: + auth: archivemanager + - jobType: validate + create: + auth: admin + actions: + - actionType: validate + request: + jobParams.requiredParam: + type: string + jobParams.arrayOfStrings: + type: array + items: + type: string + statusUpdate: + auth: admin + actions: + - actionType: validate + request: + jobResultObject.requiredString: + type: string \ No newline at end of file diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 838ffbf..18a00ad 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -78,7 +78,7 @@ services: profiles: - fe - be_next_base: + be_next_base: build: context: ../scicat-backend-next/. target: dev @@ -89,10 +89,11 @@ services: - /home/node/app/node_modules - /home/node/app/dist - ../scicat-backend-next/functionalAccounts.json.minimal.example:/home/node/app/functionalAccounts.json + - ./config/backend_next/jobConfig.yaml:/home/node/app/jobConfig.yaml env_file: ./config/backend_next/.env command: /bin/sh -c "while true; do sleep 600; done" profiles: - - never + - never test_be_next: extends: be_next_base