From 5b878b87e8f32615ab8de767ac3bb3435f7b1197 Mon Sep 17 00:00:00 2001 From: ScriptSmith Date: Mon, 5 Aug 2024 09:43:58 +1000 Subject: [PATCH 1/2] Rename isArrayJob and jobInstances --- src/components/tool/guide/Config.js | 4 +- .../EresearchJob/EresearchInstructions.js | 4 +- .../tool/guide/EresearchJob/EresearchJob.js | 39 ++++++++++--------- .../EresearchJob/EresearchJob.stories.js | 4 +- .../HuggingFaceInstructions.js | 4 +- .../guide/Instructions/StartInstructions.js | 12 +++--- 6 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/components/tool/guide/Config.js b/src/components/tool/guide/Config.js index 36f9e6d1..021120c2 100644 --- a/src/components/tool/guide/Config.js +++ b/src/components/tool/guide/Config.js @@ -9,8 +9,8 @@ export const DEFAULT_CONFIG = { ram: 16, gpuModules: 1, wallTime: { hour: 1, minute: 0 }, - isArrayJob: "Standalone", - jobInstances: { firstIndex: 1, upperBound: 10, step: 1 }, + jobInstanceType: "Standalone", + arrayConfig: { firstIndex: 1, upperBound: 10, step: 1 }, }; export const isValidChoice = (choices, value) => { diff --git a/src/components/tool/guide/EresearchJob/EresearchInstructions.js b/src/components/tool/guide/EresearchJob/EresearchInstructions.js index 77c57550..3444e20d 100644 --- a/src/components/tool/guide/EresearchJob/EresearchInstructions.js +++ b/src/components/tool/guide/EresearchJob/EresearchInstructions.js @@ -66,8 +66,8 @@ export function EresearchInstructions({ config }) { gpuModules={config.gpuModules} nodes={config.nodes} wallTime={config.wallTime} - isArrayJob={config.isArrayJob} - jobInstances={config.jobInstances} + jobInstanceType={config.jobInstanceType} + arrayConfig={config.arrayConfig} /> )} diff --git a/src/components/tool/guide/EresearchJob/EresearchJob.js b/src/components/tool/guide/EresearchJob/EresearchJob.js index af4f070d..2d8bd9c9 100644 --- a/src/components/tool/guide/EresearchJob/EresearchJob.js +++ b/src/components/tool/guide/EresearchJob/EresearchJob.js @@ -114,40 +114,41 @@ const getConfigGroups = (config, onConfigChange = () => {}) => { selected: (config) => config?.nodes > 0, }; }, - isArrayJob: () => { - const jobInstances = [ + jobInstanceType: () => { + const arrayConfig = [ ["Standalone", "Run a single instance of the job"], - ["Array", "Run many instances of the job in parallel"], + ["Array", "Run many instances of the job"], ]; return { element: (key, selected) => ( ), show: (config) => config?.service === "Lyra" && config?.jobType === "Batch", - selected: (config) => isValidChoice(jobInstances, config?.isArrayJob), + selected: (config) => + isValidChoice(arrayConfig, config?.jobInstanceType), }; }, - jobInstances: () => { + arrayConfig: () => { return { element: (key, selected) => ( {}) => { show: (config) => config?.service === "Lyra" && config?.jobType === "Batch" && - config?.isArrayJob === "Array", + config?.jobInstanceType === "Array", selected: (config) => - config?.jobInstances.step >= 1 && - config?.jobInstances.upperBound >= config?.jobInstances.firstIndex && - config?.jobInstances.upperBound > config?.jobInstances.step && - config?.jobInstances.upperBound >= - config?.jobInstances.firstIndex + config?.jobInstances.step, + config?.arrayConfig.step >= 1 && + config?.arrayConfig.upperBound >= config?.arrayConfig.firstIndex && + config?.arrayConfig.upperBound > config?.arrayConfig.step && + config?.arrayConfig.upperBound >= + config?.arrayConfig.firstIndex + config?.arrayConfig.step, }; }, wallTime: () => { diff --git a/src/components/tool/guide/EresearchJob/EresearchJob.stories.js b/src/components/tool/guide/EresearchJob/EresearchJob.stories.js index b78424cc..ea19f15b 100644 --- a/src/components/tool/guide/EresearchJob/EresearchJob.stories.js +++ b/src/components/tool/guide/EresearchJob/EresearchJob.stories.js @@ -83,8 +83,8 @@ export const LyraArray = { ...DEFAULT_CONFIG, service: "Lyra", jobType: "Batch", - isArrayJob: "Array", - jobInstances: { firstIndex: 0, upperBound: 1000, step: 100 }, + jobInstanceType: "Array", + arrayConfig: { firstIndex: 0, upperBound: 1000, step: 100 }, hardware: "CPU", cpuVendor: "Any", cpuCores: 4, diff --git a/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js b/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js index 3f6ad205..a7b3d6de 100644 --- a/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js +++ b/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js @@ -58,8 +58,8 @@ export function HuggingFaceInstructions({ task, model, config, port }) { gpuModel={config.gpuModel} gpuModules={config.gpuModules} wallTime={config.wallTime} - isArrayJob={config.isArrayJob} - jobInstances={config.jobInstances} + jobInstanceType={config.jobInstanceType} + arrayConfig={config.arrayConfig} /> 1 - ? ":" + jobInstances?.step + jobType === "Batch" && jobInstanceType === "Array" && arrayConfig?.step > 1 + ? ":" + arrayConfig?.step : "", ]; From 3c197258eef6a43065ac5547a620119a1f173af8 Mon Sep 17 00:00:00 2001 From: ScriptSmith Date: Mon, 5 Aug 2024 09:44:23 +1000 Subject: [PATCH 2/2] Update job config titles --- src/components/tool/guide/Config.js | 8 ++++---- src/components/tool/guide/EresearchJob/EresearchJob.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/tool/guide/Config.js b/src/components/tool/guide/Config.js index 021120c2..3ef4060c 100644 --- a/src/components/tool/guide/Config.js +++ b/src/components/tool/guide/Config.js @@ -61,7 +61,7 @@ export const getCpuVendor = (config, onChange) => () => { element: (key, selected) => ( () => { element: (key, selected) => ( () => { return ( () => { element: (key, selected) => ( {}) => { element: (key, selected) => (