From aa12e52652d34c8ffbae46e270002f650b169fc5 Mon Sep 17 00:00:00 2001 From: ScriptSmith Date: Mon, 26 Aug 2024 13:23:10 +1000 Subject: [PATCH] Add section explaining how to view job results --- .../EresearchJob/EresearchInstructions.js | 39 ++-- .../HuggingFaceInstructions.js | 7 +- .../guide/Instructions/StartInstructions.js | 101 +-------- .../guide/Instructions/StatusInstructions.js | 201 ++++++++++++++++++ 4 files changed, 231 insertions(+), 117 deletions(-) create mode 100644 src/components/tool/guide/Instructions/StatusInstructions.js diff --git a/src/components/tool/guide/EresearchJob/EresearchInstructions.js b/src/components/tool/guide/EresearchJob/EresearchInstructions.js index c5791436..185613f1 100644 --- a/src/components/tool/guide/EresearchJob/EresearchInstructions.js +++ b/src/components/tool/guide/EresearchJob/EresearchInstructions.js @@ -9,6 +9,7 @@ import { LyraStartInstructions, RvdiStartInstructions, } from "../Instructions/StartInstructions"; +import { LyraStatusInstructions } from "../Instructions/StatusInstructions"; import { TeardownInstructions } from "../Instructions/TeardownInstructions"; const TEXT_PATTERN = /^[a-z0-9]*$/; @@ -53,22 +54,28 @@ export function EresearchInstructions({ config }) { {config.service === "Lyra" && ( <> {batchJobName && ( - + <> + + + )} )} diff --git a/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js b/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js index f76b0af6..1c09256d 100644 --- a/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js +++ b/src/components/tool/guide/HuggingFacePipeline/HuggingFaceInstructions.js @@ -1,4 +1,4 @@ -import { Box } from "@chakra-ui/react"; +import { Box, Code } from "@chakra-ui/react"; import { useState } from "react"; @@ -15,6 +15,7 @@ import { RvdiStartInstructions, } from "../Instructions/StartInstructions"; import { TeardownInstructions } from "../Instructions/TeardownInstructions"; +import InstructionText from "../Instructions/components/InstructionText"; const TEXT_PATTERN = /^[a-z0-9]*$/; @@ -55,6 +56,10 @@ export function HuggingFaceInstructions({ task, model, config, port }) { jobInstanceType={config.jobInstanceType} arrayConfig={config.arrayConfig} /> + + Wait for the job to start, and take note of the node you are on (eg.{" "} + cl5n042). + Ctrl + D to submit the job. )} - Job status - - The job has been scheduled and will start running when resources are - available. - - {jobType === "Interactive" && ( - <> - - Wait for the job to start, and take note of the node you are on (eg.{" "} - cl5n042). - - - )} - {jobType === "Batch" && ( - <> - - You can check the status of your jobs by running the following - command: - - qstat -xu $USER - - The output will look similar to the following: - - - {`pbs: - Req'd Req'd Elap -Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time ------------ -------- ----- -------- ------ --- --- ------ ----- - ----- -1234567.pbs username quick job-name -- 1 4 32gb 01:00 Q --`} - - - The job status will be shown in the S column. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StatusDescription
- Q - Queued
- R - Running
- B - Array job has at least one subjob running
- H - Held
- S - Suspended
- E - Exiting
- F - Finished
-
- - )} ); } diff --git a/src/components/tool/guide/Instructions/StatusInstructions.js b/src/components/tool/guide/Instructions/StatusInstructions.js new file mode 100644 index 00000000..ecc27dff --- /dev/null +++ b/src/components/tool/guide/Instructions/StatusInstructions.js @@ -0,0 +1,201 @@ +import { Code, Table, Tbody, Td, Text, Th, Thead, Tr } from "@chakra-ui/react"; + +import { useState } from "react"; + +import CopyBox from "../../../output/CopyBox"; +import InstructionInput from "./InstructionInput"; +import InstructionHeading from "./components/InstructionHeading"; +import InstructionText from "./components/InstructionText"; + +export function LyraStatusInstructions({ jobType, jobName }) { + const [jobId, setJobId] = useState(""); + const jobIdOrPlaceholder = jobId || "1234567"; + return ( + <> + + The job has been scheduled and will start running when resources are + available. + + {jobType === "Batch" && ( + <> + + Job status + + You can check the status of your jobs by running the following + command: + + qstat -xu $USER + + The output will look similar to the following: + + + {`pbs: + Req'd Req'd Elap +Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time +----------- -------- ----- -------- ------ --- --- ------ ----- - ----- +1234567.pbs username quick job-name -- 1 4 32gb 01:00 Q --`} + + + The job status will be shown in the S column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StatusDescription
+ Q + Queued
+ R + Running
+ B + Array job has at least one subjob running
+ H + Held
+ S + Suspended
+ E + Exiting
+ F + Finished
+ Job results + + The output of the job will be saved in a file named{" "} + + {jobName}.o{jobIdOrPlaceholder} + {" "} + in the same directory that the job was submitted from. + + + {`$ ls +${jobName}.e${jobIdOrPlaceholder} ${jobName}.o${jobIdOrPlaceholder} + +$ cat ${jobName}.o${jobIdOrPlaceholder} +Hello, world! +PBS Job ${jobIdOrPlaceholder}.pbs +CPU time : 00:00:00 +Wall time : 00:00:01 +Mem usage : 0b + +$ cat ${jobName}.e${jobIdOrPlaceholder} +Data written to stderr`} + + + Use the following command to get more detailed information about the + job, including resource usage. + + {`qstat -fx ${jobIdOrPlaceholder}`} + + Observe the resource usage of the job and adjust the requested + resources in future job submissions accordingly. The output will + look similar to the following: + + + {`$ qstat -fx ${jobIdOrPlaceholder} +Job Id: ${jobIdOrPlaceholder}.pbs + ... + resources_used.cpupercent = 99 + resources_used.cput = 00:39:22 + resources_used.mem = 5671036kb + resources_used.ncpus = 1 + resources_used.vmem = 2755392kb + resources_used.walltime = 00:40:51 + ...`} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ResourceDescription
+ cpupercent + + Sum of the percentage of CPU time used by each requested core. + (eg. 75% of each of 4 cores = 300) +
+ cput + + Sum of the CPU time used by each requested core. (eg. 1 hour + using 4 cores = 04:00:00) +
+ mem + Maximum memory used by the job.
+ ncpus + Number of cores used by the job.
+ vmem + Maximum virtual memory used by the job.
+ walltime + Actual time the job was running.
+ + )} + + ); +}