aws/k8s smoke test
parent
3b6b36fd5a
commit
2e2fe56bbe
|
@ -3347,12 +3347,13 @@ 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);
|
||||||
const running = yield kubernetes_pods_1.default.IsPodRunning(this.podName, this.namespace, this.kubeClient);
|
const running = yield kubernetes_pods_1.default.IsPodRunning(this.podName, this.namespace, this.kubeClient);
|
||||||
if (!running) {
|
if (!running) {
|
||||||
const podStatus = yield kubernetes_pods_1.default.GetPodStatus(this.podName, this.namespace, this.kubeClient);
|
const podStatus = yield kubernetes_pods_1.default.GetPodStatus(this.podName, this.namespace, this.kubeClient);
|
||||||
cloud_runner_logger_1.default.log(`Pod not found, assumed ended!`);
|
cloud_runner_logger_1.default.log(`Pod not found, assumed ended!`);
|
||||||
if (follow_log_stream_service_1.FollowLogStreamService.DidReceiveEndOfTransmission && podStatus === `Succeeded`) {
|
if (follow_log_stream_service_1.FollowLogStreamService.DidReceiveEndOfTransmission && podStatus === `Succeeded`) {
|
||||||
|
output += yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4012,7 +4013,7 @@ const cloud_runner_statics_1 = __nccwpck_require__(90828);
|
||||||
const async_wait_until_1 = __importDefault(__nccwpck_require__(41299));
|
const async_wait_until_1 = __importDefault(__nccwpck_require__(41299));
|
||||||
const follow_log_stream_service_1 = __nccwpck_require__(64121);
|
const follow_log_stream_service_1 = __nccwpck_require__(64121);
|
||||||
class KubernetesTaskRunner {
|
class KubernetesTaskRunner {
|
||||||
static runTask(kubeConfig, kubeClient, jobName, podName, containerName, namespace) {
|
static runTask(kubeConfig, kubeClient, jobName, podName, containerName, namespace, alreadyFinished = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
||||||
const stream = new stream_1.Writable();
|
const stream = new stream_1.Writable();
|
||||||
|
@ -4064,7 +4065,7 @@ class KubernetesTaskRunner {
|
||||||
const logOptions = {
|
const logOptions = {
|
||||||
follow: true,
|
follow: true,
|
||||||
pretty: false,
|
pretty: false,
|
||||||
previous: false,
|
previous: alreadyFinished,
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
sinceSeconds: KubernetesTaskRunner.lastReceivedTimestamp,
|
sinceSeconds: KubernetesTaskRunner.lastReceivedTimestamp,
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -152,7 +152,7 @@ class Kubernetes implements ProviderInterface {
|
||||||
await KubernetesTaskRunner.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
await KubernetesTaskRunner.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log('Pod running, streaming logs');
|
CloudRunnerLogger.log('Pod running, streaming logs');
|
||||||
output = await KubernetesTaskRunner.runTask(
|
output += await KubernetesTaskRunner.runTask(
|
||||||
this.kubeConfig,
|
this.kubeConfig,
|
||||||
this.kubeClient,
|
this.kubeClient,
|
||||||
this.jobName,
|
this.jobName,
|
||||||
|
@ -166,6 +166,15 @@ class Kubernetes implements ProviderInterface {
|
||||||
const podStatus = await KubernetesPods.GetPodStatus(this.podName, this.namespace, this.kubeClient);
|
const podStatus = await KubernetesPods.GetPodStatus(this.podName, this.namespace, this.kubeClient);
|
||||||
CloudRunnerLogger.log(`Pod not found, assumed ended!`);
|
CloudRunnerLogger.log(`Pod not found, assumed ended!`);
|
||||||
if (FollowLogStreamService.DidReceiveEndOfTransmission && podStatus === `Succeeded`) {
|
if (FollowLogStreamService.DidReceiveEndOfTransmission && podStatus === `Succeeded`) {
|
||||||
|
output += await KubernetesTaskRunner.runTask(
|
||||||
|
this.kubeConfig,
|
||||||
|
this.kubeClient,
|
||||||
|
this.jobName,
|
||||||
|
this.podName,
|
||||||
|
'main',
|
||||||
|
this.namespace,
|
||||||
|
true,
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -15,6 +15,7 @@ class KubernetesTaskRunner {
|
||||||
podName: string,
|
podName: string,
|
||||||
containerName: string,
|
containerName: string,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
|
alreadyFinished: boolean = false,
|
||||||
) {
|
) {
|
||||||
CloudRunnerLogger.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
CloudRunnerLogger.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`);
|
||||||
const stream = new Writable();
|
const stream = new Writable();
|
||||||
|
@ -73,7 +74,7 @@ class KubernetesTaskRunner {
|
||||||
const logOptions = {
|
const logOptions = {
|
||||||
follow: true,
|
follow: true,
|
||||||
pretty: false,
|
pretty: false,
|
||||||
previous: false,
|
previous: alreadyFinished,
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
sinceSeconds: KubernetesTaskRunner.lastReceivedTimestamp,
|
sinceSeconds: KubernetesTaskRunner.lastReceivedTimestamp,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue