Skip to content

Commit

Permalink
podname logs for log service
Browse files Browse the repository at this point in the history
  • Loading branch information
frostebite committed Aug 14, 2023
1 parent 14819a6 commit 2019e73
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 427 deletions.
185 changes: 9 additions & 176 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/model/cloud-runner/providers/k8s/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ProviderResource } from '../provider-resource';
import { ProviderWorkflow } from '../provider-workflow';
import { RemoteClientLogger } from '../../remote-client/remote-client-logger';
import { KubernetesRole } from './kubernetes-role';
import KubernetesLogService from './kubernetes-log-service';
import { CloudRunnerSystem } from '../../services/core/cloud-runner-system';

class Kubernetes implements ProviderInterface {
Expand Down Expand Up @@ -159,8 +158,6 @@ class Kubernetes implements ProviderInterface {
await KubernetesSecret.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);
let output = '';
try {
this.ip =
(await KubernetesLogService.createLogDeployment(this.namespace, this.kubeClientApps, this.kubeClient)) || ``;
CloudRunnerLogger.log('Job does not exist');
await this.createJob(commands, image, mountdir, workingdir, environment, secrets);
CloudRunnerLogger.log('Watching pod until running');
Expand Down Expand Up @@ -271,7 +268,6 @@ class Kubernetes implements ProviderInterface {
CloudRunnerLogger.log(`Build job created`);
await new Promise((promise) => setTimeout(promise, 5000));
CloudRunnerLogger.log('Job created');
await KubernetesLogService.cleanupLogDeployment(this.namespace, this.kubeClientApps, this.kubeClient);

return result.body.metadata?.name;
} catch (error) {
Expand All @@ -292,7 +288,6 @@ class Kubernetes implements ProviderInterface {
await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);
await this.kubeClient.deleteNamespacedPod(this.podName, this.namespace);
await KubernetesRole.deleteRole(this.serviceAccountName, this.namespace, this.rbacAuthorizationV1Api);
await KubernetesLogService.cleanupLogDeployment(this.namespace, this.kubeClientApps, this.kubeClient);
} catch (error: any) {
CloudRunnerLogger.log(`Failed to cleanup`);
if (error.response.body.reason !== `NotFound`) {
Expand Down
Loading

0 comments on commit 2019e73

Please sign in to comment.