@catladder/pipeline 3.5.0 → 3.7.0

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.
Files changed (67) hide show
  1. package/dist/build/artifacts/createBuildJobArtifact.js +1 -1
  2. package/dist/build/base/index.d.ts +2 -3
  3. package/dist/build/cache/getAllCacheConfigsFromConfig.js +2 -2
  4. package/dist/build/custom/buildJob.d.ts +2 -2
  5. package/dist/build/custom/index.d.ts +2 -2
  6. package/dist/build/custom/testJob.d.ts +2 -2
  7. package/dist/build/docker.d.ts +4 -4
  8. package/dist/build/index.d.ts +2 -2
  9. package/dist/build/node/buildJob.d.ts +5 -3
  10. package/dist/build/node/index.d.ts +4 -4
  11. package/dist/build/node/meteor.d.ts +2 -2
  12. package/dist/build/node/yarn.d.ts +1 -1
  13. package/dist/build/node/yarn.js +1 -1
  14. package/dist/build/rails/build.d.ts +2 -2
  15. package/dist/build/rails/index.d.ts +2 -2
  16. package/dist/build/sbom.d.ts +2 -2
  17. package/dist/constants.js +1 -1
  18. package/dist/context/createComponentContext.js +11 -4
  19. package/dist/context/getLabels.js +1 -1
  20. package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +2 -2
  21. package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +28 -10
  22. package/dist/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +2 -3
  23. package/dist/deploy/cloudRun/createJobs/execute/onDeploy.js +4 -9
  24. package/dist/deploy/cloudRun/utils/getJobOrServiceArgs.d.ts +2 -0
  25. package/dist/deploy/cloudRun/utils/getJobOrServiceArgs.js +12 -0
  26. package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
  27. package/dist/deploy/kubernetes/kubeValues.js +1 -1
  28. package/dist/deploy/sbom.js +1 -1
  29. package/dist/deploy/types/googleCloudRun.d.ts +20 -0
  30. package/dist/pipeline/createJobsForComponent.js +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/dist/types/config.d.ts +1 -1
  33. package/dist/types/context.d.ts +6 -1
  34. package/examples/__snapshots__/cloud-run-llama.test.ts.snap +624 -0
  35. package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +1382 -0
  36. package/examples/cloud-run-llama.test.ts +11 -0
  37. package/examples/cloud-run-llama.ts +40 -0
  38. package/examples/cloud-run-with-gpu.test.ts +11 -0
  39. package/examples/cloud-run-with-gpu.ts +30 -0
  40. package/package.json +1 -1
  41. package/src/build/artifacts/createBuildJobArtifact.ts +3 -1
  42. package/src/build/base/index.ts +5 -2
  43. package/src/build/cache/getAllCacheConfigsFromConfig.ts +7 -6
  44. package/src/build/custom/buildJob.ts +2 -2
  45. package/src/build/custom/index.ts +4 -2
  46. package/src/build/custom/testJob.ts +2 -2
  47. package/src/build/docker.ts +8 -4
  48. package/src/build/index.ts +5 -2
  49. package/src/build/node/buildJob.ts +5 -2
  50. package/src/build/node/index.ts +9 -4
  51. package/src/build/node/meteor.ts +5 -2
  52. package/src/build/node/yarn.ts +4 -2
  53. package/src/build/rails/build.ts +3 -7
  54. package/src/build/rails/index.ts +4 -2
  55. package/src/build/sbom.ts +4 -2
  56. package/src/context/createComponentContext.ts +22 -9
  57. package/src/context/getLabels.ts +4 -1
  58. package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +2 -2
  59. package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +24 -3
  60. package/src/deploy/cloudRun/createJobs/execute/onDeploy.ts +3 -13
  61. package/src/deploy/cloudRun/utils/getJobOrServiceArgs.ts +18 -0
  62. package/src/deploy/kubernetes/kubeValues.ts +13 -4
  63. package/src/deploy/sbom.ts +4 -3
  64. package/src/deploy/types/googleCloudRun.ts +23 -0
  65. package/src/pipeline/createJobsForComponent.ts +10 -2
  66. package/src/types/config.ts +1 -1
  67. package/src/types/context.ts +10 -1
@@ -6,9 +6,10 @@ import {
6
6
  } from "../types/context";
7
7
 
8
8
  export const sbomDeactivated = (context: ComponentContext) =>
