qualiteer/lib/common/executor/executor-entrypoint.js

15 lines
611 B
JavaScript
Raw Normal View History

2022-07-18 21:43:10 +00:00
import path from "node:path";
2022-10-15 11:47:47 +00:00
import Executor from "../sockets/clients/Executor.js";
2022-07-18 21:43:10 +00:00
import { normalize } from "./executor-configurator.js";
2022-10-15 11:47:47 +00:00
import { configName as executorConfigName } from "./executor-config.js";
const executorConfigPath = path.resolve(executorConfigName);
const { default: executorConfig } = await import(executorConfigPath);
2022-07-18 21:43:10 +00:00
// Load config and args
const args = process.argv.slice(2);
2022-08-09 04:29:10 +00:00
const payload = JSON.parse(Buffer.from(args[0], "base64").toString("utf8"));
const config = normalize(executorConfig(payload));
2022-07-18 21:43:10 +00:00
// Start Executor
2022-08-09 04:29:10 +00:00
const exec = new Executor(config, payload);
2022-07-18 21:43:10 +00:00
exec.runJob();