stream logs through standard input and new remote client cli command

This commit is contained in:
Frostebite 2023-06-06 00:03:06 +01:00
parent 9e7fad6a8a
commit 8a3a366186
5 changed files with 18 additions and 26 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -127,12 +127,14 @@ class Kubernetes implements ProviderInterface {
? CloudRunner.lockedWorkspace
: this.buildParameters.buildGuid;
this.pvcName = `unity-builder-pvc-${id}`;
await KubernetesStorage.createPersistentVolumeClaim(
this.buildParameters,
this.pvcName,
this.kubeClient,
this.namespace,
);
if (process.env['CLOUD_RUNNER_MINIKUBE']) {
await KubernetesStorage.createPersistentVolumeClaim(
this.buildParameters,
this.pvcName,
this.kubeClient,
this.namespace,
);
}
this.buildGuid = buildGuid;
this.secretName = `build-credentials-${this.buildGuid}`;
this.jobName = `unity-builder-job-${this.buildGuid}`;

View File

@ -107,6 +107,16 @@ class KubernetesJobSpecFactory {
},
};
if (process.env['CLOUD_RUNNER_MINIKUBE']) {
job.spec.template.spec.volumes[0] = {
name: 'build-mount',
hostPath: {
path: `/data`,
type: `Directory`,
},
};
}
job.spec.template.spec.containers[0].resources.requests[`ephemeral-storage`] = '10Gi';
return job;

View File

@ -94,27 +94,7 @@ class KubernetesStorage {
},
},
};
if (process.env['CLOUD_RUNNER_MINIKUBE']) {
pvc.spec.storageClassName = `manual`;
}
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
if (process.env['CLOUD_RUNNER_MINIKUBE']) {
const hostPathVolume = {
metadata: {
name: `${pvcName}-volume`,
labels: {
type: `local`,
},
},
spec: {
storageClassName: `manual`,
capacity: { storage: `5Gi` },
accessModes: ['ReadWriteOnce'],
hostPath: { path: `/data/${pvcName}` },
},
};
await kubeClient.createPersistentVolume(hostPathVolume);
}
return result;
}