Skip to content

Commit a23a4bc

Browse files
committed
fix: Update stack export names. Add protocol generation to canary compile target
1 parent c4c3c35 commit a23a4bc

File tree

15 files changed

+132
-75
lines changed

15 files changed

+132
-75
lines changed

.codecatalyst/workflows/[push(b:main)][schedule(0_0_*_*_?_*)]CI.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Actions:
156156
- Run: npm exec n $NODEJS_VERSION
157157
- Run: npm exec pnpm config set store-dir /tmp/pnpm-store
158158
- Run: npm exec pnpm install --prefer-offline --ignore-scripts
159+
- Run: sudo yum install -y g++ make cmake unzip libcurl-devel automake autoconf libtool
159160
- Run: python3 -c "print('ok')" || true
160161
- Run: npm rebuild node-gyp
161162
- Run: npm rebuild knex better-sqlite3
@@ -222,7 +223,9 @@ Actions:
222223
- Run: npm exec n $NODEJS_VERSION
223224
- Run: npm exec pnpm config set store-dir /tmp/pnpm-store
224225
- Run: npm exec pnpm install --prefer-offline --ignore-scripts
226+
- Run: sudo yum install -y g++ make cmake unzip libcurl-devel automake autoconf libtool
225227
- Run: npm rebuild node-gyp
228+
- Run: sudo npm install --global aws-lambda-ric
226229
- Run: npm rebuild knex better-sqlite3
227230
- Run: npm exec pnpm exec nx pack:build iac-images-application --verbose
228231
- Run: docker save $APPLICATION_IMAGE_NAME | gzip > _images/application.tar.gz
@@ -234,7 +237,7 @@ Actions:
234237
- Install
235238
Timeout: 14
236239
Environment:
237-
Name: current
240+
Name: c000
238241
Caching:
239242
FileCaching:
240243
a64_npm_global:
@@ -264,7 +267,7 @@ Actions:
264267
- Name: APPLICATION_IMAGE_NAME
265268
Value: greathall
266269
- Name: CI_ENVIRONMENT
267-
Value: current
270+
Value: c000
268271
- Name: AWS_REGION
269272
Value: us-west-2
270273
- Name: FRONTEND_HOSTNAME
@@ -361,7 +364,7 @@ Actions:
361364
Identifier: aws/build@v1.0.0
362365
Timeout: 10
363366
Environment:
364-
Name: current
367+
Name: c000
365368
Caching:
366369
FileCaching:
367370
a64_npm_global:
@@ -389,7 +392,7 @@ Actions:
389392
- Name: AWS_REGION
390393
Value: us-west-2
391394
- Name: CI_ENVIRONMENT
392-
Value: current
395+
Value: c000
393396
Artifacts:
394397
- images
395398
- pulumi
@@ -439,7 +442,7 @@ Actions:
439442
########################################
440443
#**:_$~- {"$$":"head","filename":"[push(b:main)][schedule(0_0_*_*_?_*)]CI.yml","source":"iac/workflows/codecatalyst/push/CI.js"}
441444
#**:_$~- {"$$":"script","generator":"codegen/codecatalyst/GenerateCodeCatalystWorkflow.mjs"}
442-
#**:_$~- {"$$":"body","hashed":"c3c79128f09907faf261182d8a8b3134f42d4b90cad31c370661210f443fead6"}
443-
#**:_$~- {"$$":"footer","started":"2025-01-21T03:54:06.990Z","now":"2025-01-21T03:54:07.001Z","elapsed":"11ms"}
445+
#**:_$~- {"$$":"body","hashed":"11687c528a74125aeb387607b67c3c6557080cb8dcd2fc6a99914b0cc4729d00"}
446+
#**:_$~- {"$$":"footer","started":"2025-01-21T13:36:49.009Z","now":"2025-01-21T13:36:49.017Z","elapsed":"8ms"}
444447
# END OF GENERATED FILE
445448

canary/qureau/package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"config": {
55
"packagemanager": "pnpm",
66
"packageexecutor": "pnpm exec",
7+
"outpath": "./module",
78
"lintpaths": "./src",
8-
"outpaths": "./module",
9+
"protocols": "./src/_protocols",
910
"canaryregister": "./module/canary/Register"
1011
},
1112
"dependencies": {
@@ -34,9 +35,14 @@
3435
],
3536
"nx": {
3637
"targets": {
38+
"build:tsc": {
39+
"dependsOn": [
40+
"generate:protocols"
41+
]
42+
},
3743
"dx:precommit": {
3844
"dependsOn": [
39-
"dx:prepublish",
45+
"@levicape/greathall-server-canary:dx:prepublish",
4046
"nx:test"
4147
]
4248
},
@@ -52,10 +58,9 @@
5258
]
5359
},
5460
"nx:test": {
55-
"dependsOn": []
56-
},
57-
"build:tsc": {
58-
"dependsOn": []
61+
"dependsOn": [
62+
"test:noop"
63+
]
5964
}
6065
}
6166
},
@@ -67,7 +72,7 @@
6772
"scripts": {
6873
"build": "$npm_package_config_packageexecutor nx nx:compile",
6974
"build:tsc": "$npm_package_config_packageexecutor tsc",
70-
"clean": "rm -rf $npm_package_config_outpaths || true",
75+
"clean": "rm -rf $npm_package_config_outpath || true",
7176
"commit": "$npm_package_config_packageexecutor nx dx:precommit --no-cloud --verbose",
7277
"dx:config:post": "$npm_package_config_packagemanager config set recursive-install true",
7378
"dx:config:pre": "$npm_package_config_packagemanager config set recursive-install false",
@@ -76,6 +81,7 @@
7681
"dx:precommit:pre": "echo \"Starting precommit dx. This will check package.json dependencies.\"",
7782
"dx:prepublish": "$npm_package_config_packageexecutor nx dx:prepublish:pre && $npm_package_config_packageexecutor nx dx:lint && $npm_package_config_packageexecutor nx prepublish",
7883
"dx:prepublish:pre": "echo \"Starting prepublish dx. This will compile the package, lint it, format package.json and verify all exports are valid. \"",
84+
"generate:protocols": "NODE_NO_WARNINGS=1 NO_UPDATE_NOTIFIER=1 $npm_package_config_packageexecutor spork code gen --root \"../../protocols\" --command \"$(which $npm_package_config_packagemanager) --silent run build\" --artifact gen --destination $npm_package_config_protocols --clean",
7985
"lambda:canary:register": "$npm_package_config_packageexecutor aws-lambda-ric $npm_package_config_canaryregister.LambdaHandler",
8086
"lint": "$npm_package_config_packageexecutor nx exec -- biome check $npm_package_config_lintpaths",
8187
"lint:format": "$npm_package_config_packageexecutor nx exec -- biome check --write $npm_package_config_lintpaths",
@@ -88,7 +94,8 @@
8894
"prelint": "$npm_package_config_packageexecutor nx exec -- biome format $npm_package_config_lintpaths",
8995
"prepublish": "$npm_package_config_packageexecutor publint --strict",
9096
"start:canary:register": "node $npm_package_config_canaryregister.mjs",
91-
"test": "$npm_package_config_packageexecutor nx nx:test --no-cloud --verbose"
97+
"test": "$npm_package_config_packageexecutor nx nx:test --no-cloud --verbose",
98+
"test:noop": "true"
9299
},
93100
"type": "module",
94101
"types": "module/index.d.mts"

devfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
schemaVersion: 2.0.0
22
metadata:
3-
name: spork
3+
name: greathall
44
components:
55
- name: source
66
container:

iac/development/devfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
let data = (
1414
<DevfileX
15-
metadata={<DevfileMetadataX name={"spork"} />}
15+
metadata={<DevfileMetadataX name={"greathall"} />}
1616
components={[<DevfileSourceComponentX name={"source"} />]}
1717
events={
1818
<DevfileEventX

iac/images/application/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"PAKETO_BUILDER": "heroku/builder:24"
1111
},
1212
"commands": [
13-
"npx nx run iac-images:cli:pack build $DEFAULT_IMAGE_NAME --buildpack $PAKETO_BUILDPACK --builder $PAKETO_BUILDER --default-process cli --cache 'type=build;format=bind;source=/tmp/docker-cache;type=launch;format=volume;'"
13+
"npx nx run iac-images:cli:pack build $DEFAULT_IMAGE_NAME -e NO_UPDATE_NOTIFIER=true --buildpack $PAKETO_BUILDPACK --builder $PAKETO_BUILDER --default-process cli --cache 'type=build;format=bind;source=/tmp/docker-cache;type=launch;format=volume;'"
1414
]
1515
}
1616
}

iac/images/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"forwardAllArgs": true,
1313
"commands": [
14-
"docker run --rm -v $DOCKER_SOCKET -v $PWD:$DOCKER_WORKSPACE -w $DOCKER_WORKSPACE -e PACK_VOLUME_KEY=packvol $PAKETO_IMAGE"
14+
"docker run --rm -v $DOCKER_SOCKET -v $PWD:$DOCKER_WORKSPACE -w $DOCKER_WORKSPACE -e NO_UPDATE_NOTIFIER=true -e PACK_VOLUME_KEY=packvol $PAKETO_IMAGE"
1515
]
1616
}
1717
},

iac/stacks/src/codestar/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ export = async () => {
115115
codedeployDeploymentConfigName,
116116
]) => {
117117
return {
118-
paloma_codestar_ecr: {
118+
greathall_codestar_ecr: {
119119
repository: {
120120
arn: ecrRepositoryArn,
121121
url: ecrRepositoryUrl,
122122
name: ecrRepositoryName,
123123
},
124124
},
125-
paloma_codestar_codedeploy: {
125+
greathall_codestar_codedeploy: {
126126
application: {
127127
arn: codedeployApplicationArn,
128128
name: codedeployApplicationName,

iac/stacks/src/datalayer/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export = async () => {
9494
{
9595
fileSystemId: filesystem.id,
9696
rootDirectory: {
97-
path: "/paloma",
97+
path: "/greathall",
9898
creationInfo: {
9999
ownerGid: 1000,
100100
ownerUid: 1000,
@@ -256,16 +256,16 @@ export = async () => {
256256
cloudmapNamespaceHostedZone,
257257
]) => {
258258
return {
259-
_PALOMA_DATALAYER_PROPS: jsonProps,
260-
paloma_datalayer_iam: {
259+
_GREATHALL_DATALAYER_PROPS: jsonProps,
260+
greathall_datalayer_iam: {
261261
roles: {
262262
lambda: {
263263
arn: iamRoleLambdaArn,
264264
name: iamRoleLambdaName,
265265
},
266266
},
267267
},
268-
paloma_datalayer_ec2: {
268+
greathall_datalayer_ec2: {
269269
vpc: {
270270
vpcId: ec2VpcId,
271271
subnetIds: ec2SubnetIds,
@@ -274,7 +274,7 @@ export = async () => {
274274
securityGroupId: ec2SecurityGroupId,
275275
},
276276
},
277-
paloma_datalayer_efs: {
277+
greathall_datalayer_efs: {
278278
filesystem: {
279279
arn: efsFilesystemArn,
280280
kmsKeyId: efsFilesystemKmsKeyId,
@@ -286,7 +286,7 @@ export = async () => {
286286
rootDirectory: efsAccessPointRootDirectory,
287287
},
288288
},
289-
paloma_datalayer_cloudmap: {
289+
greathall_datalayer_cloudmap: {
290290
namespace: {
291291
name: cloudmapNamespaceName,
292292
arn: cloudmapNamespaceArn,

iac/stacks/src/domains/qureau/http/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export = async () => {
150150

151151
// Bootstrap container lambda with empty image.
152152
const ecrCredentials = await getAuthorizationToken({});
153-
new Image(_("lambda-kickstart-image"), {
153+
const kickstartImage = new Image(_("image-kickstart"), {
154154
tags: [`${codestar.ecr.repository.url}:kickstart`],
155155
push: true,
156156
pull: true,
@@ -228,7 +228,7 @@ export = async () => {
228228
};
229229

230230
const lambda = new LambdaFn(
231-
_("lambda"),
231+
_("fn"),
232232
{
233233
role: roleArn,
234234
architectures: ["arm64"],
@@ -262,6 +262,7 @@ export = async () => {
262262
}),
263263
},
264264
{
265+
dependsOn: [kickstartImage],
265266
ignoreChanges: ["imageUri"],
266267
},
267268
);
@@ -271,13 +272,13 @@ export = async () => {
271272
?.map((host) => [`https://${host}`, `https://www.${host}`])
272273
.reduce((acc, current) => [...acc, ...current], []) ?? [];
273274

274-
const version = new Version(_("lambda-handler-http-version"), {
275+
const version = new Version(_("version"), {
275276
functionName: lambda.name,
276277
description: `(${getStack()}) Version ${stage}`,
277278
});
278279

279280
const alias = new Alias(
280-
_("lambda-alias"),
281+
_("alias"),
281282
{
282283
name: stage,
283284
functionName: lambda.name,
@@ -288,7 +289,7 @@ export = async () => {
288289
},
289290
);
290291

291-
const url = new FunctionUrl(_("lambda-url"), {
292+
const url = new FunctionUrl(_("url"), {
292293
functionName: lambda.name,
293294
qualifier: alias.name,
294295
authorizationType: context.environment.isProd ? "AWS_IAM" : "NONE",
@@ -519,7 +520,7 @@ export = async () => {
519520
})();
520521

521522
const codepipeline = (() => {
522-
const pipeline = new Pipeline(_("http-handler-pipeline"), {
523+
const pipeline = new Pipeline(_("pipeline-deploy"), {
523524
pipelineType: "V2",
524525
roleArn: farRole.arn,
525526
executionMode: "QUEUED",
@@ -648,7 +649,7 @@ export = async () => {
648649
},
649650
}),
650651
});
651-
const pipeline = new EventTarget(_("event-target-http-pipeline"), {
652+
const pipeline = new EventTarget(_("event-target-pipeline"), {
652653
rule: rule.name,
653654
arn: codepipeline.pipeline.arn,
654655
roleArn: farRole.arn,

iac/stacks/src/domains/qureau/monitor/index.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export = async () => {
154154

155155
// Bootstrap container lambda with empty image.
156156
const ecrCredentials = await getAuthorizationToken({});
157-
new Image(_(`${name}-kickstart-image`), {
157+
const kickstartImage = new Image(_(`${name}-kickstart-image`), {
158158
tags: [`${codestar.ecr.repository.url}:kickstart`],
159159
push: true,
160160
pull: true,
@@ -232,7 +232,7 @@ export = async () => {
232232
};
233233

234234
const lambda = new LambdaFn(
235-
_(`${name}-handler-lambda`),
235+
_(`${name}-fn`),
236236
{
237237
role: roleArn,
238238
architectures: ["arm64"],
@@ -266,17 +266,18 @@ export = async () => {
266266
}),
267267
},
268268
{
269+
dependsOn: [kickstartImage],
269270
ignoreChanges: ["imageUri"],
270271
},
271272
);
272273

273-
const version = new Version(_(`${name}-handler-version`), {
274+
const version = new Version(_(`${name}-version`), {
274275
functionName: lambda.name,
275276
description: `(${getStack()}) Version ${stage}`,
276277
});
277278

278279
const alias = new Alias(
279-
_(`${name}-handler-alias`),
280+
_(`${name}-alias`),
280281
{
281282
name: stage,
282283
functionName: lambda.name,
@@ -319,10 +320,10 @@ export = async () => {
319320
} as const;
320321

321322
const canary = {
322-
server: await handler(
323+
register: await handler(
323324
{
324-
entrypoint: "canaryserver",
325-
name: "canaryserver",
325+
entrypoint: "qureaucanaryregister",
326+
name: "register",
326327
},
327328
deps,
328329
cloudwatch,
@@ -488,7 +489,7 @@ export = async () => {
488489
})();
489490

490491
const codepipeline = (() => {
491-
const pipeline = new Pipeline(_("schedule-handler-pipeline"), {
492+
const pipeline = new Pipeline(_("pipeline-deploy-schedule"), {
492493
pipelineType: "V2",
493494
roleArn: farRole.arn,
494495
executionMode: "QUEUED",
@@ -525,7 +526,7 @@ export = async () => {
525526
name: "ScheduleCanary",
526527
actions: [
527528
{
528-
canary: canary.server,
529+
canary: canary.register,
529530
prefix: "Register",
530531
artifactPrefix: "schedulecanaryregister",
531532
},
@@ -654,7 +655,7 @@ export = async () => {
654655

655656
return acc;
656657
},
657-
[[]] as Array<[string, typeof canary.server.lambda][]>,
658+
[[]] as Array<[string, typeof canary.register.lambda][]>,
658659
)
659660
.filter((group) => group.length > 0);
660661

0 commit comments

Comments
 (0)