Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
0c82a58873 | |
|
|
1d4ee0697f |
|
|
@ -66,10 +66,6 @@ namespace UnityBuilderAction
|
||||||
var buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>(buildProfilePath)
|
var buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>(buildProfilePath)
|
||||||
?? throw new Exception("Build profile file not found at path: " + buildProfilePath);
|
?? throw new Exception("Build profile file not found at path: " + buildProfilePath);
|
||||||
|
|
||||||
#if !BUILD_PROFILE_LOADED
|
|
||||||
throw new Exception("Build profile's define symbol not present before script execution; shouldn't happen");
|
|
||||||
#endif // BUILD_PROFILE_LOADED
|
|
||||||
|
|
||||||
// no need to set active profile, as already set by `-activeBuildProfile` CLI argument
|
// no need to set active profile, as already set by `-activeBuildProfile` CLI argument
|
||||||
// BuildProfile.SetActiveBuildProfile(buildProfile);
|
// BuildProfile.SetActiveBuildProfile(buildProfile);
|
||||||
Debug.Log($"build profile: {buildProfile.name}");
|
Debug.Log($"build profile: {buildProfile.name}");
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@ class BuildParameters {
|
||||||
kubeConfig: cloud_runner_options_1.default.kubeConfig,
|
kubeConfig: cloud_runner_options_1.default.kubeConfig,
|
||||||
containerMemory: cloud_runner_options_1.default.containerMemory,
|
containerMemory: cloud_runner_options_1.default.containerMemory,
|
||||||
containerCpu: cloud_runner_options_1.default.containerCpu,
|
containerCpu: cloud_runner_options_1.default.containerCpu,
|
||||||
|
containerNamespace: cloud_runner_options_1.default.containerNamespace,
|
||||||
kubeVolumeSize: cloud_runner_options_1.default.kubeVolumeSize,
|
kubeVolumeSize: cloud_runner_options_1.default.kubeVolumeSize,
|
||||||
kubeVolume: cloud_runner_options_1.default.kubeVolume,
|
kubeVolume: cloud_runner_options_1.default.kubeVolume,
|
||||||
postBuildContainerHooks: cloud_runner_options_1.default.postBuildContainerHooks,
|
postBuildContainerHooks: cloud_runner_options_1.default.postBuildContainerHooks,
|
||||||
|
|
@ -1220,6 +1221,9 @@ class CloudRunnerOptions {
|
||||||
static get containerMemory() {
|
static get containerMemory() {
|
||||||
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
||||||
}
|
}
|
||||||
|
static get containerNamespace() {
|
||||||
|
return CloudRunnerOptions.getInput('containerNamespace') || `default`;
|
||||||
|
}
|
||||||
static get customJob() {
|
static get customJob() {
|
||||||
return CloudRunnerOptions.getInput('customJob') || '';
|
return CloudRunnerOptions.getInput('customJob') || '';
|
||||||
}
|
}
|
||||||
|
|
@ -3372,7 +3376,6 @@ const remote_client_logger_1 = __nccwpck_require__(59412);
|
||||||
const kubernetes_role_1 = __nccwpck_require__(88231);
|
const kubernetes_role_1 = __nccwpck_require__(88231);
|
||||||
const cloud_runner_system_1 = __nccwpck_require__(4197);
|
const cloud_runner_system_1 = __nccwpck_require__(4197);
|
||||||
class Kubernetes {
|
class Kubernetes {
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
constructor(buildParameters) {
|
constructor(buildParameters) {
|
||||||
this.buildGuid = '';
|
this.buildGuid = '';
|
||||||
this.pvcName = '';
|
this.pvcName = '';
|
||||||
|
|
@ -3390,7 +3393,7 @@ class Kubernetes {
|
||||||
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
||||||
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
||||||
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
||||||
this.namespace = 'default';
|
this.namespace = buildParameters.containerNamespace ? buildParameters.containerNamespace : 'default';
|
||||||
cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment');
|
cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment');
|
||||||
}
|
}
|
||||||
async PushLogUpdate(logs) {
|
async PushLogUpdate(logs) {
|
||||||
|
|
@ -4070,8 +4073,8 @@ class KubernetesTaskRunner {
|
||||||
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}`);
|
cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}`);
|
||||||
let extraFlags = ``;
|
let extraFlags = ``;
|
||||||
extraFlags += (await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient))
|
extraFlags += (await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient))
|
||||||
? ` -f -c ${containerName}`
|
? ` -f -c ${containerName} -n ${namespace}`
|
||||||
: ` --previous`;
|
: ` --previous -n ${namespace}`;
|
||||||
const callback = (outputChunk) => {
|
const callback = (outputChunk) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
// split output chunk and handle per line
|
// split output chunk and handle per line
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -59,6 +59,7 @@ class BuildParameters {
|
||||||
public kubeConfig!: string;
|
public kubeConfig!: string;
|
||||||
public containerMemory!: string;
|
public containerMemory!: string;
|
||||||
public containerCpu!: string;
|
public containerCpu!: string;
|
||||||
|
public containerNamespace!: string;
|
||||||
public kubeVolumeSize!: string;
|
public kubeVolumeSize!: string;
|
||||||
public kubeVolume!: string;
|
public kubeVolume!: string;
|
||||||
public kubeStorageClass!: string;
|
public kubeStorageClass!: string;
|
||||||
|
|
@ -187,6 +188,7 @@ class BuildParameters {
|
||||||
kubeConfig: CloudRunnerOptions.kubeConfig,
|
kubeConfig: CloudRunnerOptions.kubeConfig,
|
||||||
containerMemory: CloudRunnerOptions.containerMemory,
|
containerMemory: CloudRunnerOptions.containerMemory,
|
||||||
containerCpu: CloudRunnerOptions.containerCpu,
|
containerCpu: CloudRunnerOptions.containerCpu,
|
||||||
|
containerNamespace: CloudRunnerOptions.containerNamespace,
|
||||||
kubeVolumeSize: CloudRunnerOptions.kubeVolumeSize,
|
kubeVolumeSize: CloudRunnerOptions.kubeVolumeSize,
|
||||||
kubeVolume: CloudRunnerOptions.kubeVolume,
|
kubeVolume: CloudRunnerOptions.kubeVolume,
|
||||||
postBuildContainerHooks: CloudRunnerOptions.postBuildContainerHooks,
|
postBuildContainerHooks: CloudRunnerOptions.postBuildContainerHooks,
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,10 @@ class CloudRunnerOptions {
|
||||||
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
return CloudRunnerOptions.getInput('containerMemory') || `3072`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get containerNamespace(): string {
|
||||||
|
return CloudRunnerOptions.getInput('containerNamespace') || `default`;
|
||||||
|
}
|
||||||
|
|
||||||
static get customJob(): string {
|
static get customJob(): string {
|
||||||
return CloudRunnerOptions.getInput('customJob') || '';
|
return CloudRunnerOptions.getInput('customJob') || '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ class Kubernetes implements ProviderInterface {
|
||||||
public serviceAccountName: string = '';
|
public serviceAccountName: string = '';
|
||||||
public ip: string = '';
|
public ip: string = '';
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
constructor(buildParameters: BuildParameters) {
|
constructor(buildParameters: BuildParameters) {
|
||||||
Kubernetes.Instance = this;
|
Kubernetes.Instance = this;
|
||||||
this.kubeConfig = new k8s.KubeConfig();
|
this.kubeConfig = new k8s.KubeConfig();
|
||||||
|
|
@ -46,7 +45,7 @@ class Kubernetes implements ProviderInterface {
|
||||||
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
this.kubeClientApps = this.kubeConfig.makeApiClient(k8s.AppsV1Api);
|
||||||
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
||||||
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
this.rbacAuthorizationV1Api = this.kubeConfig.makeApiClient(k8s.RbacAuthorizationV1Api);
|
||||||
this.namespace = 'default';
|
this.namespace = buildParameters.containerNamespace ? buildParameters.containerNamespace : 'default';
|
||||||
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ class KubernetesTaskRunner {
|
||||||
);
|
);
|
||||||
let extraFlags = ``;
|
let extraFlags = ``;
|
||||||
extraFlags += (await KubernetesPods.IsPodRunning(podName, namespace, kubeClient))
|
extraFlags += (await KubernetesPods.IsPodRunning(podName, namespace, kubeClient))
|
||||||
? ` -f -c ${containerName}`
|
? ` -f -c ${containerName} -n ${namespace}`
|
||||||
: ` --previous`;
|
: ` --previous -n ${namespace}`;
|
||||||
|
|
||||||
const callback = (outputChunk: string) => {
|
const callback = (outputChunk: string) => {
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue