@catladder/cli 0.0.0-main-44c3ecb9 → 0.0.0-main-a9a79739

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4192,6 +4192,65 @@ const requiresBeta = (config) => {
4192
4192
 
4193
4193
  /***/ }),
4194
4194
 
4195
+ /***/ 7709:
4196
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4197
+
4198
+ "use strict";
4199
+
4200
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
4201
+ exports.getWorkerPoolDeleteScript = exports.getWorkerPoolDeployScript = void 0;
4202
+ const getLabels_1 = __nccwpck_require__(482);
4203
+ const createArgsString_1 = __nccwpck_require__(5516);
4204
+ const getJobOrServiceArgs_1 = __nccwpck_require__(2790);
4205
+ const getServiceName_1 = __nccwpck_require__(6428);
4206
+ const common_1 = __nccwpck_require__(4884);
4207
+ const constants_1 = __nccwpck_require__(7180);
4208
+ const volumes_1 = __nccwpck_require__(7770);
4209
+ const getWorkerPoolDeployScript = (context, workerPool, nameSuffix) => {
4210
+ var _a, _b, _c, _d;
4211
+ const commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
4212
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
4213
+ const command = workerPool.command;
4214
+ const commandArray = Array.isArray(command) ? command : command.split(" ");
4215
+ const fullWorkerPoolName = `${serviceName}-${nameSuffix}`;
4216
+ const argsString = (0, createArgsString_1.createArgsString)({
4217
+ command: '"' + commandArray.join(",") + '"',
4218
+ args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(workerPool.args),
4219
+ ...commonDeployArgs,
4220
+ image: (_a = workerPool.image) !== null && _a !== void 0 ? _a : commonDeployArgs.image,
4221
+ labels: (0, common_1.makeLabelString)({
4222
+ ...(0, getLabels_1.getLabels)(context),
4223
+ "cloud-run-worker-pool-name": fullWorkerPoolName,
4224
+ }),
4225
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
4226
+ instances: (_b = workerPool.instances) !== null && _b !== void 0 ? _b : 1,
4227
+ cpu: (_c = workerPool.cpu) !== null && _c !== void 0 ? _c : 1,
4228
+ memory: (_d = workerPool.memory) !== null && _d !== void 0 ? _d : "512Mi",
4229
+ "vpc-connector": workerPool.vpcConnector,
4230
+ "vpc-egress": workerPool.vpcEgress,
4231
+ network: workerPool.network,
4232
+ subnet: workerPool.subnet,
4233
+ gpu: workerPool.gpu,
4234
+ "gpu-type": workerPool.gpuType,
4235
+ }, ...(0, volumes_1.createVolumeConfig)(workerPool.volumes, "worker-pool"));
4236
+ // Worker pools are in beta and require the beta command
4237
+ return `${(0, common_1.gcloudRunCmd)("beta")} worker-pools deploy ${fullWorkerPoolName} ${argsString}`;
4238
+ };
4239
+ exports.getWorkerPoolDeployScript = getWorkerPoolDeployScript;
4240
+ const getWorkerPoolDeleteScript = (context, workerPoolSuffix) => {
4241
+ const commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
4242
+ const commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
4243
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
4244
+ const fullWorkerPoolName = `${serviceName}-${workerPoolSuffix}`;
4245
+ return [
4246
+ `${(0, common_1.gcloudRunCmd)("beta")} worker-pools delete ${fullWorkerPoolName} ${commonArgsString}`,
4247
+ ];
4248
+ };
4249
+ exports.getWorkerPoolDeleteScript = getWorkerPoolDeleteScript;
4250
+ //# sourceMappingURL=cloudRunWorkerPools.js.map
4251
+
4252
+ /***/ }),
4253
+
4195
4254
  /***/ 4884:
4196
4255
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
4197
4256
 
@@ -4516,11 +4575,12 @@ const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(1201);
4516
4575
  const cloudRunJobs_1 = __nccwpck_require__(2579);
