fix
parent
312faf5820
commit
4b3df4c3cf
|
|
@ -1781,9 +1781,24 @@ class Kubernetes {
|
||||||
cloud_runner_logger_1.default.log('Job created');
|
cloud_runner_logger_1.default.log('Job created');
|
||||||
this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||||
cloud_runner_logger_1.default.log('Watching pod until running');
|
cloud_runner_logger_1.default.log('Watching pod until running');
|
||||||
yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
let output = '';
|
||||||
cloud_runner_logger_1.default.log('Pod running, streaming logs');
|
// eslint-disable-next-line no-constant-condition
|
||||||
const output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace, cloud_runner_logger_1.default.log);
|
while (true) {
|
||||||
|
try {
|
||||||
|
yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
||||||
|
cloud_runner_logger_1.default.log('Pod running, streaming logs');
|
||||||
|
output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace, cloud_runner_logger_1.default.log);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
if (error.message.includes(`HTTP`)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
yield this.cleanupTaskResources();
|
yield this.cleanupTaskResources();
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
@ -2539,6 +2554,7 @@ class TaskParameterSerializer {
|
||||||
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
||||||
array = array.map((x) => {
|
array = array.map((x) => {
|
||||||
x.name = __1.Input.ToEnvVarFormat(x.name);
|
x.name = __1.Input.ToEnvVarFormat(x.name);
|
||||||
|
x.value = `${x.value}`;
|
||||||
return x;
|
return x;
|
||||||
});
|
});
|
||||||
return array;
|
return array;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -101,17 +101,30 @@ class Kubernetes implements CloudRunnerProviderInterface {
|
||||||
CloudRunnerLogger.log('Job created');
|
CloudRunnerLogger.log('Job created');
|
||||||
this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
this.setPodNameAndContainerName(await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace));
|
||||||
CloudRunnerLogger.log('Watching pod until running');
|
CloudRunnerLogger.log('Watching pod until running');
|
||||||
await KubernetesTaskRunner.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
let output = '';
|
||||||
CloudRunnerLogger.log('Pod running, streaming logs');
|
// eslint-disable-next-line no-constant-condition
|
||||||
const output = await KubernetesTaskRunner.runTask(
|
while (true) {
|
||||||
this.kubeConfig,
|
try {
|
||||||
this.kubeClient,
|
await KubernetesTaskRunner.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
||||||
this.jobName,
|
CloudRunnerLogger.log('Pod running, streaming logs');
|
||||||
this.podName,
|
output = await KubernetesTaskRunner.runTask(
|
||||||
'main',
|
this.kubeConfig,
|
||||||
this.namespace,
|
this.kubeClient,
|
||||||
CloudRunnerLogger.log,
|
this.jobName,
|
||||||
);
|
this.podName,
|
||||||
|
'main',
|
||||||
|
this.namespace,
|
||||||
|
CloudRunnerLogger.log,
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.message.includes(`HTTP`)) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
await this.cleanupTaskResources();
|
await this.cleanupTaskResources();
|
||||||
return output;
|
return output;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ export class TaskParameterSerializer {
|
||||||
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
||||||
array = array.map((x) => {
|
array = array.map((x) => {
|
||||||
x.name = Input.ToEnvVarFormat(x.name);
|
x.name = Input.ToEnvVarFormat(x.name);
|
||||||
|
x.value = `${x.value}`;
|
||||||
return x;
|
return x;
|
||||||
});
|
});
|
||||||
return array;
|
return array;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue