From b154da79c834c0a4d7dc758d9a040dc63db17722 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:13:55 +0100 Subject: [PATCH 1/4] Tags subset fix --- .../tools/tagsWorkerType/1.0.0/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts index 7431802..4348e5b 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts @@ -109,22 +109,26 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { let isSubset = true; - for (let i = 0; i < currentTags.length; i += 1) { - if (!requiredTags.includes(currentTags[i])) { + for (let i = 0; i < requiredTags.length; i += 1) { + if (!currentTags.includes(requiredTags[i])) { isSubset = false; break; } } + // requiredTags needs to be subset of currentTags + args.jobLog(`Current tags: ${currentTags}`); + args.jobLog(`Required tags: ${requiredTags}`); + args.jobLog(`Is Subset: ${isSubset}`); if (isSubset) { // eslint-disable-next-line no-param-reassign args.variables.queueTags = ''; - args.jobLog('Worker type and tags are subset of required tags'); + args.jobLog('Required tags are subset of current tags, continuing to next plugin.'); } else { + args.jobLog('Required tags are not subset of current tags, requeueing.'); // eslint-disable-next-line no-param-reassign args.variables.queueTags = requiredTags.join(','); - args.jobLog('Worker type and tags are not subset of required tags,' - + ` requeueing with tags ${args.variables.queueTags}`); + args.jobLog(`Requeueing with tags ${args.variables.queueTags}`); } return { From 717911cd806212ad51eb4f9ca67ad8507cb3fd79 Mon Sep 17 00:00:00 2001 From: HaveAGitGat Date: Mon, 10 Jun 2024 11:16:02 +0000 Subject: [PATCH 2/4] Apply auto-build changes --- .../tools/tagsWorkerType/1.0.0/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js index 476e401..e69a37c 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js @@ -91,22 +91,26 @@ var plugin = function (args) { args.jobLog("Required Tags: ".concat(requiredTags.join(','))); args.jobLog("Current Tags: ".concat(currentTags.join(','))); var isSubset = true; - for (var i = 0; i < currentTags.length; i += 1) { - if (!requiredTags.includes(currentTags[i])) { + for (var i = 0; i < requiredTags.length; i += 1) { + if (!currentTags.includes(requiredTags[i])) { isSubset = false; break; } } + // requiredTags needs to be subset of currentTags + args.jobLog("Current tags: ".concat(currentTags)); + args.jobLog("Required tags: ".concat(requiredTags)); + args.jobLog("Is Subset: ".concat(isSubset)); if (isSubset) { // eslint-disable-next-line no-param-reassign args.variables.queueTags = ''; - args.jobLog('Worker type and tags are subset of required tags'); + args.jobLog('Required tags are subset of current tags, continuing to next plugin.'); } else { + args.jobLog('Required tags are not subset of current tags, requeueing.'); // eslint-disable-next-line no-param-reassign args.variables.queueTags = requiredTags.join(','); - args.jobLog('Worker type and tags are not subset of required tags,' - + " requeueing with tags ".concat(args.variables.queueTags)); + args.jobLog("Requeueing with tags ".concat(args.variables.queueTags)); } return { outputFileObj: args.inputFileObj, From 031ff103727c0b63a188d052b7bc83c2ec15ef55 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:18:52 +0100 Subject: [PATCH 3/4] Update tag plugin descriptions --- .../CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.ts | 2 +- .../CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.ts index 27339fc..6cbd519 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.ts @@ -20,7 +20,7 @@ Subsequent tags must not use the reserved word 'require' in them. You can set the 'Node Tags' in the Node options panel. -The the item tags in the staging section must be a subset of the required tags for a worker to process the file. +A worker will only process a file if the Custom Queue Tags are a subset of the Worker/Node Tags `, style: { borderColor: 'yellow', diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts index 4348e5b..3e0acef 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.ts @@ -13,7 +13,8 @@ does not match the required worker type and tags. You can set the 'Node Tags' in the Node options panel. -The current tags must be a subset of the required tags. +The required tags must be a subset of the current tags for the current worker to process the item, +else the item will be requeued with the required tags. `, style: { borderColor: 'yellow', From e07ebeaa7bb5b01ee4c8716cca1f8106536ed1f2 Mon Sep 17 00:00:00 2001 From: HaveAGitGat Date: Mon, 10 Jun 2024 11:21:51 +0000 Subject: [PATCH 4/4] Apply auto-build changes --- .../CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.js | 2 +- .../CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.js index 99fd758..2c90c6d 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/tagsRequeue/1.0.0/index.js @@ -4,7 +4,7 @@ exports.plugin = exports.details = void 0; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ var details = function () { return ({ name: 'Tags: Requeue', - description: "\nPlace the file back in the staging queue with specific tags.\n\nOnly Nodes/Workers which match the tags will be able to process the file.\n\nThe tags must have one of the following: 'requireCPU', 'requireGPU', or 'requireCPUorGPU'.\n\nThe above tells the server what type of worker is required to process the file.\n\nSubsequent tags must not use the reserved word 'require' in them.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nThe the item tags in the staging section must be a subset of the required tags for a worker to process the file.\n", + description: "\nPlace the file back in the staging queue with specific tags.\n\nOnly Nodes/Workers which match the tags will be able to process the file.\n\nThe tags must have one of the following: 'requireCPU', 'requireGPU', or 'requireCPUorGPU'.\n\nThe above tells the server what type of worker is required to process the file.\n\nSubsequent tags must not use the reserved word 'require' in them.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nA worker will only process a file if the Custom Queue Tags are a subset of the Worker/Node Tags\n", style: { borderColor: 'yellow', }, diff --git a/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js index e69a37c..247b8de 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/tagsWorkerType/1.0.0/index.js @@ -4,7 +4,7 @@ exports.plugin = exports.details = void 0; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ var details = function () { return ({ name: 'Tags: Worker Type', - description: "\nRequeues the item into the staging section if the current worker\ndoes not match the required worker type and tags.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nThe current tags must be a subset of the required tags.\n ", + description: "\nRequeues the item into the staging section if the current worker\ndoes not match the required worker type and tags.\n\nYou can set the 'Node Tags' in the Node options panel.\n\nThe required tags must be a subset of the current tags for the current worker to process the item,\nelse the item will be requeued with the required tags.\n ", style: { borderColor: 'yellow', },