4517
4576
  const onDeploy_1 = __nccwpck_require__(9099);
4518
4577
  const cloudRunServices_1 = __nccwpck_require__(675);
4578
+ const cloudRunWorkerPools_1 = __nccwpck_require__(7709);
4519
4579
  const common_1 = __nccwpck_require__(4884);
4520
4580
  const constants_1 = __nccwpck_require__(7180);
4521
4581
  const schedules_1 = __nccwpck_require__(1503);
4522
4582
  function getCloudRunDeployScripts(context) {
4523
- var _a;
4583
+ var _a, _b;
4524
4584
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
4525
4585
  const allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
4526
4586
  return [
@@ -4542,6 +4602,9 @@ function getCloudRunDeployScripts(context) {
4542
4602
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
4543
4603
  .filter(([_, service]) => service !== false && service !== null)
4544
4604
  .map(([name, service]) => (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name)),
4605
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
4606
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
4607
+ .map(([name, workerPool]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeployScript)(context, workerPool, name)),
4545
4608
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postDeploy"),
4546
4609
  ]),
4547
4610
  ...(0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy")),
@@ -4566,9 +4629,10 @@ const cloudRunJobs_1 = __nccwpck_require__(2579);
4566
4629
  const onDeploy_1 = __nccwpck_require__(9099);
4567
4630
  const schedules_1 = __nccwpck_require__(1503);
4568
4631
  const cloudRunServices_1 = __nccwpck_require__(675);
4632
+ const cloudRunWorkerPools_1 = __nccwpck_require__(7709);
4569
4633
  const common_1 = __nccwpck_require__(4884);
4570
4634
  function getCloudRunStopScripts(context) {
4571
- var _a;
4635
+ var _a, _b;
4572
4636
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
4573
4637
  return [
4574
4638
  ...(0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context),
@@ -4577,6 +4641,9 @@ function getCloudRunStopScripts(context) {
4577
4641
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
4578
4642
  .filter(([_, service]) => service !== false && service !== null)
4579
4643
  .flatMap(([name]) => (0, cloudRunServices_1.getServiceDeleteScript)(context, name)),
4644
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
4645
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
4646
+ .flatMap(([name]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeleteScript)(context, name)),
4580
4647
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postStop"),
4581
4648
  ...(0, schedules_1.getDeleteSchedulesScript)(context),
4582
4649
  ...(0, cloudRunJobs_1.getDeleteJobsScripts)(context),
@@ -7458,6 +7458,65 @@ const requiresBeta = (config) => {
7458
7458
 
7459
7459
  /***/ }),
7460
7460
 
7461
+ /***/ 10090:
7462
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7463
+
7464
+ "use strict";
7465
+
7466
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7467
+ exports.getWorkerPoolDeleteScript = exports.getWorkerPoolDeployScript = void 0;
7468
+ const getLabels_1 = __nccwpck_require__(70482);
7469
+ const createArgsString_1 = __nccwpck_require__(35516);
7470
+ const getJobOrServiceArgs_1 = __nccwpck_require__(42790);
7471
+ const getServiceName_1 = __nccwpck_require__(96428);
7472
+ const common_1 = __nccwpck_require__(54884);
7473
+ const constants_1 = __nccwpck_require__(17180);
7474
+ const volumes_1 = __nccwpck_require__(47770);
7475
+ const getWorkerPoolDeployScript = (context, workerPool, nameSuffix) => {
7476
+ var _a, _b, _c, _d;
7477
+ const commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
7478
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
7479
+ const command = workerPool.command;
7480
+ const commandArray = Array.isArray(command) ? command : command.split(" ");
7481
+ const fullWorkerPoolName = `${serviceName}-${nameSuffix}`;
7482
+ const argsString = (0, createArgsString_1.createArgsString)({
7483
+ command: '"' + commandArray.join(",") + '"',
7484
+ args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(workerPool.args),
7485
+ ...commonDeployArgs,
7486
+ image: (_a = workerPool.image) !== null && _a !== void 0 ? _a : commonDeployArgs.image,
7487
+ labels: (0, common_1.makeLabelString)({
7488
+ ...(0, getLabels_1.getLabels)(context),
7489
+ "cloud-run-worker-pool-name": fullWorkerPoolName,
7490
+ }),
7491
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
7492
+ instances: (_b = workerPool.instances) !== null && _b !== void 0 ? _b : 1,
7493
+ cpu: (_c = workerPool.cpu) !== null && _c !== void 0 ? _c : 1,
7494
+ memory: (_d = workerPool.memory) !== null && _d !== void 0 ? _d : "512Mi",
7495
+ "vpc-connector": workerPool.vpcConnector,
7496
+ "vpc-egress": workerPool.vpcEgress,
7497
+ network: workerPool.network,
7498
+ subnet: workerPool.subnet,
7499
+ gpu: workerPool.gpu,
7500
+ "gpu-type": workerPool.gpuType,
7501
+ }, ...(0, volumes_1.createVolumeConfig)(workerPool.volumes, "worker-pool"));
7502
+ // Worker pools are in beta and require the beta command
7503
+ return `${(0, common_1.gcloudRunCmd)("beta")} worker-pools deploy ${fullWorkerPoolName} ${argsString}`;
7504
+ };
7505
+ exports.getWorkerPoolDeployScript = getWorkerPoolDeployScript;
7506
+ const getWorkerPoolDeleteScript = (context, workerPoolSuffix) => {
7507
+ const commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
7508
+ const commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
7509
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
7510
+ const fullWorkerPoolName = `${serviceName}-${workerPoolSuffix}`;
7511
+ return [
7512
+ `${(0, common_1.gcloudRunCmd)("beta")} worker-pools delete ${fullWorkerPoolName} ${commonArgsString}`,
7513
+ ];
7514
+ };
7515
+ exports.getWorkerPoolDeleteScript = getWorkerPoolDeleteScript;
7516
+ //# sourceMappingURL=cloudRunWorkerPools.js.map
7517
+
7518
+ /***/ }),
7519
+
7461
7520
  /***/ 54884:
7462
7521
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7463
7522
 
@@ -7782,11 +7841,12 @@ const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(61201);
7782
7841
  const cloudRunJobs_1 = __nccwpck_require__(2579);
7783
7842
  const onDeploy_1 = __nccwpck_require__(69099);
7784
7843
  const cloudRunServices_1 = __nccwpck_require__(60675);
7844
+ const cloudRunWorkerPools_1 = __nccwpck_require__(10090);
7785
7845
  const common_1 = __nccwpck_require__(54884);
7786
7846
  const constants_1 = __nccwpck_require__(17180);
7787
7847
  const schedules_1 = __nccwpck_require__(91503);
7788
7848
  function getCloudRunDeployScripts(context) {
7789
- var _a;
7849
+ var _a, _b;
7790
7850
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
7791
7851
  const allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
7792
7852
  return [
@@ -7808,6 +7868,9 @@ function getCloudRunDeployScripts(context) {
7808
7868
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
7809
7869
  .filter(([_, service]) => service !== false && service !== null)
7810
7870
  .map(([name, service]) => (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name)),
7871
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
7872
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
7873
+ .map(([name, workerPool]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeployScript)(context, workerPool, name)),
7811
7874
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postDeploy"),
7812
7875
  ]),
7813
7876
  ...(0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy")),
@@ -7832,9 +7895,10 @@ const cloudRunJobs_1 = __nccwpck_require__(2579);
7832
7895
  const onDeploy_1 = __nccwpck_require__(69099);
7833
7896
  const schedules_1 = __nccwpck_require__(91503);
7834
7897
  const cloudRunServices_1 = __nccwpck_require__(60675);
7898
+ const cloudRunWorkerPools_1 = __nccwpck_require__(10090);
7835
7899
  const common_1 = __nccwpck_require__(54884);
7836
7900
  function getCloudRunStopScripts(context) {
7837
- var _a;
7901
+ var _a, _b;
7838
7902
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
7839
7903
  return [
7840
7904
  ...(0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context),
@@ -7843,6 +7907,9 @@ function getCloudRunStopScripts(context) {
7843
7907
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
7844
7908
  .filter(([_, service]) => service !== false && service !== null)
7845
7909
  .flatMap(([name]) => (0, cloudRunServices_1.getServiceDeleteScript)(context, name)),
7910
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
7911
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
7912
+ .flatMap(([name]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeleteScript)(context, name)),
7846
7913
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postStop"),
7847
7914
  ...(0, schedules_1.getDeleteSchedulesScript)(context),
7848
7915
  ...(0, cloudRunJobs_1.getDeleteJobsScripts)(context),
@@ -0,0 +1,4 @@
1
+ import type { ComponentContext } from "../../../types/context";
2
+ import type { DeployConfigCloudRunWorkerPool } from "../../types/googleCloudRun";
3
+ export declare const getWorkerPoolDeployScript: (context: ComponentContext, workerPool: DeployConfigCloudRunWorkerPool, nameSuffix: string) => string;
4
+ export declare const getWorkerPoolDeleteScript: (context: ComponentContext, workerPoolSuffix: string) => string[];
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkerPoolDeleteScript = exports.getWorkerPoolDeployScript = void 0;
4
+ const getLabels_1 = require("../../../context/getLabels");
5
+ const createArgsString_1 = require("../utils/createArgsString");
6
+ const getJobOrServiceArgs_1 = require("../utils/getJobOrServiceArgs");
7
+ const getServiceName_1 = require("../utils/getServiceName");
8
+ const common_1 = require("./common");
9
+ const constants_1 = require("./constants");
10
+ const volumes_1 = require("./volumes");
11
+ const getWorkerPoolDeployScript = (context, workerPool, nameSuffix) => {
12
+ var _a, _b, _c, _d;
13
+ const commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
14
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
15
+ const command = workerPool.command;
16
+ const commandArray = Array.isArray(command) ? command : command.split(" ");
17
+ const fullWorkerPoolName = `${serviceName}-${nameSuffix}`;
18
+ const argsString = (0, createArgsString_1.createArgsString)({
19
+ command: '"' + commandArray.join(",") + '"',
20
+ args: (0, getJobOrServiceArgs_1.getCloudRunServiceOrJobArgsArg)(workerPool.args),
21
+ ...commonDeployArgs,
22
+ image: (_a = workerPool.image) !== null && _a !== void 0 ? _a : commonDeployArgs.image,
23
+ labels: (0, common_1.makeLabelString)({
24
+ ...(0, getLabels_1.getLabels)(context),
25
+ "cloud-run-worker-pool-name": fullWorkerPoolName,
26
+ }),
27
+ "env-vars-file": constants_1.ENV_VARS_FILENAME,
28
+ instances: (_b = workerPool.instances) !== null && _b !== void 0 ? _b : 1,
29
+ cpu: (_c = workerPool.cpu) !== null && _c !== void 0 ? _c : 1,
30
+ memory: (_d = workerPool.memory) !== null && _d !== void 0 ? _d : "512Mi",
31
+ "vpc-connector": workerPool.vpcConnector,
32
+ "vpc-egress": workerPool.vpcEgress,
33
+ network: workerPool.network,
34
+ subnet: workerPool.subnet,
35
+ gpu: workerPool.gpu,
36
+ "gpu-type": workerPool.gpuType,
37
+ }, ...(0, volumes_1.createVolumeConfig)(workerPool.volumes, "worker-pool"));
38
+ // Worker pools are in beta and require the beta command
39
+ return `${(0, common_1.gcloudRunCmd)("beta")} worker-pools deploy ${fullWorkerPoolName} ${argsString}`;
40
+ };
41
+ exports.getWorkerPoolDeployScript = getWorkerPoolDeployScript;
42
+ const getWorkerPoolDeleteScript = (context, workerPoolSuffix) => {
43
+ const commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
44
+ const commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
45
+ const serviceName = (0, getServiceName_1.getServiceName)(context);
46
+ const fullWorkerPoolName = `${serviceName}-${workerPoolSuffix}`;
47
+ return [
48
+ `${(0, common_1.gcloudRunCmd)("beta")} worker-pools delete ${fullWorkerPoolName} ${commonArgsString}`,
49
+ ];
50
+ };
51
+ exports.getWorkerPoolDeleteScript = getWorkerPoolDeleteScript;
52
+ //# sourceMappingURL=cloudRunWorkerPools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudRunWorkerPools.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AAIvD,gEAA6D;AAC7D,sEAA8E;AAC9E,4DAAyD;AACzD,qCAKkB;AAClB,2CAAgD;AAChD,uCAA+C;AAExC,MAAM,yBAAyB,GAAG,CACvC,OAAyB,EACzB,UAA0C,EAC1C,UAAkB,EAClB,EAAE;;IACF,MAAM,gBAAgB,GAAG,IAAA,4BAAmB,EAAC,OAAO,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,OAAO,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IAEnC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3E,MAAM,kBAAkB,GAAG,GAAG,WAAW,IAAI,UAAU,EAAE,CAAC;IAE1D,MA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IAEtD,MAAM,WAAW,GAAG,IAAA,+BAAc,EAAC,OAAO,CAAC,CAAC;IAE5C,MAAM,kBAAkB,GAAG,GAAG,WAAW,IAAI,gBAAgB,EAAE,CAAC;IAEhE,OAAO;QACL,GAAG,IAAA,qBAAY,EAAC,MAAM,CAAC,wBAAwB,kBAAkB,IAAI,gBAAgB,EAAE;KACxF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,yBAAyB,6BAepC"}
@@ -11,11 +11,12 @@ const gcloudServiceAccountLoginCommands_1 = require("../utils/gcloudServiceAccou
11
11
  const cloudRunJobs_1 = require("./cloudRunJobs");
12
12
  const onDeploy_1 = require("./execute/onDeploy");
13
13
  const cloudRunServices_1 = require("./cloudRunServices");
14
+ const cloudRunWorkerPools_1 = require("./cloudRunWorkerPools");
14
15
  const common_1 = require("./common");
15
16
  const constants_1 = require("./constants");
16
17
  const schedules_1 = require("./execute/schedules");
17
18
  function getCloudRunDeployScripts(context) {
18
- var _a;
19
+ var _a, _b;
19
20
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
20
21
  const allEnvVars = (0, lodash_1.omit)(context.environment.envVars, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
21
22
  return [
@@ -37,6 +38,9 @@ function getCloudRunDeployScripts(context) {
37
38
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
38
39
  .filter(([_, service]) => service !== false && service !== null)
39
40
  .map(([name, service]) => (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name)),
41
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
42
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
43
+ .map(([name, workerPool]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeployScript)(context, workerPool, name)),
40
44
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postDeploy"),
41
45
  ]),
42
46
  ...(0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy")),
@@ -1 +1 @@
1
- {"version":3,"file":"getCloudRunDeployScripts.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAE9B,kDAA4D;AAE5D,0BAAmD;AACnD,qDAAmE;AACnE,wCAAmE;AACnE,gDAA4D;AAC5D,kGAA+F;AAC/F,iDAAqD;AACrD,iDAA8D;AAC9D,yDAA4D;AAC5D,qCAGkB;AAClB,2CAAgD;AAChD,mDAA8D;AAG9D,SAAgB,wBAAwB,CAAC,OAAyB;;IAChE,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,IAAA,aAAI,EACrB,OAAO,CAAC,WAAW,CAAC,OAAO,EAC3B,iCAA6B,CAC9B,CAAC;IAEF,OAAO;QACL,GAAG,IAAA,4BAAmB,EACpB,SAAS,EACT,YAAY,CACb,CAAC;YACA,GAAG,IAAA,qEAAiC,EAAC,OAAO,CAAC;YAC7C,GAAG,IAAA,qCAA4B,EAAC,YAAY,CAAC;SAC9C,CAAC;QACF,GAAG,IAAA,4BAAmB,EACpB,cAAc,EACd,wBAAwB,CACzB,CAAC,IAAA,oCAAyB,EAAC,UAAU,EAAE,6BAAiB,CAAC,CAAC;QAE3D,GAAG,IAAA,4BAAmB,EACpB,QAAQ,EACR,qBAAqB,CACtB,CAAC;YACA,GAAG,CAAC,YAAY,CAAC,QAAQ;gBACvB,CAAC,CAAC,IAAA,kCAAuB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC,6DAA6D;gBAC9G,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,IAAA,mCAAuB,EAAC,OAAO,CAAC;YACnC,GAAG,IAAA,kCAAmB,EAAC,OAAO,CAAC;YAC/B,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,WAAW,CAAC;YAEjD,GAAG,CAAC,YAAY,CAAC,OAAO,KAAK,KAAK;gBAChC,CAAC,CAAC,CAAC,IAAA,yCAAsB,EAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,YAAY,CAAC,kBAAkB,mCAAI,EAAE,CAAC;iBACrD,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI,CAAC;iBAC/D,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CACvB,IAAA,yCAAsB,EACpB,OAAO,EACP,OAAsC,EACtC,GAAG,GAAG,IAAI,CACX,CACF;YACH,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,YAAY,CAAC;SACnD,CAAC;QACF,GAAG,IAAA,4BAAmB,EACpB,SAAS,EACT,SAAS,CACV,CACC,IAAA,+CAAqC,EAAC,OAAO,EAAE,YAAY,CAAC,CAC7D;KACF,CAAC;AACJ,CAAC;AApDD,4DAoDC"}
1
+ {"version":3,"file":"getCloudRunDeployScripts.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAE9B,kDAA4D;AAE5D,0BAAmD;AACnD,qDAAmE;AACnE,wCAAmE;AACnE,gDAA4D;AAC5D,kGAA+F;AAC/F,iDAAqD;AACrD,iDAA8D;AAC9D,yDAA4D;AAC5D,+DAAkE;AAClE,qCAGkB;AAClB,2CAAgD;AAChD,mDAA8D;AAM9D,SAAgB,wBAAwB,CAAC,OAAyB;;IAChE,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,IAAA,aAAI,EACrB,OAAO,CAAC,WAAW,CAAC,OAAO,EAC3B,i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CAAC,WAAW,mCAAI,EAAE,CAAC;iBAC9C,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,IAAI,CAAC;iBACxE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,CAC1B,IAAA,+CAAyB,EACvB,OAAO,EACP,UAA4C,EAC5C,IAAI,CACL,CACF;YACH,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,YAAY,CAAC;SACnD,CAAC;QACF,GAAG,IAAA,4BAAmB,EACpB,SAAS,EACT,SAAS,CACV,CACC,IAAA,+CAAqC,EAAC,OAAO,EAAE,YAAY,CAAC,CAC7D;KACF,CAAC;AACJ,CAAC;AA7DD,4DA6DC"}
@@ -8,9 +8,10 @@ const cloudRunJobs_1 = require("./cloudRunJobs");
8
8
  const onDeploy_1 = require("./execute/onDeploy");
9
9
  const schedules_1 = require("./execute/schedules");
10
10
  const cloudRunServices_1 = require("./cloudRunServices");
11
+ const cloudRunWorkerPools_1 = require("./cloudRunWorkerPools");
11
12
  const common_1 = require("./common");
12
13
  function getCloudRunStopScripts(context) {
13
- var _a;
14
+ var _a, _b;
14
15
  const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
15
16
  return [
16
17
  ...(0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context),
@@ -19,6 +20,9 @@ function getCloudRunStopScripts(context) {
19
20
  ...Object.entries((_a = deployConfig.additionalServices) !== null && _a !== void 0 ? _a : {})
20
21
  .filter(([_, service]) => service !== false && service !== null)
21
22
  .flatMap(([name]) => (0, cloudRunServices_1.getServiceDeleteScript)(context, name)),
23
+ ...Object.entries((_b = deployConfig.workerPools) !== null && _b !== void 0 ? _b : {})
24
+ .filter(([_, workerPool]) => workerPool !== false && workerPool !== null)
25
+ .flatMap(([name]) => (0, cloudRunWorkerPools_1.getWorkerPoolDeleteScript)(context, name)),
22
26
  ...(0, onDeploy_1.getOnDeployExecuteScript)(context, "postStop"),
23
27
  ...(0, schedules_1.getDeleteSchedulesScript)(context),
24
28
  ...(0, cloudRunJobs_1.getDeleteJobsScripts)(context),
@@ -1 +1 @@
1
- {"version":3,"file":"getCloudRunStopScripts.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts"],"names":[],"mappings":";;;AAEA,wCAAmE;AACnE,gDAA4D;AAC5D,kGAA+F;AAC/F,iDAAsD;AACtD,iDAA8D;AAC9D,mDAA+D;AAC/D,yDAA4D;AAC5D,qCAAmD;AAEnD,SAAgB,sBAAsB,CAAC,OAAyB;;IAC9D,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,OAAO;QACL,GAAG,IAAA,qEAAiC,EAAC,OAAO,CAAC;QAC7C,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC;QAC/C,GAAG,CAAC,YAAY,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,yCAAsB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,YAAY,CAAC,kBAAkB,mCAAI,EAAE,CAAC;aACrD,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI,CAAC;aAC/D,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAA,yCAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC7D,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,UAAU,CAAC;QAChD,GAAG,IAAA,oCAAwB,EAAC,OAAO,CAAC;QACpC,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC;QAChC,GAAG,CAAC,YAAY,CAAC,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,oBAAoB;YACrE,CAAC,CAAC,IAAA,kCAAuB,EAAC,OAAO,EAAE,YAAY,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QAEP,GAAG,IAAA,+CAAqC,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,qDAAqD;KACnH,CAAC;AACJ,CAAC;AAlBD,wDAkBC"}
1
+ {"version":3,"file":"getCloudRunStopScripts.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts"],"names":[],"mappings":";;;AAEA,wCAAmE;AACnE,gDAA4D;AAC5D,kGAA+F;AAC/F,iDAAsD;AACtD,iDAA8D;AAC9D,mDAA+D;AAC/D,yDAA4D;AAC5D,+DAAkE;AAClE,qCAAmD;AAEnD,SAAgB,sBAAsB,CAAC,OAAyB;;IAC9D,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,OAAO;QACL,GAAG,IAAA,qEAAiC,EAAC,OAAO,CAAC;QAC7C,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC;QAC/C,GAAG,CAAC,YAAY,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,yCAAsB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,YAAY,CAAC,kBAAkB,mCAAI,EAAE,CAAC;aACrD,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI,CAAC;aAC/D,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAA,yCAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC7D,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,YAAY,CAAC,WAAW,mCAAI,EAAE,CAAC;aAC9C,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,IAAI,CAAC;aACxE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAA,+CAAyB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAChE,GAAG,IAAA,mCAAwB,EAAC,OAAO,EAAE,UAAU,CAAC;QAChD,GAAG,IAAA,oCAAwB,EAAC,OAAO,CAAC;QACpC,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC;QAChC,GAAG,CAAC,YAAY,CAAC,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,oBAAoB;YACrE,CAAC,CAAC,IAAA,kCAAuB,EAAC,OAAO,EAAE,YAAY,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QAEP,GAAG,IAAA,+CAAqC,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,qDAAqD;KACnH,CAAC;AACJ,CAAC;AArBD,wDAqBC"}
@@ -1,3 +1,3 @@
1
1
  import type { DeployConfigCloudRunVolumes } from "../../types";
2
2
  import type { keyValuesArg } from "../utils/createArgsString";
3
- export declare const createVolumeConfig: (volumes: DeployConfigCloudRunVolumes | undefined, type: "service" | "job") => keyValuesArg[];
3
+ export declare const createVolumeConfig: (volumes: DeployConfigCloudRunVolumes | undefined, type: "service" | "job" | "worker-pool") => keyValuesArg[];
@@ -1 +1 @@
1
- {"version":3,"file":"volumes.js","sourceRoot":"","sources":["../../../../../../../pipeline/src/deploy/cloudRun/createJobs/volumes.ts"],"names":[],"mappings":";;;AAGO,MAAM,kBAAkB,GAAG,CAChC,OAAgD,EAChD,IAAuB,EACP,EAAE;IAClB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GA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kBAAkB,sBAmB7B"}
@@ -323,6 +323,43 @@ export type DeployConfigCloudRunWithVolumes = {
323
323
  volumes?: DeployConfigCloudRunVolumes;
324
324
  };
325
325
  export type DeployConfigCloudRunJob = DeployConfigCloudRunJobNormal | DeployConfigCloudRunJobWithSchedule;
326
+ export type DeployConfigCloudRunWorkerPool = {
327
+ /**
328
+ * command / entrypoint for the worker pool
329
+ */
330
+ command: string | string[];
331
+ /**
332
+ * number of instances to run. Defaults to 1.
333
+ * Worker pools do not support autoscaling.
334
+ */
335
+ instances?: number;
336
+ /**
337
+ * CPU limit. Defaults to 1
338
+ */
339
+ cpu?: Cpu;
340
+ /**
341
+ * memory limit. Defaults to 512Mi
342
+ */
343
+ memory?: Memory;
344
+ /**
345
+ * the image to use. Defaults to the image from the build.
346
+ */
347
+ image?: string;
348
+ /**
349
+ * args to pass to the command
350
+ */
351
+ args?: string[];
352
+ /**
353
+ * Number of GPUs to use. Defaults to 0
354
+ *
355
+ * This is a preview feature and not all regions support it.
356
+ */
357
+ gpu?: number;
358
+ /**
359
+ * gpu type to use. Refer to https://cloud.google.com/run/docs/configuring/services/gpu#gcloud for defaults
360
+ */
361
+ gpuType?: string;
362
+ } & DeployConfigCloudRunWithVolumes & DeployConfigCloudRunNetworkConfig;
326
363
  export type DeployConfigCloudRun = Omit<DeployConfigBase, "execute"> & {
327
364
  /**
328
365
  * cloud run deployment.
@@ -353,6 +390,14 @@ export type DeployConfigCloudRun = Omit<DeployConfigBase, "execute"> & {
353
390
  jobs?: {
354
391
  [name: string]: DeployConfigCloudRunJob | false | null;
355
392
  };
393
+ /**
394
+ * deploy worker pools for continuous background work.
395
+ * Worker pools are cost-effective alternatives to services for background processing.
396
+ * They don't have a load balanced endpoint and don't support autoscaling.
397
+ */
398
+ workerPools?: {
399
+ [name: string]: DeployConfigCloudRunWorkerPool | false | null;
400
+ };
356
401
  /**
357
402
  * add cloudSql
358
403
  */