fix: k8s stability
parent
82ad5a7fa8
commit
ceedd5808a
|
|
@ -3070,15 +3070,15 @@ class Kubernetes {
|
||||||
yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
||||||
cloud_runner_logger_1.default.log('Pod running, streaming logs');
|
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);
|
output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace);
|
||||||
if (!(yield this.kubeClientBatch.listNamespacedJob(this.namespace)).body.items
|
if (!(yield this.kubeClient.listNamespacedPod(this.namespace)).body.items
|
||||||
.map((x) => { var _a; return ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || undefined; })
|
.map((x) => { var _a; return ((_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name) || undefined; })
|
||||||
.filter((x) => x !== undefined)
|
.filter((x) => x !== undefined)
|
||||||
.includes(this.jobName)) {
|
.includes(this.podName)) {
|
||||||
cloud_runner_logger_1.default.log('Job not found, assumed ended!');
|
cloud_runner_logger_1.default.log('Pod not found, assumed ended!');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cloud_runner_logger_1.default.log('Job still running, recovering stream...');
|
cloud_runner_logger_1.default.log('Pod still running, recovering stream...');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -152,15 +152,15 @@ class Kubernetes implements ProviderInterface {
|
||||||
this.namespace,
|
this.namespace,
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
!(await this.kubeClientBatch.listNamespacedJob(this.namespace)).body.items
|
!(await this.kubeClient.listNamespacedPod(this.namespace)).body.items
|
||||||
.map((x) => x.metadata?.name || undefined)
|
.map((x) => x.metadata?.name || undefined)
|
||||||
.filter((x) => x !== undefined)
|
.filter((x) => x !== undefined)
|
||||||
.includes(this.jobName)
|
.includes(this.podName)
|
||||||
) {
|
) {
|
||||||
CloudRunnerLogger.log('Job not found, assumed ended!');
|
CloudRunnerLogger.log('Pod not found, assumed ended!');
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
CloudRunnerLogger.log('Job still running, recovering stream...');
|
CloudRunnerLogger.log('Pod still running, recovering stream...');
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
CloudRunnerLogger.log('error running k8s workflow');
|
CloudRunnerLogger.log('error running k8s workflow');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue