@lotiai/composer 0.2.4 → 0.2.5
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/internal/async/register-scripts/sync-schedules-cli.js +4 -4
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.d.ts +1 -1
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.js +2 -2
- package/docker-compose.temporal.yml +20 -9
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ exports.runSyncSchedulesCli = runSyncSchedulesCli;
|
|
|
9
9
|
*
|
|
10
10
|
* Framework helper that implements the complete command-line entrypoint for
|
|
11
11
|
* a composer-instance's `sync-schedules` script. Each composer instance
|
|
12
|
-
*
|
|
12
|
+
* needs exactly one thin wrapper that:
|
|
13
13
|
*
|
|
14
14
|
* ```typescript
|
|
15
15
|
* import { isScheduleDefinition, runSyncSchedulesCli } from "@lotiai/composer";
|
|
@@ -51,9 +51,9 @@ const sync_schedules_1 = require("./sync-schedules");
|
|
|
51
51
|
const sync_schedules_via_lambda_1 = require("./sync-schedules-via-lambda");
|
|
52
52
|
/**
|
|
53
53
|
* Builds the default schedule-sync Lambda function name for the current
|
|
54
|
-
* environment
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* environment: an infra resource prefix + environment + resource slug with
|
|
55
|
+
* hyphens stripped. Must match the name the schedule-sync Lambda is deployed
|
|
56
|
+
* under; override with `--lambda` if your deployment uses a different name.
|
|
57
57
|
*/
|
|
58
58
|
function defaultLambdaFunctionName(environment) {
|
|
59
59
|
return `loti-ic-${environment}-temporalschedulesync`;
|
|
@@ -11,7 +11,7 @@ export interface SyncSchedulesViaLambdaOptions {
|
|
|
11
11
|
schedules: ScheduleDefinition[];
|
|
12
12
|
/**
|
|
13
13
|
* Name of the schedule-sync Lambda to invoke (e.g.
|
|
14
|
-
* `"
|
|
14
|
+
* `"my-schedule-sync-function"`).
|
|
15
15
|
*
|
|
16
16
|
* Ignored in `"emit"` mode but still required for type-safety.
|
|
17
17
|
*/
|
|
@@ -11,7 +11,7 @@ exports.syncSchedulesViaLambda = syncSchedulesViaLambda;
|
|
|
11
11
|
*
|
|
12
12
|
* This is the intended deploy-time path: CI assumes an AWS role with
|
|
13
13
|
* `lambda:InvokeFunction` permission and runs this helper from a
|
|
14
|
-
* composer-instance
|
|
14
|
+
* composer-instance's `sync-schedules` script.
|
|
15
15
|
*
|
|
16
16
|
* Supports two modes:
|
|
17
17
|
* - `"invoke"` (default): invokes the Lambda synchronously, logs tail logs
|
|
@@ -30,7 +30,7 @@ exports.syncSchedulesViaLambda = syncSchedulesViaLambda;
|
|
|
30
30
|
*
|
|
31
31
|
* await syncSchedulesViaLambda(composer, {
|
|
32
32
|
* schedules: Object.values(schedules).filter(isScheduleDefinition),
|
|
33
|
-
* lambdaFunctionName: "
|
|
33
|
+
* lambdaFunctionName: "my-schedule-sync-function",
|
|
34
34
|
* });
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
services:
|
|
11
11
|
postgresql:
|
|
12
|
-
image: postgres:
|
|
12
|
+
image: postgres:17
|
|
13
13
|
container_name: temporal-postgresql
|
|
14
14
|
environment:
|
|
15
15
|
POSTGRES_USER: temporal
|
|
@@ -20,7 +20,13 @@ services:
|
|
|
20
20
|
# talk to postgresql:5432 over the Docker network.
|
|
21
21
|
- "${TEMPORAL_DB_PORT:-5432}:5432"
|
|
22
22
|
volumes:
|
|
23
|
-
|
|
23
|
+
# The volume name is pinned to the Postgres major version. A major bump
|
|
24
|
+
# (e.g. 14 -> 17) therefore renames it, so Compose provisions a fresh
|
|
25
|
+
# volume instead of mounting an older major's data directory into the new
|
|
26
|
+
# server -- Postgres refuses to start on a data dir from a previous major.
|
|
27
|
+
# The old volume is left orphaned (harmless; `docker volume prune` clears
|
|
28
|
+
# it). This is throwaway local Temporal metadata, so a reset is expected.
|
|
29
|
+
- temporal-postgres17-data:/var/lib/postgresql/data
|
|
24
30
|
networks:
|
|
25
31
|
- temporal-network
|
|
26
32
|
healthcheck:
|
|
@@ -109,13 +115,18 @@ services:
|
|
|
109
115
|
sleep 2
|
|
110
116
|
done
|
|
111
117
|
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
# Namespaces to ensure exist. Defaults to a single "default" namespace;
|
|
119
|
+
# override TEMPORAL_NAMESPACES with a space-separated list (Docker
|
|
120
|
+
# Compose interpolates it from the host environment at parse time).
|
|
121
|
+
# The loop variable below is written with a doubled dollar sign so
|
|
122
|
+
# Compose passes it through to the shell literally instead of
|
|
123
|
+
# interpolating it to an empty string.
|
|
124
|
+
for namespace in ${TEMPORAL_NAMESPACES:-default}; do
|
|
125
|
+
if temporal operator namespace describe -n "$$namespace" --address temporal:7233 >/dev/null 2>&1; then
|
|
126
|
+
echo "Temporal namespace '$$namespace' already exists."
|
|
116
127
|
else
|
|
117
|
-
temporal operator namespace create -n "
|
|
118
|
-
echo "Temporal namespace '
|
|
128
|
+
temporal operator namespace create -n "$$namespace" --retention 90d --address temporal:7233
|
|
129
|
+
echo "Temporal namespace '$$namespace' created."
|
|
119
130
|
fi
|
|
120
131
|
done
|
|
121
132
|
networks:
|
|
@@ -136,7 +147,7 @@ services:
|
|
|
136
147
|
- temporal-network
|
|
137
148
|
|
|
138
149
|
volumes:
|
|
139
|
-
|
|
150
|
+
temporal-postgres17-data:
|
|
140
151
|
driver: local
|
|
141
152
|
|
|
142
153
|
networks:
|