@catladder/pipeline 3.36.1 → 3.37.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.
- package/dist/constants.js +1 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +1 -0
- package/dist/deploy/types/googleCloudRun.d.ts +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-session-affinity.test.ts.snap +1601 -0
- package/examples/cloud-run-session-affinity.test.ts +12 -0
- package/examples/cloud-run-session-affinity.ts +29 -0
- package/package.json +1 -1
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +1 -0
- package/src/deploy/types/googleCloudRun.ts +8 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { it, expect } from "vitest";
|
|
2
|
+
import { createYamlLocalPipeline } from "./__utils__/helpers";
|
|
3
|
+
import config from "./cloud-run-session-affinity";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This test is auto-generated.
|
|
7
|
+
* Modifications will be overwritten on every `yarn test` run!
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
it("matches snapshot for cloud-run-session-affinity local pipeline YAML", async () => {
|
|
11
|
+
expect(await createYamlLocalPipeline(config)).toMatchSnapshot();
|
|
12
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
appName: "test-app",
|
|
5
|
+
customerName: "pan",
|
|
6
|
+
components: {
|
|
7
|
+
api: {
|
|
8
|
+
dir: "api",
|
|
9
|
+
build: {
|
|
10
|
+
type: "node",
|
|
11
|
+
},
|
|
12
|
+
deploy: {
|
|
13
|
+
type: "google-cloudrun",
|
|
14
|
+
projectId: "google-project-id",
|
|
15
|
+
region: "europe-west6",
|
|
16
|
+
|
|
17
|
+
service: {
|
|
18
|
+
sessionAffinity: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
} satisfies Config;
|
|
24
|
+
|
|
25
|
+
export default config;
|
|
26
|
+
|
|
27
|
+
export const information = {
|
|
28
|
+
title: "Cloud Run: with session affinity",
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@ export const getServiceDeployScript = (
|
|
|
65
65
|
"use-http2": customConfig?.http2,
|
|
66
66
|
"allow-unauthenticated": customConfig?.allowUnauthenticated ?? true,
|
|
67
67
|
ingress: customConfig?.ingress ?? "all",
|
|
68
|
+
"session-affinity": customConfig?.sessionAffinity,
|
|
68
69
|
"cpu-boost": true,
|
|
69
70
|
"execution-environment": customConfig?.executionEnvironment,
|
|
70
71
|
gpu: customConfig?.gpu,
|
|
@@ -202,6 +202,14 @@ export type DeployConfigCloudRunService = {
|
|
|
202
202
|
* If you specify an image, you usually want to disable the build by setting build: false
|
|
203
203
|
*/
|
|
204
204
|
image?: string;
|
|
205
|
+
/**
|
|
206
|
+
* whether to enable session affinity. When enabled, Cloud Run will try to route
|
|
207
|
+
* requests from the same client to the same instance.
|
|
208
|
+
*
|
|
209
|
+
* Passed as `--session-affinity` to gcloud.
|
|
210
|
+
*/
|
|
211
|
+
sessionAffinity?: boolean;
|
|
212
|
+
|
|
205
213
|
/**
|
|
206
214
|
* args to pass to the command
|
|
207
215
|
*/
|