typekro 0.12.0 → 0.13.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/.tsbuildinfo +1 -1
- package/dist/core/constants/brands.d.ts +1 -1
- package/dist/core/constants/brands.d.ts.map +1 -1
- package/dist/core/constants/brands.js +1 -1
- package/dist/core/constants/brands.js.map +1 -1
- package/dist/core/containers/image.d.ts +65 -0
- package/dist/core/containers/image.d.ts.map +1 -0
- package/dist/core/containers/image.js +51 -0
- package/dist/core/containers/image.js.map +1 -0
- package/dist/core/containers/index.d.ts +14 -6
- package/dist/core/containers/index.d.ts.map +1 -1
- package/dist/core/containers/index.js +14 -6
- package/dist/core/containers/index.js.map +1 -1
- package/dist/core/containers/resolve.d.ts +14 -0
- package/dist/core/containers/resolve.d.ts.map +1 -0
- package/dist/core/containers/resolve.js +88 -0
- package/dist/core/containers/resolve.js.map +1 -0
- package/dist/core/deployment/direct-factory.d.ts.map +1 -1
- package/dist/core/deployment/direct-factory.js +7 -0
- package/dist/core/deployment/direct-factory.js.map +1 -1
- package/dist/core/deployment/kro-factory.d.ts +7 -0
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +29 -2
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/deployment/singleton-gitops.d.ts +10 -0
- package/dist/core/deployment/singleton-gitops.d.ts.map +1 -0
- package/dist/core/deployment/singleton-gitops.js +62 -0
- package/dist/core/deployment/singleton-gitops.js.map +1 -0
- package/dist/core/serialization/cel-references.d.ts.map +1 -1
- package/dist/core/serialization/cel-references.js +26 -0
- package/dist/core/serialization/cel-references.js.map +1 -1
- package/dist/core/serialization/core.d.ts.map +1 -1
- package/dist/core/serialization/core.js +12 -1
- package/dist/core/serialization/core.js.map +1 -1
- package/dist/core/serialization/schema.d.ts +2 -0
- package/dist/core/serialization/schema.d.ts.map +1 -1
- package/dist/core/serialization/schema.js +219 -9
- package/dist/core/serialization/schema.js.map +1 -1
- package/dist/core/singleton/singleton.d.ts +10 -0
- package/dist/core/singleton/singleton.d.ts.map +1 -1
- package/dist/core/singleton/singleton.js +13 -0
- package/dist/core/singleton/singleton.js.map +1 -1
- package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts +0 -2
- package/dist/factories/dagster/compositions/dagster-bootstrap.d.ts.map +1 -1
- package/dist/factories/dagster/compositions/dagster-bootstrap.js +18 -11
- package/dist/factories/dagster/compositions/dagster-bootstrap.js.map +1 -1
- package/dist/factories/dagster/compositions/dagster-helm-repository.d.ts +21 -0
- package/dist/factories/dagster/compositions/dagster-helm-repository.d.ts.map +1 -0
- package/dist/factories/dagster/compositions/dagster-helm-repository.js +34 -0
- package/dist/factories/dagster/compositions/dagster-helm-repository.js.map +1 -0
- package/dist/factories/dagster/compositions/index.d.ts +1 -0
- package/dist/factories/dagster/compositions/index.d.ts.map +1 -1
- package/dist/factories/dagster/compositions/index.js +1 -0
- package/dist/factories/dagster/compositions/index.js.map +1 -1
- package/dist/factories/dagster/types.d.ts +15 -2
- package/dist/factories/dagster/types.d.ts.map +1 -1
- package/dist/factories/dagster/types.js +15 -2
- package/dist/factories/dagster/types.js.map +1 -1
- package/dist/factories/dagster/utils/helm-values-mapper.js +1 -1
- package/dist/factories/dagster/utils/helm-values-mapper.js.map +1 -1
- package/dist/shared/brands.d.ts +9 -0
- package/dist/shared/brands.d.ts.map +1 -1
- package/dist/shared/brands.js +9 -0
- package/dist/shared/brands.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* New code within `src/utils/` should import directly from `../../shared/brands.js`
|
|
6
6
|
* to maintain the clean dependency direction: `shared/ <-- utils/ <-- core/`.
|
|
7
7
|
*/
|
|
8
|
-
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, KUBERNETES_REF_BRAND, KUBERNETES_REF_MARKER_FIELD_PATH_SOURCE, KUBERNETES_REF_MARKER_PATTERN, KUBERNETES_REF_MARKER_RESOURCE_ID_SOURCE, KUBERNETES_REF_MARKER_SOURCE, KUBERNETES_REF_SCHEMA_MARKER_SOURCE, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, SINGLETON_HANDLE_BRAND, } from '../../shared/brands.js';
|
|
8
|
+
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, CONTAINER_IMAGE_REF_BRAND, KUBERNETES_REF_BRAND, KUBERNETES_REF_MARKER_FIELD_PATH_SOURCE, KUBERNETES_REF_MARKER_PATTERN, KUBERNETES_REF_MARKER_RESOURCE_ID_SOURCE, KUBERNETES_REF_MARKER_SOURCE, KUBERNETES_REF_SCHEMA_MARKER_SOURCE, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, SINGLETON_HANDLE_BRAND, } from '../../shared/brands.js';
|
|
9
9
|
//# sourceMappingURL=brands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,uCAAuC,EACvC,6BAA6B,EAC7B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,uCAAuC,EACvC,6BAA6B,EAC7B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* New code within `src/utils/` should import directly from `../../shared/brands.js`
|
|
6
6
|
* to maintain the clean dependency direction: `shared/ <-- utils/ <-- core/`.
|
|
7
7
|
*/
|
|
8
|
-
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, KUBERNETES_REF_BRAND, KUBERNETES_REF_MARKER_FIELD_PATH_SOURCE, KUBERNETES_REF_MARKER_PATTERN, KUBERNETES_REF_MARKER_RESOURCE_ID_SOURCE, KUBERNETES_REF_MARKER_SOURCE, KUBERNETES_REF_SCHEMA_MARKER_SOURCE, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, SINGLETON_HANDLE_BRAND, } from '../../shared/brands.js';
|
|
8
|
+
export { CALLABLE_COMPOSITION_BRAND, CEL_EXPRESSION_BRAND, CONTAINER_IMAGE_REF_BRAND, KUBERNETES_REF_BRAND, KUBERNETES_REF_MARKER_FIELD_PATH_SOURCE, KUBERNETES_REF_MARKER_PATTERN, KUBERNETES_REF_MARKER_RESOURCE_ID_SOURCE, KUBERNETES_REF_MARKER_SOURCE, KUBERNETES_REF_SCHEMA_MARKER_SOURCE, MIXED_TEMPLATE_BRAND, NESTED_COMPOSITION_BRAND, SINGLETON_HANDLE_BRAND, } from '../../shared/brands.js';
|
|
9
9
|
//# sourceMappingURL=brands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,uCAAuC,EACvC,6BAA6B,EAC7B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../src/core/constants/brands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,uCAAuC,EACvC,6BAA6B,EAC7B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Image Utility
|
|
3
|
+
*
|
|
4
|
+
* `container()` declares a container image built from source and pushed to a registry, as a
|
|
5
|
+
* FIRST-CLASS typekro utility. It is defined at program scope — OUTSIDE a `kubernetesComposition` —
|
|
6
|
+
* because an image is a build-time artifact with no dependency on cluster state; it should never be a
|
|
7
|
+
* node in the cluster resource graph. Resources WITHIN a composition reference its `.imageUri`.
|
|
8
|
+
*
|
|
9
|
+
* `.imageUri` is a `ContainerImageRef` (a distinct brand, NOT a `KubernetesRef`): typekro resolves it
|
|
10
|
+
* CLIENT-SIDE to a literal image URI before apply (direct mode) / RGD serialization (kro mode), by
|
|
11
|
+
* delegating to the existing {@link buildContainer} — once per container identity. Kro never sees a
|
|
12
|
+
* build, only a literal image string.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { container } from 'typekro/containers';
|
|
17
|
+
*
|
|
18
|
+
* // Defined OUTSIDE the composition:
|
|
19
|
+
* const appImage = container({ context: './app', imageName: 'app', registry: { type: 'ecr' } });
|
|
20
|
+
*
|
|
21
|
+
* // Referenced WITHIN one:
|
|
22
|
+
* kubernetesComposition(def, () => {
|
|
23
|
+
* Deployment({ name: 'app', image: appImage.imageUri, ports: [{ containerPort: 3000 }] });
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { CONTAINER_IMAGE_REF_BRAND } from '../constants/brands.js';
|
|
28
|
+
import type { ContainerBuildOptions } from './registries/types.js';
|
|
29
|
+
/**
|
|
30
|
+
* A reference to a container image's URI. Resolved client-side to a literal string (the built +
|
|
31
|
+
* pushed image URI) before apply / RGD serialization — distinct from a `KubernetesRef`, which is a
|
|
32
|
+
* cluster-state reference serialized to CEL.
|
|
33
|
+
*/
|
|
34
|
+
export interface ContainerImageRef<T extends string = string> {
|
|
35
|
+
readonly [CONTAINER_IMAGE_REF_BRAND]: true;
|
|
36
|
+
/** Stable identity — multiple references to the same container build the image only ONCE. */
|
|
37
|
+
readonly containerId: string;
|
|
38
|
+
/** The build spec, carried inline so the resolver is self-contained (delegates to `buildContainer`). */
|
|
39
|
+
readonly buildOptions: ContainerBuildOptions;
|
|
40
|
+
readonly _type?: T;
|
|
41
|
+
}
|
|
42
|
+
/** A first-class container image: defined outside a composition, referenced within one. */
|
|
43
|
+
export interface ContainerImage {
|
|
44
|
+
/**
|
|
45
|
+
* The image-URI reference — assign to any resource image field (e.g. a container's `image`). Typed
|
|
46
|
+
* as `string` so it's assignable to plain string fields, exactly like typekro's schema/resource
|
|
47
|
+
* refs; at RUNTIME it is a branded {@link ContainerImageRef} that the resolver substitutes with the
|
|
48
|
+
* built image URI at deploy time. Use {@link isContainerImageRef} to detect it.
|
|
49
|
+
*/
|
|
50
|
+
readonly imageUri: string;
|
|
51
|
+
}
|
|
52
|
+
/** Options for {@link container}: the {@link ContainerBuildOptions} plus an optional stable identity. */
|
|
53
|
+
export interface ContainerOptions extends ContainerBuildOptions {
|
|
54
|
+
/** Stable identity for dedup across references; defaults to `imageName`. Set when two containers share one. */
|
|
55
|
+
id?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Declare a container image as a first-class typekro utility (see the module doc). Returns a handle
|
|
59
|
+
* whose `.imageUri` is referenced from resources; the build (via {@link buildContainer}) happens once
|
|
60
|
+
* at deploy time and the literal URI is substituted before apply / serialization.
|
|
61
|
+
*/
|
|
62
|
+
export declare function container(options: ContainerOptions): ContainerImage;
|
|
63
|
+
/** Type guard: is `value` a {@link ContainerImageRef} (the `.imageUri` of a `container()`)? */
|
|
64
|
+
export declare function isContainerImageRef(value: unknown): value is ContainerImageRef;
|
|
65
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/core/containers/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC1D,QAAQ,CAAC,CAAC,yBAAyB,CAAC,EAAE,IAAI,CAAC;IAC3C,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;CACpB;AAED,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,yGAAyG;AACzG,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,+GAA+G;IAC/G,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAWnE;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAM9E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Image Utility
|
|
3
|
+
*
|
|
4
|
+
* `container()` declares a container image built from source and pushed to a registry, as a
|
|
5
|
+
* FIRST-CLASS typekro utility. It is defined at program scope — OUTSIDE a `kubernetesComposition` —
|
|
6
|
+
* because an image is a build-time artifact with no dependency on cluster state; it should never be a
|
|
7
|
+
* node in the cluster resource graph. Resources WITHIN a composition reference its `.imageUri`.
|
|
8
|
+
*
|
|
9
|
+
* `.imageUri` is a `ContainerImageRef` (a distinct brand, NOT a `KubernetesRef`): typekro resolves it
|
|
10
|
+
* CLIENT-SIDE to a literal image URI before apply (direct mode) / RGD serialization (kro mode), by
|
|
11
|
+
* delegating to the existing {@link buildContainer} — once per container identity. Kro never sees a
|
|
12
|
+
* build, only a literal image string.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { container } from 'typekro/containers';
|
|
17
|
+
*
|
|
18
|
+
* // Defined OUTSIDE the composition:
|
|
19
|
+
* const appImage = container({ context: './app', imageName: 'app', registry: { type: 'ecr' } });
|
|
20
|
+
*
|
|
21
|
+
* // Referenced WITHIN one:
|
|
22
|
+
* kubernetesComposition(def, () => {
|
|
23
|
+
* Deployment({ name: 'app', image: appImage.imageUri, ports: [{ containerPort: 3000 }] });
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { CONTAINER_IMAGE_REF_BRAND } from '../constants/brands.js';
|
|
28
|
+
/**
|
|
29
|
+
* Declare a container image as a first-class typekro utility (see the module doc). Returns a handle
|
|
30
|
+
* whose `.imageUri` is referenced from resources; the build (via {@link buildContainer}) happens once
|
|
31
|
+
* at deploy time and the literal URI is substituted before apply / serialization.
|
|
32
|
+
*/
|
|
33
|
+
export function container(options) {
|
|
34
|
+
const { id, ...buildOptions } = options;
|
|
35
|
+
const containerId = id ?? buildOptions.imageName;
|
|
36
|
+
const ref = {
|
|
37
|
+
[CONTAINER_IMAGE_REF_BRAND]: true,
|
|
38
|
+
containerId,
|
|
39
|
+
buildOptions,
|
|
40
|
+
};
|
|
41
|
+
// Typed as `string` (assignable to any image field) but a branded ref at runtime — mirrors how
|
|
42
|
+
// typekro's schema/resource refs present as their underlying type while carrying runtime markers.
|
|
43
|
+
return { imageUri: ref };
|
|
44
|
+
}
|
|
45
|
+
/** Type guard: is `value` a {@link ContainerImageRef} (the `.imageUri` of a `container()`)? */
|
|
46
|
+
export function isContainerImageRef(value) {
|
|
47
|
+
return (typeof value === 'object' &&
|
|
48
|
+
value !== null &&
|
|
49
|
+
value[CONTAINER_IMAGE_REF_BRAND] === true);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/core/containers/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAkCnE;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,WAAW,GAAG,EAAE,IAAI,YAAY,CAAC,SAAS,CAAC;IACjD,MAAM,GAAG,GAA8B;QACrC,CAAC,yBAAyB,CAAC,EAAE,IAAI;QACjC,WAAW;QACX,YAAY;KACb,CAAC;IACF,+FAA+F;IAC/F,kGAAkG;IAClG,OAAO,EAAE,QAAQ,EAAE,GAAwB,EAAE,CAAC;AAChD,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAAiC,CAAC,yBAAyB,CAAC,KAAK,IAAI,CACvE,CAAC;AACJ,CAAC"}
|
|
@@ -4,18 +4,26 @@
|
|
|
4
4
|
* Build Docker images and push them to container registries.
|
|
5
5
|
* Returns image URIs for use in TypeKro compositions.
|
|
6
6
|
*
|
|
7
|
+
* The low-level `buildContainer` builds + pushes imperatively and returns a URI. The higher-level
|
|
8
|
+
* `container()` utility wraps it declaratively: define an image once at program scope and reference
|
|
9
|
+
* its `.imageUri` from resources inside a composition — typekro builds it (via `buildContainer`) and
|
|
10
|
+
* substitutes the literal URI at deploy time.
|
|
11
|
+
*
|
|
7
12
|
* @example
|
|
8
13
|
* ```typescript
|
|
9
|
-
* import { buildContainer } from 'typekro/containers';
|
|
14
|
+
* import { buildContainer, container } from 'typekro/containers';
|
|
15
|
+
*
|
|
16
|
+
* // Imperative (build now, get a URI):
|
|
17
|
+
* const { imageUri } = await buildContainer({ context: './app', imageName: 'app', registry: { type: 'orbstack' } });
|
|
10
18
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* registry: { type: 'orbstack' },
|
|
15
|
-
* });
|
|
19
|
+
* // Declarative (defined outside a composition, referenced within):
|
|
20
|
+
* const appImage = container({ context: './app', imageName: 'app', registry: { type: 'ecr' } });
|
|
21
|
+
* // … later, inside a composition: Deployment({ image: appImage.imageUri, … })
|
|
16
22
|
* ```
|
|
17
23
|
*/
|
|
18
24
|
export { buildContainer } from './build.js';
|
|
19
25
|
export { ContainerBuildError } from './errors.js';
|
|
26
|
+
export { container, type ContainerImage, type ContainerImageRef, type ContainerOptions, isContainerImageRef } from './image.js';
|
|
27
|
+
export { hasContainerImageRefs, resolveContainerImages } from './resolve.js';
|
|
20
28
|
export type { ContainerBuildOptions, ContainerBuildResult, EcrRegistryConfig, OrbstackRegistryConfig, RegistryConfig, } from './registries/types.js';
|
|
21
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAChI,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC7E,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
|
@@ -4,17 +4,25 @@
|
|
|
4
4
|
* Build Docker images and push them to container registries.
|
|
5
5
|
* Returns image URIs for use in TypeKro compositions.
|
|
6
6
|
*
|
|
7
|
+
* The low-level `buildContainer` builds + pushes imperatively and returns a URI. The higher-level
|
|
8
|
+
* `container()` utility wraps it declaratively: define an image once at program scope and reference
|
|
9
|
+
* its `.imageUri` from resources inside a composition — typekro builds it (via `buildContainer`) and
|
|
10
|
+
* substitutes the literal URI at deploy time.
|
|
11
|
+
*
|
|
7
12
|
* @example
|
|
8
13
|
* ```typescript
|
|
9
|
-
* import { buildContainer } from 'typekro/containers';
|
|
14
|
+
* import { buildContainer, container } from 'typekro/containers';
|
|
15
|
+
*
|
|
16
|
+
* // Imperative (build now, get a URI):
|
|
17
|
+
* const { imageUri } = await buildContainer({ context: './app', imageName: 'app', registry: { type: 'orbstack' } });
|
|
10
18
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* registry: { type: 'orbstack' },
|
|
15
|
-
* });
|
|
19
|
+
* // Declarative (defined outside a composition, referenced within):
|
|
20
|
+
* const appImage = container({ context: './app', imageName: 'app', registry: { type: 'ecr' } });
|
|
21
|
+
* // … later, inside a composition: Deployment({ image: appImage.imageUri, … })
|
|
16
22
|
* ```
|
|
17
23
|
*/
|
|
18
24
|
export { buildContainer } from './build.js';
|
|
19
25
|
export { ContainerBuildError } from './errors.js';
|
|
26
|
+
export { container, isContainerImageRef } from './image.js';
|
|
27
|
+
export { hasContainerImageRefs, resolveContainerImages } from './resolve.js';
|
|
20
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/containers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAsE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAChI,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ContainerImageRef } from './image.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build + substitute every container image referenced by `resources`. Returns the resolved
|
|
4
|
+
* `containerId → imageUri` map (also useful for logging/diagnostics). Mutates the resources in place.
|
|
5
|
+
*
|
|
6
|
+
* `build` defaults to the real {@link buildContainer}; it is injectable purely so tests can resolve
|
|
7
|
+
* without a Docker daemon (avoids globally mocking the build module, which would leak across files).
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveContainerImages(resources: readonly unknown[], build?: (options: ContainerImageRef['buildOptions']) => Promise<{
|
|
10
|
+
imageUri: string;
|
|
11
|
+
}>): Promise<Map<string, string>>;
|
|
12
|
+
/** Whether any resource in the set references a container image (cheap pre-check to skip resolution). */
|
|
13
|
+
export declare function hasContainerImageRefs(resources: readonly unknown[]): boolean;
|
|
14
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/core/containers/resolve.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAgCzE;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,SAAS,OAAO,EAAE,EAC7B,KAAK,GAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,cAAc,CAAC,KACvC,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAkB,GAClD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+B9B;AAED,yGAAyG;AACzG,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAS5E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Image Resolution
|
|
3
|
+
*
|
|
4
|
+
* Resolves every {@link ContainerImageRef} reachable from a set of resources to its literal image URI,
|
|
5
|
+
* building each distinct container ONCE by delegating to the existing {@link buildContainer} (this
|
|
6
|
+
* module adds NO build/push logic of its own). The refs are replaced in place with the URI string.
|
|
7
|
+
*
|
|
8
|
+
* Runs CLIENT-SIDE before apply (direct mode) / RGD serialization (kro mode), so a container image is
|
|
9
|
+
* never a CEL expression and Kro only ever sees a literal image string.
|
|
10
|
+
*/
|
|
11
|
+
import { getComponentLogger } from '../logging/index.js';
|
|
12
|
+
import { buildContainer } from './build.js';
|
|
13
|
+
import { isContainerImageRef } from './image.js';
|
|
14
|
+
const logger = getComponentLogger('container-resolve');
|
|
15
|
+
/** Deep-walk a value, invoking `onRef` for every ContainerImageRef found (cycle-safe). */
|
|
16
|
+
function walk(value, seen, onRef, parent, key) {
|
|
17
|
+
if (isContainerImageRef(value)) {
|
|
18
|
+
if (parent !== undefined && key !== undefined)
|
|
19
|
+
onRef(value, parent, key);
|
|
20
|
+
return; // never descend into a ref's internals
|
|
21
|
+
}
|
|
22
|
+
if (value === null || typeof value !== 'object')
|
|
23
|
+
return;
|
|
24
|
+
if (seen.has(value))
|
|
25
|
+
return;
|
|
26
|
+
seen.add(value);
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
value.forEach((item, i) => walk(item, seen, onRef, value, i));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
for (const k of Object.keys(value)) {
|
|
32
|
+
walk(value[k], seen, onRef, value, k);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build + substitute every container image referenced by `resources`. Returns the resolved
|
|
38
|
+
* `containerId → imageUri` map (also useful for logging/diagnostics). Mutates the resources in place.
|
|
39
|
+
*
|
|
40
|
+
* `build` defaults to the real {@link buildContainer}; it is injectable purely so tests can resolve
|
|
41
|
+
* without a Docker daemon (avoids globally mocking the build module, which would leak across files).
|
|
42
|
+
*/
|
|
43
|
+
export async function resolveContainerImages(resources, build = buildContainer) {
|
|
44
|
+
// 1. Collect the distinct containers referenced anywhere in the resource set.
|
|
45
|
+
const byId = new Map();
|
|
46
|
+
for (const resource of resources) {
|
|
47
|
+
walk(resource, new Set(), (ref) => {
|
|
48
|
+
if (!byId.has(ref.containerId))
|
|
49
|
+
byId.set(ref.containerId, ref);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (byId.size === 0)
|
|
53
|
+
return new Map();
|
|
54
|
+
// 2. Build each distinct container ONCE (delegating to buildContainer — the existing push mechanics).
|
|
55
|
+
const uriByContainer = new Map();
|
|
56
|
+
for (const [containerId, ref] of byId) {
|
|
57
|
+
logger.info('Building container image for reference', {
|
|
58
|
+
containerId,
|
|
59
|
+
imageName: ref.buildOptions.imageName,
|
|
60
|
+
});
|
|
61
|
+
const { imageUri } = await build(ref.buildOptions);
|
|
62
|
+
uriByContainer.set(containerId, imageUri);
|
|
63
|
+
logger.info('Resolved container image', { containerId, imageUri });
|
|
64
|
+
}
|
|
65
|
+
// 3. Substitute every ref with its resolved literal URI, in place.
|
|
66
|
+
for (const resource of resources) {
|
|
67
|
+
walk(resource, new Set(), (ref, parent, key) => {
|
|
68
|
+
const uri = uriByContainer.get(ref.containerId);
|
|
69
|
+
if (uri === undefined)
|
|
70
|
+
return;
|
|
71
|
+
parent[key] = uri;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return uriByContainer;
|
|
75
|
+
}
|
|
76
|
+
/** Whether any resource in the set references a container image (cheap pre-check to skip resolution). */
|
|
77
|
+
export function hasContainerImageRefs(resources) {
|
|
78
|
+
let found = false;
|
|
79
|
+
for (const resource of resources) {
|
|
80
|
+
walk(resource, new Set(), () => {
|
|
81
|
+
found = true;
|
|
82
|
+
});
|
|
83
|
+
if (found)
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
return found;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/core/containers/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAA0B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,MAAM,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;AAEvD,0FAA0F;AAC1F,SAAS,IAAI,CACX,KAAc,EACd,IAAiB,EACjB,KAIS,EACT,MAA4C,EAC5C,GAAqB;IAErB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACzE,OAAO,CAAC,uCAAuC;IACjD,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO;IACxD,IAAI,IAAI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IA6CjC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,qCAAqC;IAqC7C;;;OAGG;IACH,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,yBAAyB;IAOjC;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAyJvC;;OAEG;IACH,OAAO,CAAC,oBAAoB;YAKd,qBAAqB;YAkGrB,qBAAqB;IAqInC,OAAO,CAAC,+CAA+C;IAiCvD,OAAO,CAAC,kCAAkC;IAkC1C,OAAO,CAAC,yBAAyB;IA8CjC,OAAO,CAAC,8BAA8B;IAsBtC,OAAO,CAAC,kBAAkB;CAI3B;AAwED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,SAAS,iBAAiB,EAC/B,OAAO,SAAS,iBAAiB,EAEjC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC7C,gBAAgB,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,EAElD,aAAa,CAAC,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAClD,OAAO,GAAE,cAAmB,GAC3B,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,CAQvC"}
|
|
@@ -10,6 +10,7 @@ import { isCelExpression, isKubernetesRef } from '../../utils/type-guards.js';
|
|
|
10
10
|
import { applyAspects } from '../aspects/apply.js';
|
|
11
11
|
import { createCompositionContext, runWithCompositionContext } from '../composition/context.js';
|
|
12
12
|
import { buildNestedCompositionAliasTargets } from '../composition/nested-status-cel.js';
|
|
13
|
+
import { hasContainerImageRefs, resolveContainerImages } from '../containers/index.js';
|
|
13
14
|
import { DEFAULT_DELETE_TIMEOUT, DEFAULT_FAST_POLL_INTERVAL, DEFAULT_MAX_RECURSION_DEPTH, } from '../config/defaults.js';
|
|
14
15
|
import { KUBERNETES_REF_SCHEMA_MARKER_SOURCE } from '../constants/brands.js';
|
|
15
16
|
import { DependencyResolver } from '../dependencies/index.js';
|
|
@@ -127,6 +128,12 @@ export class DirectResourceFactoryImpl {
|
|
|
127
128
|
kind: this.schemaDefinition.kind,
|
|
128
129
|
name: this.name,
|
|
129
130
|
});
|
|
131
|
+
// Build + substitute any container() image refs to literal URIs (via buildContainer) before any
|
|
132
|
+
// resource is applied — images are client-side artifacts, never cluster references.
|
|
133
|
+
const resourceList = Object.values(this.resources);
|
|
134
|
+
if (hasContainerImageRefs(resourceList)) {
|
|
135
|
+
await resolveContainerImages(resourceList);
|
|
136
|
+
}
|
|
130
137
|
// Use the consolidated deployment strategy
|
|
131
138
|
const strategy = this.getDeploymentStrategy();
|
|
132
139
|
this.logger.debug('Got deployment strategy', {
|