pull/310/head
Frostebite 2021-12-30 21:00:38 +00:00
parent 312faf5820
commit 4b3df4c3cf
4 changed files with 45 additions and 15 deletions

22
dist/index.js vendored
View File

@ -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;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -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) {

View File

@ -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;