9
- componentContextIsStandaloneBuild(context) &&
10
- context.build.config.type === "custom" &&
11
- context.build.config.sbom === false;
9
+ context.build.type === "disabled" ||
10
+ (componentContextIsStandaloneBuild(context) &&
11
+ context.build.config.type === "custom" &&
12
+ context.build.config.sbom === false);
12
13
 
13
14
  export const getDependencyTrackUploadScript = (
14
15
  context: ComponentContext,
@@ -168,6 +168,29 @@ export type DeployConfigCloudRunService = {
168
168
  *
169
169
  */
170
170
  http2?: boolean;
171
+
172
+ /**
173
+ * Number of GPUs to use. Defaults to 0
174
+ *
175
+ * This is a preview feature and not all regions support it.
176
+ */
177
+ gpu?: number;
178
+
179
+ /**
180
+ * gpu type to use. Refer to https://cloud.google.com/run/docs/configuring/services/gpu#gcloud for defaults
181
+ */
182
+ gpuType?: string;
183
+
184
+ /**
185
+ * the image to use. Defaults to the image from the build.
186
+ *
187
+ * If you specify an image, you usually want to disable the build by setting build: false
188
+ */
189
+ image?: string;
190
+ /**
191
+ * args to pass to the command
192
+ */
193
+ args?: string[];
171
194
  } & DeployConfigCloudRunWithVolumes &
172
195
  DeployConfigCloudRunNetworkConfig;
173
196
 
@@ -1,6 +1,9 @@
1
1
  import { BUILD_TYPES } from "../build";
2
2
  import { DEPLOY_TYPES } from "../deploy";
3
- import type { ComponentContext } from "../types/context";
3
+ import type {
4
+ ComponentContext,
5
+ ComponentContextWithBuild,
6
+ } from "../types/context";
4
7
  import type { CatladderJob } from "../types/jobs";
5
8
 
6
9
  const injectDefaultVarsInCustomJobs = (
@@ -24,7 +27,12 @@ const getCustomJobs = (context: ComponentContext) => {
24
27
  export const createJobsForComponentContext = (
25
28
  context: ComponentContext,
26
29
  ): CatladderJob[] => {
27
- const buildJobs = BUILD_TYPES[context.build.buildType].jobs(context);
30
+ const buildJobs =
31
+ context.build.type !== "disabled"
32
+ ? BUILD_TYPES[context.build.buildType].jobs(
33
+ context as ComponentContextWithBuild,
34
+ )
35
+ : [];
28
36
  const deployJobs =
29
37
  context.componentConfig.deploy !== false
30
38
  ? DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context)
@@ -83,7 +83,7 @@ export type DefaultEnvConfig = {
83
83
  /**
84
84
  * how the app is built and its runtime
85
85
  */
86
- build: BuildConfig;
86
+ build: BuildConfig | false;
87
87
  /**
88
88
  * environment variables
89
89
  */
@@ -116,6 +116,9 @@ export type BuildContextStandalone<
116
116
  buildType: C["type"];
117
117
  };
118
118
 
119
+ export type BuildContextDisabled = BuildContextComponentBase & {
120
+ type: "disabled";
121
+ };
119
122
  export type BuildContextFromWorkspace = BuildContextComponentBase & {
120
123
  config: BuildConfigFromWorkspace;
121
124
  workspaceName: string;
@@ -133,10 +136,14 @@ export type BuildContextWorkspace = BuildContextBase & {
133
136
  config: WorkspaceBuildConfig;
134
137
  };
135
138
 
136
- export type BuildContextComponent =
139
+ export type BuildContextWithBuild =
137
140
  | BuildContextStandalone
138
141
  | BuildContextFromWorkspace;
139
142
 
143
+ export type BuildContextComponent =
144
+ | BuildContextWithBuild
145
+ | BuildContextDisabled;
146
+
140
147
  export type BuildContext = BuildContextComponent | BuildContextWorkspace;
141
148
 
142
149
  export type DeployContext = {
@@ -172,6 +179,8 @@ export type ComponentContext<
172
179
  customJobs?: CatladderJob[];
173
180
  };
174
181
 
182
+ export type ComponentContextWithBuild = ComponentContext<BuildContextWithBuild>;
183
+
175
184
  export type Context = ComponentContext | WorkspaceContext;
176
185
 
177
186
  export type CatladderJobWithContext<S = BaseStage> = CatladderJob<S> & {