@intentius/chant-lexicon-aws 0.13.1 → 0.15.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/components/__tests__/mock-cloud-executor.d.ts +106 -0
- package/dist/components/__tests__/mock-cloud-executor.d.ts.map +1 -0
- package/dist/components/apply.d.ts +242 -0
- package/dist/components/apply.d.ts.map +1 -0
- package/dist/components/builders.d.ts +37 -0
- package/dist/components/builders.d.ts.map +1 -0
- package/dist/components/capability-plugin.d.ts +23 -0
- package/dist/components/capability-plugin.d.ts.map +1 -0
- package/dist/components/cloud-executor.d.ts +350 -0
- package/dist/components/cloud-executor.d.ts.map +1 -0
- package/dist/components/config-bom.d.ts +135 -0
- package/dist/components/config-bom.d.ts.map +1 -0
- package/dist/components/host-delivery.d.ts +110 -0
- package/dist/components/host-delivery.d.ts.map +1 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/job-submission.d.ts +89 -0
- package/dist/components/job-submission.d.ts.map +1 -0
- package/dist/components/publish.d.ts +194 -0
- package/dist/components/publish.d.ts.map +1 -0
- package/dist/components/safety.d.ts +49 -0
- package/dist/components/safety.d.ts.map +1 -0
- package/dist/components/wait-aws.d.ts +65 -0
- package/dist/components/wait-aws.d.ts.map +1 -0
- package/dist/generated/index.d.ts +68 -40
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/import/live-export.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +4 -4
- package/dist/lint/audit-catalog.d.ts +10 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +893 -737
- package/dist/op/activities/floci.d.ts +54 -0
- package/dist/op/activities/floci.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +8 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/ownership.d.ts +10 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/serializer.d.ts.map +1 -1
- package/dist/types/index.d.ts +905 -659
- package/package.json +12 -2
- package/src/components/__fixtures__/schemas/cyclonedx-1.5.schema.json +3800 -0
- package/src/components/__fixtures__/schemas/cyclonedx-spdx-license.schema.json +621 -0
- package/src/components/__fixtures__/schemas/jsf-0.82.schema.json +240 -0
- package/src/components/__fixtures__/schemas/spdx-2.3.schema.json +740 -0
- package/src/components/__fixtures__/synthesized-template.json +53 -0
- package/src/components/__tests__/mock-cloud-executor.ts +425 -0
- package/src/components/apply.test.ts +382 -0
- package/src/components/apply.ts +499 -0
- package/src/components/builders.test.ts +49 -0
- package/src/components/builders.ts +59 -0
- package/src/components/capability-plugin.ts +73 -0
- package/src/components/cloud-executor.test.ts +25 -0
- package/src/components/cloud-executor.ts +814 -0
- package/src/components/config-bom.test.ts +273 -0
- package/src/components/config-bom.ts +310 -0
- package/src/components/host-delivery.test.ts +121 -0
- package/src/components/host-delivery.ts +193 -0
- package/src/components/index.ts +19 -0
- package/src/components/job-submission.test.ts +97 -0
- package/src/components/job-submission.ts +138 -0
- package/src/components/pilots-e2e.test.ts +460 -0
- package/src/components/presets-e2e.test.ts +166 -0
- package/src/components/publish.test.ts +318 -0
- package/src/components/publish.ts +356 -0
- package/src/components/safety.test.ts +47 -0
- package/src/components/safety.ts +78 -0
- package/src/components/wait-aws.test.ts +79 -0
- package/src/components/wait-aws.ts +132 -0
- package/src/generated/index.d.ts +905 -659
- package/src/generated/index.ts +79 -51
- package/src/generated/lexicon-aws.json +893 -737
- package/src/import/live-export.ts +2 -1
- package/src/index.ts +5 -0
- package/src/lint/audit-catalog.ts +45 -0
- package/src/lsp/completions.test.ts +4 -2
- package/src/op/activities/floci.test.ts +67 -0
- package/src/op/activities/floci.ts +149 -0
- package/src/op/activities/index.ts +16 -0
- package/src/ownership.test.ts +18 -0
- package/src/ownership.ts +15 -0
- package/src/plugin.ts +3 -0
- package/src/serializer.ts +2 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* job submission family — point a running compute service at an artifact.
|
|
3
|
+
* Cloud-shaped (EMR here; the same shape reuses for Glue / Batch / Step
|
|
4
|
+
* Functions / SageMaker per docs/components/cloud-boundary). Typically
|
|
5
|
+
* consumes a producer component's published artifact, e.g.
|
|
6
|
+
* `jar: "@jar-lib.publish.uri"`.
|
|
7
|
+
*
|
|
8
|
+
* `emr-start-job-run` is a real implementation (#561, epic #551) — just
|
|
9
|
+
* enough against the injectable `CloudExecutor` (./cloud-executor.ts) to run
|
|
10
|
+
* the JAR-producer -> EMR-consumer cross-component example end to end (a
|
|
11
|
+
* mocked cloud is acceptable per #561's acceptance criteria; the full EMR
|
|
12
|
+
* surface — retries, Serverless vs EMR-on-EC2 branching, Glue/Batch peers —
|
|
13
|
+
* stays out of scope, per #561 explicitly deferring "the emr-start-job-run
|
|
14
|
+
* cloud impl beyond what the example needs"). `emr-submit-step` is a
|
|
15
|
+
* different verb (submit a step to an already-running EMR-on-EC2 cluster
|
|
16
|
+
* rather than starting an ephemeral job run), also real over the executor
|
|
17
|
+
* (`aws emr add-steps`) and unit-tested against the mock — the same
|
|
18
|
+
* "mocked cloud is acceptable" basis #561 set for its sibling, since a live
|
|
19
|
+
* long-running EMR cluster is not part of gating CI.
|
|
20
|
+
*/
|
|
21
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
22
|
+
import { type CloudExecutor } from "./cloud-executor.js";
|
|
23
|
+
export interface EmrStartJobRunInput {
|
|
24
|
+
/**
|
|
25
|
+
* EMR (Serverless) application id, or EMR on EC2 cluster id. Optional here
|
|
26
|
+
* (unlike the underlying `CloudExecutor.emr.startJobRun` args) because the
|
|
27
|
+
* epic's worked JAR->EMR example (component-contract fixture
|
|
28
|
+
* `../__fixtures__/emr-job-consumer.json`, docs/components/composition-and-wiring.mdx)
|
|
29
|
+
* wires it as env config rather than a literal in the component
|
|
30
|
+
* declaration; falls back to `ctx.vars.emrApplicationId`, matching how
|
|
31
|
+
* `wait-cluster-healthy` (../verbs/wait-verify.ts) falls back to
|
|
32
|
+
* `ctx.vars.clusterEndpoints` for the same reason (env resolution is the
|
|
33
|
+
* caller's `DeployContext.vars`, not a literal every component must repeat).
|
|
34
|
+
*/
|
|
35
|
+
clusterOrApplicationId?: string;
|
|
36
|
+
/** Entry point artifact reference — resolved by the graph before this capability runs (e.g. from `"@jar-lib.publish.uri"` to a concrete S3 URI). */
|
|
37
|
+
jar: string;
|
|
38
|
+
/** Arguments passed to the job's main class/entry point. */
|
|
39
|
+
args?: string[];
|
|
40
|
+
/** Execution role ARN. */
|
|
41
|
+
executionRoleArn?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface EmrStartJobRunOutput {
|
|
44
|
+
/** EMR job run id, for polling via `wait-job`. */
|
|
45
|
+
runId: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Start an EMR job run (Serverless application or EMR-on-EC2 cluster)
|
|
49
|
+
* against a published artifact. `input.jar` arrives already resolved by the
|
|
50
|
+
* driver's graph-driven wiring (`@<component>.publish.uri`) — this capability
|
|
51
|
+
* never resolves the reference itself, keeping cross-component wiring
|
|
52
|
+
* entirely the graph's job (../driver.ts's `resolveWiring`), never a
|
|
53
|
+
* capability- or orchestrator-level special case. No rollback: starting a
|
|
54
|
+
* job run has no "undo" that restores prior state — a failed/cancelled run
|
|
55
|
+
* simply produced no usable output, matching `wait-for-stack`/`wait-job`'s
|
|
56
|
+
* read-only-observation story (there is nothing to compensate for having
|
|
57
|
+
* asked the cluster to run something).
|
|
58
|
+
*/
|
|
59
|
+
export declare function createEmrStartJobRunCapability(executor?: CloudExecutor): Capability<EmrStartJobRunInput, EmrStartJobRunOutput>;
|
|
60
|
+
/** Default `emr-start-job-run` capability, backed by the real `CloudExecutor`. */
|
|
61
|
+
export declare const emrStartJobRunCapability: Capability<EmrStartJobRunInput, EmrStartJobRunOutput>;
|
|
62
|
+
export interface EmrSubmitStepInput {
|
|
63
|
+
/** EMR-on-EC2 cluster id to submit the step to. */
|
|
64
|
+
clusterId: string;
|
|
65
|
+
/** Step name, shown in the EMR console. */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Entry point artifact reference (e.g. `"@jar-lib.publish.uri"`) — resolved by the graph before this capability runs, exactly like `emr-start-job-run`'s `jar`. */
|
|
68
|
+
jar: string;
|
|
69
|
+
/** Arguments passed to the step. */
|
|
70
|
+
args?: string[];
|
|
71
|
+
/** What EMR does if the step fails. Default: "CONTINUE". */
|
|
72
|
+
actionOnFailure?: "CONTINUE" | "CANCEL_AND_WAIT" | "TERMINATE_CLUSTER";
|
|
73
|
+
}
|
|
74
|
+
export interface EmrSubmitStepOutput {
|
|
75
|
+
/** EMR step id, for polling via `wait-job`. */
|
|
76
|
+
stepId: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Submit a step to a long-running EMR-on-EC2 cluster (as opposed to
|
|
80
|
+
* `emr-start-job-run`, which starts an ephemeral Serverless/EC2 job run) via
|
|
81
|
+
* `aws emr add-steps` through the injectable `CloudExecutor`. Returns the step
|
|
82
|
+
* id for polling via `wait-job`. Like its sibling, `input.jar` arrives
|
|
83
|
+
* already resolved by the driver's graph-driven wiring, and there is no
|
|
84
|
+
* rollback — a submitted step has no "undo" that restores prior state.
|
|
85
|
+
*/
|
|
86
|
+
export declare function createEmrSubmitStepCapability(executor?: CloudExecutor): Capability<EmrSubmitStepInput, EmrSubmitStepOutput>;
|
|
87
|
+
/** Default `emr-submit-step` capability, backed by the real `CloudExecutor`. */
|
|
88
|
+
export declare const emrSubmitStepCapability: Capability<EmrSubmitStepInput, EmrSubmitStepOutput>;
|
|
89
|
+
//# sourceMappingURL=job-submission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-submission.d.ts","sourceRoot":"","sources":["../../src/components/job-submission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,K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,CACvD,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* publish family — deploy-time promotion by identity to the env location.
|
|
3
|
+
*
|
|
4
|
+
* "Make the image available at the deploy target" has more than one backend:
|
|
5
|
+
* `publish-image` promotes into a registry (ECR/ACR/Artifact Registry, pulled
|
|
6
|
+
* by the target); `load-image-on-host` copies the tarball straight onto a host
|
|
7
|
+
* and `docker load`s it (registry-less). Both satisfy the same
|
|
8
|
+
* `PublishImageBackend` interface — the backend is env config, not a pipeline
|
|
9
|
+
* fork. `publish-asset`/`publish-artifact` is the non-image sibling (S3 /
|
|
10
|
+
* CodeArtifact) used by producer/library components (e.g. a jar for EMR).
|
|
11
|
+
* See docs/components/build-archive.mdx.
|
|
12
|
+
*
|
|
13
|
+
* `publish-image` is a real implementation (#557, epic #551): it loads the
|
|
14
|
+
* archived image tarball, tags it for the destination registry, logs in via
|
|
15
|
+
* ECR, and pushes — promoting by digest, per the epic's build-once invariant.
|
|
16
|
+
*
|
|
17
|
+
* `load-image-on-host` is a real implementation (#564, epic #551 "4. Build
|
|
18
|
+
* archive + deferred publish"): it copies the archived tarball onto a host
|
|
19
|
+
* and runs `docker load` there via the injected `CloudExecutor.host` — no
|
|
20
|
+
* registry in the path at all. Both backends promote **by digest**, never
|
|
21
|
+
* rebuilding: the bytes they move are exactly what `docker-build` produced
|
|
22
|
+
* into the archive (see ./build-archive.ts). `selectPublishBackend` below is
|
|
23
|
+
* the per-environment choice between them — env config, not a pipeline fork,
|
|
24
|
+
* per docs/components/build-archive.mdx#backend-selection-is-per-environment.
|
|
25
|
+
*
|
|
26
|
+
* `publish-artifact` (aliased `publish-asset`) uploads a single archive
|
|
27
|
+
* artifact (jar/zip/asset) to S3 via `aws s3 cp` through the same
|
|
28
|
+
* endpoint-aware `CloudExecutor`, returning the object URI and a content digest
|
|
29
|
+
* of the uploaded bytes — the non-image sibling of `publish-image`.
|
|
30
|
+
*
|
|
31
|
+
* **#610 addition: publish-time SBOM/BOM referrer attach.** `publish-image`
|
|
32
|
+
* optionally registers the archive's SBOM (and, when given, the
|
|
33
|
+
* component-level aggregate BOM) as an OCI referrer on the just-pushed image
|
|
34
|
+
* digest via `oras attach` — a registry-side convenience for `oras
|
|
35
|
+
* discover`/`cosign tree` layered on top of the archive-carried copy, never a
|
|
36
|
+
* replacement for it (see ../../lifecycle/build-ledger.ts's module doc: the
|
|
37
|
+
* archive remains the universal home, working for every artifact type and
|
|
38
|
+
* the registry-less `load-image-on-host` path, which this attach step
|
|
39
|
+
* deliberately does not touch — non-image/registry-less publishes stay
|
|
40
|
+
* archive-carried only). Attach is opt-in per call (`input.sbom` supplied),
|
|
41
|
+
* guarded on `oras` availability, and never fails the publish itself: a
|
|
42
|
+
* missing `oras` binary or a failed attach is reported back on the output
|
|
43
|
+
* (`referrerAttach.attached: false` + a reason) rather than thrown, since the
|
|
44
|
+
* image is already successfully promoted by the time this step runs — the
|
|
45
|
+
* one part of this capability that is genuinely best-effort.
|
|
46
|
+
*/
|
|
47
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
48
|
+
import { type CloudExecutor } from "./cloud-executor.js";
|
|
49
|
+
import { type ProcessRunner } from "@intentius/chant/components/verbs/process-runner";
|
|
50
|
+
/**
|
|
51
|
+
* Common input shape both image-publish backends accept: promote the image
|
|
52
|
+
* bytes at archive path `from` to wherever the deploy target can consume
|
|
53
|
+
* them. `to` (registry) and `host` (bare host) are each meaningful to only
|
|
54
|
+
* one backend, so a component authors one step shape (see
|
|
55
|
+
* docs/components/build-archive.mdx) and the env-selected backend (see
|
|
56
|
+
* `selectPublishBackend` below) reads whichever field it needs — the
|
|
57
|
+
* unselected backend's field is simply unused, never a pipeline fork.
|
|
58
|
+
*/
|
|
59
|
+
export interface PublishImageInput {
|
|
60
|
+
/** Path of the image tarball inside the build archive (as produced by `docker-build`; an `archive:`-prefixed reference is accepted and stripped). */
|
|
61
|
+
from: string;
|
|
62
|
+
/** Destination registry — required by `publish-image`, ignored by `load-image-on-host` (e.g. `$env.registry` resolved by the orchestrator). */
|
|
63
|
+
to?: string;
|
|
64
|
+
/** Target host — required by `load-image-on-host`, ignored by `publish-image` (SSM instance id, hostname, or host group). */
|
|
65
|
+
host?: string;
|
|
66
|
+
/** Destination path for the tarball on the host, used only by `load-image-on-host`. Default: `/tmp/chant-archive/<basename of from>`. */
|
|
67
|
+
hostPath?: string;
|
|
68
|
+
/** Additional tags to apply alongside the digest, used only by `publish-image`. */
|
|
69
|
+
tags?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* #610: the artifact's software SBOM (typically wired from a prior
|
|
72
|
+
* `generate-sbom` step's `sbom` output — see ./sbom.ts's
|
|
73
|
+
* `GenerateSbomOutput`) to attach as an OCI referrer on the pushed image
|
|
74
|
+
* digest, via `oras attach`. Used only by `publish-image`; ignored by
|
|
75
|
+
* `load-image-on-host` (registry-less — nothing to attach to). Omit to
|
|
76
|
+
* skip the attach step entirely (the archive-carried copy remains the
|
|
77
|
+
* SBOM's home either way).
|
|
78
|
+
*/
|
|
79
|
+
sbom?: {
|
|
80
|
+
bytes: string;
|
|
81
|
+
mediaType: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* #610: the component-level aggregate BOM (wired from
|
|
85
|
+
* ./component-bom.ts's `aggregateComponentBom` output), attached as a
|
|
86
|
+
* second OCI referrer alongside `sbom` when supplied. Optional and
|
|
87
|
+
* independent of `sbom` — a caller may attach either, both, or neither.
|
|
88
|
+
*/
|
|
89
|
+
componentBom?: {
|
|
90
|
+
bytes: string;
|
|
91
|
+
mediaType: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Result of `publish-image`'s best-effort OCI-referrer attach step (#610) — always present when `input.sbom`/`input.componentBom` was supplied, `undefined` when neither was (nothing to attach, attach step skipped entirely). */
|
|
95
|
+
export interface ReferrerAttachResult {
|
|
96
|
+
/** True once every requested attach (`sbom`, `componentBom`) succeeded. `false` if `oras` was unavailable or any `oras attach` invocation failed. */
|
|
97
|
+
attached: boolean;
|
|
98
|
+
/** Human-readable reason `attached` is `false` (e.g. "oras is not installed"), omitted when `attached` is `true`. */
|
|
99
|
+
reason?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface PublishImageOutput {
|
|
102
|
+
/** Content-addressed digest of the promoted image (`sha256:...`) — what the apply step references. */
|
|
103
|
+
digest: string;
|
|
104
|
+
/** Image reference the apply step can pull/run: `registry/repo@sha256:...` for `publish-image`, a host-local reference for `load-image-on-host`. */
|
|
105
|
+
uri: string;
|
|
106
|
+
/** #610: outcome of the best-effort SBOM/component-BOM referrer attach, when `input.sbom`/`input.componentBom` was supplied. `undefined` for `load-image-on-host` (no attach concept — registry-less) and for `publish-image` calls that supplied neither. */
|
|
107
|
+
referrerAttach?: ReferrerAttachResult;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Common shape both image-publish backends satisfy: promote the image bytes
|
|
111
|
+
* held in the build archive to wherever the deploy target can consume them,
|
|
112
|
+
* and return the identity the apply step references. The backend is
|
|
113
|
+
* selected per environment (`selectPublishBackend`), never per component.
|
|
114
|
+
*/
|
|
115
|
+
export type PublishImageBackend = Capability<PublishImageInput, PublishImageOutput>;
|
|
116
|
+
/**
|
|
117
|
+
* Promote a built image from the archive into the environment's container
|
|
118
|
+
* registry: `docker load` the archived tarball, tag it for `to` (the env
|
|
119
|
+
* registry), `aws ecr get-login-password | docker login`, then `docker push`.
|
|
120
|
+
* Returns the pushed image's registry digest — what `cfn-deploy`/
|
|
121
|
+
* `ecs-update-service` reference via `imageRef: "@Publish.digest"`. No
|
|
122
|
+
* rollback: an already-pushed, still-valid image in the registry is not
|
|
123
|
+
* itself a problem to compensate (immutable, content-addressed, and simply
|
|
124
|
+
* unreferenced if a later step fails) — the opt-out this capability takes.
|
|
125
|
+
*
|
|
126
|
+
* #610: when `input.sbom` and/or `input.componentBom` are supplied, also
|
|
127
|
+
* attaches them as OCI referrers on the pushed digest via `oras attach` (see
|
|
128
|
+
* `attachReferrers` above) — best-effort, guarded on `oras` availability,
|
|
129
|
+
* surfaced on the output's `referrerAttach` rather than failing the publish.
|
|
130
|
+
*/
|
|
131
|
+
export declare function createPublishImageCapability(executor?: CloudExecutor, processRunner?: ProcessRunner): PublishImageBackend;
|
|
132
|
+
/** Default `publish-image` capability, backed by the real `CloudExecutor`. */
|
|
133
|
+
export declare const publishImageCapability: PublishImageBackend;
|
|
134
|
+
/**
|
|
135
|
+
* Copy the image tarball straight onto a host and `docker load` it there —
|
|
136
|
+
* genuinely registry-free promotion (#564): no `docker.push`, no ECR login,
|
|
137
|
+
* no registry ever in the path. Still promotes **by digest**: the tarball
|
|
138
|
+
* copied is the exact archive artifact `docker-build` produced, so the image
|
|
139
|
+
* loaded on the host is byte-identical to the one tested in any other
|
|
140
|
+
* environment, satisfying the same build-once invariant `publish-image`
|
|
141
|
+
* does. No rollback, for the same reason `publish-image` declares none: an
|
|
142
|
+
* already-loaded, content-addressed image sitting in a host's local Docker
|
|
143
|
+
* store is not itself a problem to compensate.
|
|
144
|
+
*
|
|
145
|
+
* See docs/components/build-archive.mdx#registry-less-caveat: this makes
|
|
146
|
+
* *your built* image registry-free. Third-party images a compose file
|
|
147
|
+
* references (`postgres:16`, `redis`) still pull from their upstream
|
|
148
|
+
* registry at `compose up` unless they are archived and loaded the same way.
|
|
149
|
+
*/
|
|
150
|
+
export declare function createLoadImageOnHostCapability(executor?: CloudExecutor): PublishImageBackend;
|
|
151
|
+
/** Default `load-image-on-host` capability, backed by the real `CloudExecutor`. */
|
|
152
|
+
export declare const loadImageOnHostCapability: PublishImageBackend;
|
|
153
|
+
/** The `kind` of either image-publish backend — what an environment's config declares as its choice. */
|
|
154
|
+
export type PublishImageBackendKind = "publish-image" | "load-image-on-host";
|
|
155
|
+
/**
|
|
156
|
+
* Resolve which publish backend an environment uses, given its declared
|
|
157
|
+
* `kind` (`$env.publish.kind` in the component's env config — see
|
|
158
|
+
* docs/components/build-archive.mdx#backend-selection-is-per-environment).
|
|
159
|
+
* The decision is per environment, not per component: the same component's
|
|
160
|
+
* `Publish` phase runs `publish-image` against dev's ECR and
|
|
161
|
+
* `load-image-on-host` against a locked-down prod host, with no change to
|
|
162
|
+
* the component's own composition — only the env config `kind` differs.
|
|
163
|
+
*
|
|
164
|
+
* Accepts an optional registry of backends so a caller can extend the set
|
|
165
|
+
* (e.g. a third-party plugin registering another `PublishImageBackend`)
|
|
166
|
+
* without this function needing to change; defaults to the two starter-set
|
|
167
|
+
* backends built above.
|
|
168
|
+
*/
|
|
169
|
+
export declare function selectPublishBackend(kind: PublishImageBackendKind, backends?: Partial<Record<PublishImageBackendKind, PublishImageBackend>>): PublishImageBackend;
|
|
170
|
+
export interface PublishArtifactInput {
|
|
171
|
+
/** Path of the artifact inside the build archive (e.g. a jar or zip). */
|
|
172
|
+
from: string;
|
|
173
|
+
/** Destination (e.g. `$env.s3` resolved by the orchestrator). */
|
|
174
|
+
to: string;
|
|
175
|
+
}
|
|
176
|
+
export interface PublishArtifactOutput {
|
|
177
|
+
/** Location the artifact was published to — referenced downstream as `@<component>.publish.uri`. */
|
|
178
|
+
uri: string;
|
|
179
|
+
/** Content hash of the published artifact. */
|
|
180
|
+
digest: string;
|
|
181
|
+
}
|
|
182
|
+
/** Promote a non-image artifact (jar, zip, arbitrary asset) from the archive to S3/CodeArtifact. */
|
|
183
|
+
/**
|
|
184
|
+
* Publish a single archive artifact (a jar, zip, or asset) to S3 via `aws s3 cp`
|
|
185
|
+
* (endpoint-aware through the `CloudExecutor`). Returns the object's URI —
|
|
186
|
+
* referenced downstream as `@<component>.publish.uri` — and a content digest of
|
|
187
|
+
* the exact bytes uploaded.
|
|
188
|
+
*/
|
|
189
|
+
export declare function createPublishArtifactCapability(executor?: CloudExecutor): Capability<PublishArtifactInput, PublishArtifactOutput>;
|
|
190
|
+
/** Default `publish-artifact` capability, backed by the real `CloudExecutor`. */
|
|
191
|
+
export declare const publishArtifactCapability: Capability<PublishArtifactInput, PublishArtifactOutput>;
|
|
192
|
+
/** Alias for `publish-artifact` — same capability, the docs/epic use both names for the same verb. */
|
|
193
|
+
export declare const publishAssetCapability: Capability<PublishArtifactInput, PublishArtifactOutput>;
|
|
194
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/components/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGzE,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAI/G;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,qJAAqJ;IACrJ,IAAI,EAAE,MAAM,CAAC;IACb,+IAA+I;IAC/I,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6HAA6H;IAC7H,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yIAAyI;IACzI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;;;OAKG;IACH,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,oOAAoO;AACpO,MAAM,WAAW,oBAAoB;IACnC,qJAAqJ;IACrJ,QAAQ,EAAE,OAAO,CAAC;IAClB,qHAAqH;IACrH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,sGAAsG;IACtG,MAAM,EAAE,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AE,UAAU,CAAC,oBAAoB,EAAE,qBAAqB,CAC3D,CAAC;AAEpC,sGAAsG;AACtG,eAAO,MAAM,sBAAsB,yDAA4B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* safety / rollback family — explicit snapshot-and-restore capabilities, used
|
|
3
|
+
* alongside the per-capability `rollback` compensation for cases that need an
|
|
4
|
+
* up-front capture (e.g. before a `cfn-deploy` with `onReplace: "snapshot-first"`).
|
|
5
|
+
*
|
|
6
|
+
* Both dispatch to the kind-appropriate AWS backup/restore mechanism through the
|
|
7
|
+
* injectable `CloudExecutor` (DynamoDB backup, RDS DB snapshot, EBS snapshot).
|
|
8
|
+
*/
|
|
9
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
10
|
+
import { type CloudExecutor } from "./cloud-executor.js";
|
|
11
|
+
export interface SnapshotBeforeInput {
|
|
12
|
+
/** Resource identifier to snapshot (e.g. a DynamoDB table name, an RDS instance id). */
|
|
13
|
+
resource: string;
|
|
14
|
+
/** Resource kind, used to select the right snapshot mechanism. */
|
|
15
|
+
resourceKind: "dynamodb-table" | "rds-instance" | "opensearch-domain" | "ebs-volume";
|
|
16
|
+
}
|
|
17
|
+
export interface SnapshotBeforeOutput {
|
|
18
|
+
/** Snapshot identifier, for `rollback-previous` to restore from. */
|
|
19
|
+
snapshotId: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Capture a restorable snapshot before a risky/destructive apply step, via the
|
|
23
|
+
* kind-appropriate AWS backup mechanism through the injectable `CloudExecutor`
|
|
24
|
+
* (DynamoDB on-demand backup, RDS DB snapshot, or EBS volume snapshot). Returns
|
|
25
|
+
* the backup/snapshot id `rollback-previous` restores from.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createSnapshotBeforeCapability(executor?: CloudExecutor): Capability<SnapshotBeforeInput, SnapshotBeforeOutput>;
|
|
28
|
+
/** Default `snapshot-before` capability, backed by the real `CloudExecutor`. */
|
|
29
|
+
export declare const snapshotBeforeCapability: Capability<SnapshotBeforeInput, SnapshotBeforeOutput>;
|
|
30
|
+
export interface RollbackPreviousInput {
|
|
31
|
+
/** Snapshot identifier to restore (typically `"@snapshot-before.snapshotId"`). */
|
|
32
|
+
snapshotId: string;
|
|
33
|
+
/** Resource identifier being restored. */
|
|
34
|
+
resource: string;
|
|
35
|
+
}
|
|
36
|
+
export interface RollbackPreviousOutput {
|
|
37
|
+
/** True once the restore completed. */
|
|
38
|
+
restored: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Restore a resource from a prior `snapshot-before` capture — an explicit,
|
|
42
|
+
* caller-composed rollback (not the auto-triggered per-capability compensation).
|
|
43
|
+
* Dispatches by the snapshot-id shape through the `CloudExecutor` and waits for
|
|
44
|
+
* the restore to become available.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createRollbackPreviousCapability(executor?: CloudExecutor): Capability<RollbackPreviousInput, RollbackPreviousOutput>;
|
|
47
|
+
/** Default `rollback-previous` capability, backed by the real `CloudExecutor`. */
|
|
48
|
+
export declare const rollbackPreviousCapability: Capability<RollbackPreviousInput, RollbackPreviousOutput>;
|
|
49
|
+
//# sourceMappingURL=safety.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/components/safety.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAI5E,MAAM,WAAW,mBAAmB;IAClC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,YAAY,EAAE,gBAAgB,GAAG,cAAc,GAAG,mBAAmB,GAAG,YAAY,CAAC;CACtF;AAED,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,GAAE,aAAsC,GAAG,UAAU,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAOtJ;AAED,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,EAAE,UAAU,CAAC,mBAAmB,EAAE,oBAAoB,CACzD,CAAC;AAInC,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,GAAE,aAAsC,GAAG,UAAU,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAQ5J;AAED,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,EAAE,UAAU,CAAC,qBAAqB,EAAE,sBAAsB,CAC7D,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wait / verify family — the cloud-specific members, owned by the aws lexicon:
|
|
3
|
+
* `wait-for-stack` (CloudFormation), `wait-steady-state` (ECS), `wait-job`
|
|
4
|
+
* (EMR). The agnostic waits (`wait-cluster-healthy`, `wait-endpoint`,
|
|
5
|
+
* `health-gate`) stay in core. All poll a real cloud through the injectable aws
|
|
6
|
+
* `CloudExecutor` (./cloud-executor.ts); none has a rollback — a wait is a
|
|
7
|
+
* read-only observation, never a mutation.
|
|
8
|
+
*/
|
|
9
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
10
|
+
import { type CloudExecutor } from "./cloud-executor.js";
|
|
11
|
+
export interface WaitForStackInput {
|
|
12
|
+
/** CloudFormation stack name. */
|
|
13
|
+
stack: string;
|
|
14
|
+
/** Poll interval in ms. Default: 10000. */
|
|
15
|
+
intervalMs?: number;
|
|
16
|
+
/** Overall timeout in ms. */
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface WaitForStackOutput {
|
|
20
|
+
/** Terminal stack status (`CREATE_COMPLETE`, `UPDATE_COMPLETE`, ...). */
|
|
21
|
+
stackStatus: string;
|
|
22
|
+
}
|
|
23
|
+
/** Poll a CloudFormation stack until it reaches a terminal status. No rollback: a wait is a read-only observation. */
|
|
24
|
+
export declare function createWaitForStackCapability(executor?: CloudExecutor): Capability<WaitForStackInput, WaitForStackOutput>;
|
|
25
|
+
/** Default `wait-for-stack` capability, backed by the real aws `CloudExecutor`. */
|
|
26
|
+
export declare const waitForStackCapability: Capability<WaitForStackInput, WaitForStackOutput>;
|
|
27
|
+
export interface WaitSteadyStateInput {
|
|
28
|
+
/** Service identifier (e.g. an ECS service name). */
|
|
29
|
+
service: string;
|
|
30
|
+
/** ECS cluster name/ARN the service lives in. Default: "default". */
|
|
31
|
+
cluster?: string;
|
|
32
|
+
/** Poll interval in ms. Default: 10000. */
|
|
33
|
+
intervalMs?: number;
|
|
34
|
+
/** Overall timeout in ms. Default: 10 minutes. */
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface WaitSteadyStateOutput {
|
|
38
|
+
/** Running task/instance count once steady state is reached. */
|
|
39
|
+
runningCount: number;
|
|
40
|
+
}
|
|
41
|
+
/** Poll an ECS service until running count matches desired and no deployment is in flight. No rollback: read-only. */
|
|
42
|
+
export declare function createWaitSteadyStateCapability(executor?: CloudExecutor): Capability<WaitSteadyStateInput, WaitSteadyStateOutput>;
|
|
43
|
+
/** Default `wait-steady-state` capability, backed by the real aws `CloudExecutor`. */
|
|
44
|
+
export declare const waitSteadyStateCapability: Capability<WaitSteadyStateInput, WaitSteadyStateOutput>;
|
|
45
|
+
export interface WaitJobInput {
|
|
46
|
+
/** Job/step run id (e.g. from `emr-start-job-run` or `emr-submit-step`). */
|
|
47
|
+
runId: string;
|
|
48
|
+
/** Poll interval in ms. Default: 10000. */
|
|
49
|
+
intervalMs?: number;
|
|
50
|
+
/** Overall timeout in ms. */
|
|
51
|
+
timeoutMs?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface WaitJobOutput {
|
|
54
|
+
/** Terminal job state (`COMPLETED`, `FAILED`, `CANCELLED`). */
|
|
55
|
+
state: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Poll a submitted job/step (e.g. an EMR job run started by `emr-start-job-run`)
|
|
59
|
+
* until it reaches a terminal state, failing the step if that state is not
|
|
60
|
+
* `COMPLETED`. No rollback: read-only observation.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createWaitJobCapability(executor?: CloudExecutor): Capability<WaitJobInput, WaitJobOutput>;
|
|
63
|
+
/** Default `wait-job` capability, backed by the real aws `CloudExecutor`. */
|
|
64
|
+
export declare const waitJobCapability: Capability<WaitJobInput, WaitJobOutput>;
|
|
65
|
+
//# sourceMappingURL=wait-aws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait-aws.d.ts","sourceRoot":"","sources":["../../src/components/wait-aws.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAInF,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,sHAAsH;AACtH,wBAAgB,4BAA4B,CAC1C,QAAQ,GAAE,aAAsC,GAC/C,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAWnD;AAED,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,E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