Revamp Job flow
This commit is contained in:
parent
945afdfbbe
commit
4a0a4b29a5
86 changed files with 592 additions and 608 deletions
20
lib/server/k8s/k8s-internal.js
Normal file
20
lib/server/k8s/k8s-internal.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import cp from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { jobBuilder, createFile, deleteFile } from "./k8s-common.js";
|
||||
|
||||
// Constants
|
||||
const internalEngine = path.resolve("./lib/jobs/k8s/k8s-internal-engine.js");
|
||||
|
||||
// Functions
|
||||
const applyFileInternally = (filePath) => {
|
||||
const job = fs.readFileSync(filePath, { encoding: "utf8" });
|
||||
cp.fork(internalEngine, [job]);
|
||||
};
|
||||
|
||||
export default async function createJobInternally(jobRequest) {
|
||||
const job = jobBuilder(jobRequest);
|
||||
const filePath = createFile(job);
|
||||
applyFileInternally(filePath);
|
||||
deleteFile(filePath);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue