Better locking
parent
728801a531
commit
2bfe623bb7
|
|
@ -2972,11 +2972,13 @@ class Kubernetes {
|
|||
this.secretName = `build-credentials-${buildGuid}`;
|
||||
this.jobName = `unity-builder-job-${buildGuid}`;
|
||||
this.containerName = `main`;
|
||||
cloud_runner_logger_1.default.log(`Creating build Secret ${JSON.stringify(this.secretName, undefined, 4)}`);
|
||||
yield kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
||||
const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s);
|
||||
cloud_runner_logger_1.default.log(`Creating build job ${JSON.stringify(jobSpec, undefined, 4)}`);
|
||||
// Run
|
||||
const jobResult = yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
||||
cloud_runner_logger_1.default.log(`Creating build job ${JSON.stringify(jobResult.body.metadata, undefined, 4)}`);
|
||||
cloud_runner_logger_1.default.log(`Created build job ${JSON.stringify(jobResult.body.metadata, undefined, 4)}`);
|
||||
yield new Promise((promise) => setTimeout(promise, 5000));
|
||||
cloud_runner_logger_1.default.log('Job created');
|
||||
this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -95,6 +95,7 @@ class Kubernetes implements ProviderInterface {
|
|||
this.secretName = `build-credentials-${buildGuid}`;
|
||||
this.jobName = `unity-builder-job-${buildGuid}`;
|
||||
this.containerName = `main`;
|
||||
CloudRunnerLogger.log(`Creating build Secret ${JSON.stringify(this.secretName, undefined, 4)}`);
|
||||
await KubernetesSecret.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
|
||||
const jobSpec = KubernetesJobSpecFactory.getJobSpec(
|
||||
commands,
|
||||
|
|
@ -110,10 +111,11 @@ class Kubernetes implements ProviderInterface {
|
|||
this.jobName,
|
||||
k8s,
|
||||
);
|
||||
CloudRunnerLogger.log(`Creating build job ${JSON.stringify(jobSpec, undefined, 4)}`);
|
||||
|
||||
// Run
|
||||
const jobResult = await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);
|
||||
CloudRunnerLogger.log(`Creating build job ${JSON.stringify(jobResult.body.metadata, undefined, 4)}`);
|
||||
CloudRunnerLogger.log(`Created build job ${JSON.stringify(jobResult.body.metadata, undefined, 4)}`);
|
||||
|
||||
await new Promise((promise) => setTimeout(promise, 5000));
|
||||
CloudRunnerLogger.log('Job created');
|
||||
|
|
|
|||
Loading…
Reference in New Issue