great-greece-44955
05/26/2024, 5:02 PMconst k8sEnvironmentVariables: EnvVar[] = [
{
name: "ENV_AWS",
value: stack,
},
{
name: "PRIMARY_MONGODB_URI",
value: mongoDbUri,
},
];
const createJob = (name: string, env: EnvVar[], arraySize: number = 1, commandArgs: string[] = []): k8s.batch.v1.Job => {
const jobName = `${camelToKebabCase((name))}-job`;
return new k8s.batch.v1.Job(jobName, {
metadata: {
name: jobName,
},
spec: {
parallelism: arraySize,
completionMode: "Indexed",
template: {
spec: {
containers: [
{
name: "batch-job",
image: image.imageName,
command: ["/bin/sh", `/usr/local/bin/hkracing-batch${name}.sh`].concat(commandArgs),
env: env.concat([
{
name: "BATCH_JOB_ARRAY_SIZE",
value: arraySize.toString(),
},
]),
},
],
restartPolicy: "Never",
},
},
},
}, {provider: k8sProvider, dependsOn: [cluster, nodePool]});
}
const createFeatureBuildJob = (): k8s.batch.v1.Job => {
return createJob("FeatureBuild",
k8sEnvironmentVariables.concat(
{
name: "ST_TURF_MODEL_ID",
value: "5fdb6e19b1cede6138bb3437",
},
{
name: "LOCAL_MONGODB_URI",
value: "<mongodb://localhost/hkr>"
},
),
10, [
"20150901",
"20240428",
"5fdb67e7321e254e58378340",
"RunFeature",
]);
};
const featureBuildJob = createFeatureBuildJob();
modern-zebra-45309
05/26/2024, 5:42 PMgreat-greece-44955
05/26/2024, 11:22 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by