@wildo-ai/wildo-cli 1.1.14 → 1.1.15
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/src/commands/generate/email-command.utils.d.ts +2 -0
- package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/email-command.utils.js +5 -0
- package/dist/src/commands/generate/email-command.utils.js.map +1 -1
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +7 -2
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
- package/dist/src/commands/local/deregister.command.js +4 -0
- package/dist/src/commands/local/deregister.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +6 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +72 -0
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
- package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-command.utils.js +44 -0
- package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
- package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
- package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-run.command.js +92 -0
- package/dist/src/commands/local/jobs-run.command.js.map +1 -0
- package/dist/src/commands/local/jobs.command.d.ts +7 -0
- package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs.command.js +59 -0
- package/dist/src/commands/local/jobs.command.js.map +1 -0
- package/dist/src/commands/local/tunnel.command.d.ts +84 -0
- package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
- package/dist/src/commands/local/tunnel.command.js +274 -0
- package/dist/src/commands/local/tunnel.command.js.map +1 -0
- package/dist/src/services/application/app-bootstrap.service.d.ts +41 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.js +49 -3
- package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.js +9 -1
- package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
- package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
- package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
- package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
- package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
- package/dist/src/services/application/local-tunnel.service.js +294 -0
- package/dist/src/services/application/local-tunnel.service.js.map +1 -0
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +3 -0
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
- package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.js +2 -0
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
- package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
- package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.js +1 -1
- package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.js +12 -3
- package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
- package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +3 -3
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +16 -12
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.js +12 -3
- package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +17 -7
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +124 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +249 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.d.ts +9 -0
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +20 -1
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +37 -5
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +47 -32
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.js +17 -6
- package/dist/src/services/environment/environment-setup.service.js.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts +4 -3
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js +0 -1
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +55 -15
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +115 -25
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- package/dist/src/services/security/csp-sync.service.js +21 -2
- package/dist/src/services/security/csp-sync.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +14 -7
- package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
- package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
- package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
- package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
- package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
- package/wildo-framework.info.json +1 -1
|
@@ -51,7 +51,6 @@ export class EnvironmentUtils {
|
|
|
51
51
|
static selfHostsBackingService(env, kind) { return EnvironmentLifecycle.selfHostsBackingService(env, kind); }
|
|
52
52
|
/** @see EnvironmentLifecycle.servesBackingServiceOffCluster — a USED kind served from outside the deployment (#3511). */
|
|
53
53
|
static servesBackingServiceOffCluster(env, kind) { return EnvironmentLifecycle.servesBackingServiceOffCluster(env, kind); }
|
|
54
|
-
static getRequiredInfraServices(envName) { return EnvironmentLifecycle.getRequiredInfraServices(envName); }
|
|
55
54
|
static getRequiredPlatformServices() { return EnvironmentLifecycle.getRequiredPlatformServices(); }
|
|
56
55
|
static getRuntime(envName) { return EnvironmentLifecycle.getRuntime(envName); }
|
|
57
56
|
static detectOS() { return EnvironmentLifecycle.detectOS(); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.service.js","sourceRoot":"","sources":["../../../../src/services/environment/environment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AAErG,MAAM,OAAO,gBAAgB;IAE3B,6EAA6E;IAE7E,MAAM,CAAC,IAAI,KAAgC,OAAO,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/E,MAAM,CAAC,KAAK,KAAW,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,KAAuD,OAAO,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1G,MAAM,CAAC,GAAG,CAAC,IAAY,IAAkD,OAAO,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,CAAC,UAAU,KAAmD,OAAO,mBAAmB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9G,MAAM,CAAC,cAAc,KAAa,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,IAAY,IAAU,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,CAAC,SAAS,KAAe,OAAO,mBAAmB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,OAA+F,IAAU,mBAAmB,CAAC,MAAM,CAAC,IAAI,E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AAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChG,MAAM,CAAC,QAAQ,CAAC,KAAwE,EAAE,OAAgB,IAAU,gBAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAChK,MAAM,CAAC,iBAAiB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1G,MAAM,CAAC,gBAAgB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxG,MAAM,CAAC,eAAe,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,CAAC,uBAAuB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtH,MAAM,CAAC,wBAAwB,CAAC,aAAqB,IAAmB,OAAO,gBAAgB,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC3I","sourcesContent":["/**\n * EnvironmentUtils — backward-compatible facade.\n *\n * Delegates to the three focused sub-services:\n * - EnvironmentRegistry (state persistence, CRUD, config/secrets loading)\n * - EnvironmentPaths (path resolution)\n * - EnvironmentLifecycle (initialization, setup status, database, infra)\n *\n * Existing callers continue importing { EnvironmentUtils } from this file.\n * New code should import directly from the sub-service it needs.\n */\n\nimport type {\n PlatformEnvironmentConfiguration,\n PlatformEnvironmentsState,\n PlatformEnvOperatingSystem,\n} from '~wildo-cli/services/environment/environment.schemas';\nimport type { BackingServiceKind, BackingServicesEnvConfig, PlatformWildoServices, WildoDeploymentRuntime, WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { SetupStatus } from '~wildo-cli/services/environment/environment.schemas';\nimport type {\n PlatformDatabaseChoice,\n PlatformDataServices,\n} from '~wildo-cli/services/data-services/data-services.schemas';\nimport type {\n ApplicationRuntimeIdentityJson,\n PlatformEnvConfigJson,\n PlatformEnvSecretsJson,\n} from '~wildo-cli/services/credentials/credentials.schemas';\n\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\n\nexport class EnvironmentUtils {\n\n // --- Registry delegates ---------------------------------------------------\n\n static load(): PlatformEnvironmentsState { return EnvironmentRegistry.load(); }\n static reset(): void { EnvironmentRegistry.reset(); }\n static getAll(): Record<string, PlatformEnvironmentConfiguration> { return EnvironmentRegistry.getAll(); }\n static get(name: string): PlatformEnvironmentConfiguration | undefined { return EnvironmentRegistry.get(name); }\n static getCurrent(): PlatformEnvironmentConfiguration | undefined { return EnvironmentRegistry.getCurrent(); }\n static getCurrentName(): string { return EnvironmentRegistry.getCurrentName(); }\n static switchTo(name: string): void { EnvironmentRegistry.switchTo(name); }\n static listNames(): string[] { return EnvironmentRegistry.listNames(); }\n static update(name: string, updates: Partial<Omit<PlatformEnvironmentConfiguration, 'name' | 'locationType' | 'createdAt'>>): void { EnvironmentRegistry.update(name, updates); }\n static remove(name: string): void { EnvironmentRegistry.remove(name); }\n static loadConfigJson(envName?: string): PlatformEnvConfigJson | null { return EnvironmentRegistry.loadConfigJson(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static loadSecretsJson(envName?: string): PlatformEnvSecretsJson | null { return EnvironmentRegistry.loadSecretsJson(envName, EnvironmentPaths.resolveSecretsDir(envName)); }\n static loadApplicationRuntimeIdentity(envName?: string): ApplicationRuntimeIdentityJson | null { return EnvironmentRegistry.loadApplicationRuntimeIdentity(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static saveApplicationRuntimeIdentity(envName: string, appSlug: string, applicationId: string): void { EnvironmentRegistry.saveApplicationRuntimeIdentity(envName, appSlug, applicationId, EnvironmentPaths.resolveConfigDir(envName)); }\n static clearApplicationRuntimeIdentities(envName: string): void { EnvironmentRegistry.clearApplicationRuntimeIdentities(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static invalidateCache(): void { EnvironmentRegistry.invalidateCache(); }\n\n // --- Lifecycle delegates --------------------------------------------------\n\n static initializeLocal(overrides?: Partial<PlatformEnvironmentConfiguration>): PlatformEnvironmentConfiguration { return EnvironmentLifecycle.initializeLocal(overrides); }\n static initializeEnvironment(name: string, locationType: WildoLocationType, overrides?: Partial<PlatformEnvironmentConfiguration>): PlatformEnvironmentConfiguration { return EnvironmentLifecycle.initializeEnvironment(name, locationType, overrides); }\n static updateEnvironmentState(env: PlatformEnvironmentConfiguration): void { EnvironmentLifecycle.updateEnvironmentState(env); }\n static getSetupStatus(envName?: string): SetupStatus { return EnvironmentLifecycle.getSetupStatus(envName); }\n static setSetupStatus(status: SetupStatus, envName?: string): void { EnvironmentLifecycle.setSetupStatus(status, envName); }\n static isSetupCompleted(envName?: string): boolean { return EnvironmentLifecycle.isSetupCompleted(envName); }\n static isPlatformInitialized(envName?: string): boolean { return EnvironmentLifecycle.isPlatformInitialized(envName); }\n static markPlatformInitialized(envName?: string): void { return EnvironmentLifecycle.markPlatformInitialized(envName); }\n static clearPlatformInitialized(envName?: string): void { return EnvironmentLifecycle.clearPlatformInitialized(envName); }\n static getDatabaseChoice(envName?: string): PlatformDatabaseChoice { return EnvironmentLifecycle.getDatabaseChoice(envName); }\n static getDatabaseEngine(envName?: string): import('@wildo-ai/platform-config-lib').DatabaseEngine { return EnvironmentLifecycle.getDatabaseEngine(envName); }\n static setDatabaseChoice(database: PlatformDatabaseChoice, envName?: string): void { EnvironmentLifecycle.setDatabaseChoice(database, envName); }\n /** @see EnvironmentLifecycle.needsLocalPostgreSQL — the union rule; NOT `getDatabaseEngine() === POSTGRESQL`. */\n static needsLocalPostgreSQL(env: { name: string; backingServices?: BackingServicesEnvConfig }): boolean { return EnvironmentLifecycle.needsLocalPostgreSQL(env); }\n /** @see EnvironmentLifecycle.needsLocalMongoDB — the union rule (mirror of needsLocalPostgreSQL). */\n static needsLocalMongoDB(env: { name: string; backingServices?: BackingServicesEnvConfig }): boolean { return EnvironmentLifecycle.needsLocalMongoDB(env); }\n /** @see EnvironmentLifecycle.selfHostsBackingService — the TOTAL per-kind self-deploy rule both lanes gate on. */\n static selfHostsBackingService(env: { name: string; backingServices?: BackingServicesEnvConfig }, kind: BackingServiceKind): boolean { return EnvironmentLifecycle.selfHostsBackingService(env, kind); }\n /** @see EnvironmentLifecycle.servesBackingServiceOffCluster — a USED kind served from outside the deployment (#3511). */\n static servesBackingServiceOffCluster(env: { name: string; backingServices?: BackingServicesEnvConfig }, kind: BackingServiceKind): boolean { return EnvironmentLifecycle.servesBackingServiceOffCluster(env, kind); }\n static getRequiredInfraServices(envName?: string): PlatformDataServices[] { return EnvironmentLifecycle.getRequiredInfraServices(envName); }\n static getRequiredPlatformServices(): PlatformWildoServices[] { return EnvironmentLifecycle.getRequiredPlatformServices(); }\n static getRuntime(envName?: string): WildoDeploymentRuntime { return EnvironmentLifecycle.getRuntime(envName); }\n static detectOS(): PlatformEnvOperatingSystem { return EnvironmentLifecycle.detectOS(); }\n\n // --- Paths delegates ------------------------------------------------------\n\n static getSecretsPath(envName?: string): string { return EnvironmentPaths.getSecretsPath(envName); }\n static getConfigPath(envName?: string): string { return EnvironmentPaths.getConfigPath(envName); }\n static getInfraPath(envName?: string): string { return EnvironmentPaths.getInfraPath(envName); }\n static setPaths(paths: { secretsPath?: string; configPath?: string; infraPath?: string }, envName?: string): void { EnvironmentPaths.setPaths(paths, envName); }\n static resolveSecretsDir(envName?: string): string { return EnvironmentPaths.resolveSecretsDir(envName); }\n static resolveConfigDir(envName?: string): string { return EnvironmentPaths.resolveConfigDir(envName); }\n static resolveInfraDir(envName?: string): string { return EnvironmentPaths.resolveInfraDir(envName); }\n static resolveDockerComposeDir(envName?: string): string { return EnvironmentPaths.resolveDockerComposeDir(envName); }\n static detectSiblingSecretsRepo(frameworkPath: string): string | null { return EnvironmentPaths.detectSiblingSecretsRepo(frameworkPath); }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"environment.service.js","sourceRoot":"","sources":["../../../../src/services/environment/environment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AAErG,MAAM,OAAO,gBAAgB;IAE3B,6EAA6E;IAE7E,MAAM,CAAC,IAAI,KAAgC,OAAO,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/E,MAAM,CAAC,KAAK,KAAW,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,KAAuD,OAAO,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1G,MAAM,CAAC,GAAG,CAAC,IAAY,IAAkD,OAAO,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,CAAC,UAAU,KAAmD,OAAO,mBAAmB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9G,MAAM,CAAC,cAAc,KAAa,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,IAAY,IAAU,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3E,MAAM,CAAC,SAAS,KAAe,OAAO,mBAAmB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,OAA+F,IAAU,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACjL,MAAM,CAAC,MAAM,C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K,MAAM,CAAC,iBAAiB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1G,MAAM,CAAC,gBAAgB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxG,MAAM,CAAC,eAAe,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,CAAC,uBAAuB,CAAC,OAAgB,IAAY,OAAO,gBAAgB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtH,MAAM,CAAC,wBAAwB,CAAC,aAAqB,IAAmB,OAAO,gBAAgB,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC3I","sourcesContent":["/**\n * EnvironmentUtils — backward-compatible facade.\n *\n * Delegates to the three focused sub-services:\n * - EnvironmentRegistry (state persistence, CRUD, config/secrets loading)\n * - EnvironmentPaths (path resolution)\n * - EnvironmentLifecycle (initialization, setup status, database, infra)\n *\n * Existing callers continue importing { EnvironmentUtils } from this file.\n * New code should import directly from the sub-service it needs.\n */\n\nimport type {\n PlatformEnvironmentConfiguration,\n PlatformEnvironmentsState,\n PlatformEnvOperatingSystem,\n} from '~wildo-cli/services/environment/environment.schemas';\nimport type { BackingServiceKind, BackingServicesEnvConfig, EnvironmentServiceProfile, PlatformWildoServices, WildoDeploymentRuntime, WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { SetupStatus } from '~wildo-cli/services/environment/environment.schemas';\nimport type {\n PlatformDatabaseChoice,\n PlatformDataServices,\n} from '~wildo-cli/services/data-services/data-services.schemas';\nimport type {\n ApplicationRuntimeIdentityJson,\n PlatformEnvConfigJson,\n PlatformEnvSecretsJson,\n} from '~wildo-cli/services/credentials/credentials.schemas';\n\nimport { EnvironmentRegistry } from '~wildo-cli/services/environment/environment-registry.service';\nimport { EnvironmentPaths } from '~wildo-cli/services/environment/environment-paths.service';\nimport { EnvironmentLifecycle } from '~wildo-cli/services/environment/environment-lifecycle.service';\n\nexport class EnvironmentUtils {\n\n // --- Registry delegates ---------------------------------------------------\n\n static load(): PlatformEnvironmentsState { return EnvironmentRegistry.load(); }\n static reset(): void { EnvironmentRegistry.reset(); }\n static getAll(): Record<string, PlatformEnvironmentConfiguration> { return EnvironmentRegistry.getAll(); }\n static get(name: string): PlatformEnvironmentConfiguration | undefined { return EnvironmentRegistry.get(name); }\n static getCurrent(): PlatformEnvironmentConfiguration | undefined { return EnvironmentRegistry.getCurrent(); }\n static getCurrentName(): string { return EnvironmentRegistry.getCurrentName(); }\n static switchTo(name: string): void { EnvironmentRegistry.switchTo(name); }\n static listNames(): string[] { return EnvironmentRegistry.listNames(); }\n static update(name: string, updates: Partial<Omit<PlatformEnvironmentConfiguration, 'name' | 'locationType' | 'createdAt'>>): void { EnvironmentRegistry.update(name, updates); }\n static remove(name: string): void { EnvironmentRegistry.remove(name); }\n static loadConfigJson(envName?: string): PlatformEnvConfigJson | null { return EnvironmentRegistry.loadConfigJson(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static loadSecretsJson(envName?: string): PlatformEnvSecretsJson | null { return EnvironmentRegistry.loadSecretsJson(envName, EnvironmentPaths.resolveSecretsDir(envName)); }\n static loadApplicationRuntimeIdentity(envName?: string): ApplicationRuntimeIdentityJson | null { return EnvironmentRegistry.loadApplicationRuntimeIdentity(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static saveApplicationRuntimeIdentity(envName: string, appSlug: string, applicationId: string): void { EnvironmentRegistry.saveApplicationRuntimeIdentity(envName, appSlug, applicationId, EnvironmentPaths.resolveConfigDir(envName)); }\n static clearApplicationRuntimeIdentities(envName: string): void { EnvironmentRegistry.clearApplicationRuntimeIdentities(envName, EnvironmentPaths.resolveConfigDir(envName)); }\n static invalidateCache(): void { EnvironmentRegistry.invalidateCache(); }\n\n // --- Lifecycle delegates --------------------------------------------------\n\n static initializeLocal(overrides?: Partial<PlatformEnvironmentConfiguration>): PlatformEnvironmentConfiguration { return EnvironmentLifecycle.initializeLocal(overrides); }\n static initializeEnvironment(name: string, locationType: WildoLocationType, overrides?: Partial<PlatformEnvironmentConfiguration>): PlatformEnvironmentConfiguration { return EnvironmentLifecycle.initializeEnvironment(name, locationType, overrides); }\n static updateEnvironmentState(env: PlatformEnvironmentConfiguration): void { EnvironmentLifecycle.updateEnvironmentState(env); }\n static getSetupStatus(envName?: string): SetupStatus { return EnvironmentLifecycle.getSetupStatus(envName); }\n static setSetupStatus(status: SetupStatus, envName?: string): void { EnvironmentLifecycle.setSetupStatus(status, envName); }\n static isSetupCompleted(envName?: string): boolean { return EnvironmentLifecycle.isSetupCompleted(envName); }\n static isPlatformInitialized(envName?: string): boolean { return EnvironmentLifecycle.isPlatformInitialized(envName); }\n static markPlatformInitialized(envName?: string): void { return EnvironmentLifecycle.markPlatformInitialized(envName); }\n static clearPlatformInitialized(envName?: string): void { return EnvironmentLifecycle.clearPlatformInitialized(envName); }\n static getDatabaseChoice(envName?: string): PlatformDatabaseChoice { return EnvironmentLifecycle.getDatabaseChoice(envName); }\n static getDatabaseEngine(envName?: string): import('@wildo-ai/platform-config-lib').DatabaseEngine { return EnvironmentLifecycle.getDatabaseEngine(envName); }\n static setDatabaseChoice(database: PlatformDatabaseChoice, envName?: string): void { EnvironmentLifecycle.setDatabaseChoice(database, envName); }\n /** @see EnvironmentLifecycle.needsLocalPostgreSQL — the union rule; NOT `getDatabaseEngine() === POSTGRESQL`. */\n static needsLocalPostgreSQL(env: { name: string; backingServices?: BackingServicesEnvConfig }): boolean { return EnvironmentLifecycle.needsLocalPostgreSQL(env); }\n /** @see EnvironmentLifecycle.needsLocalMongoDB — the union rule (mirror of needsLocalPostgreSQL). */\n static needsLocalMongoDB(env: { name: string; backingServices?: BackingServicesEnvConfig }): boolean { return EnvironmentLifecycle.needsLocalMongoDB(env); }\n /** @see EnvironmentLifecycle.selfHostsBackingService — the TOTAL per-kind self-deploy rule both lanes gate on. */\n static selfHostsBackingService(env: { name: string; backingServices?: BackingServicesEnvConfig; serviceProfile?: EnvironmentServiceProfile }, kind: BackingServiceKind): boolean { return EnvironmentLifecycle.selfHostsBackingService(env, kind); }\n /** @see EnvironmentLifecycle.servesBackingServiceOffCluster — a USED kind served from outside the deployment (#3511). */\n static servesBackingServiceOffCluster(env: { name: string; backingServices?: BackingServicesEnvConfig; serviceProfile?: EnvironmentServiceProfile }, kind: BackingServiceKind): boolean { return EnvironmentLifecycle.servesBackingServiceOffCluster(env, kind); }\n static getRequiredPlatformServices(): PlatformWildoServices[] { return EnvironmentLifecycle.getRequiredPlatformServices(); }\n static getRuntime(envName?: string): WildoDeploymentRuntime { return EnvironmentLifecycle.getRuntime(envName); }\n static detectOS(): PlatformEnvOperatingSystem { return EnvironmentLifecycle.detectOS(); }\n\n // --- Paths delegates ------------------------------------------------------\n\n static getSecretsPath(envName?: string): string { return EnvironmentPaths.getSecretsPath(envName); }\n static getConfigPath(envName?: string): string { return EnvironmentPaths.getConfigPath(envName); }\n static getInfraPath(envName?: string): string { return EnvironmentPaths.getInfraPath(envName); }\n static setPaths(paths: { secretsPath?: string; configPath?: string; infraPath?: string }, envName?: string): void { EnvironmentPaths.setPaths(paths, envName); }\n static resolveSecretsDir(envName?: string): string { return EnvironmentPaths.resolveSecretsDir(envName); }\n static resolveConfigDir(envName?: string): string { return EnvironmentPaths.resolveConfigDir(envName); }\n static resolveInfraDir(envName?: string): string { return EnvironmentPaths.resolveInfraDir(envName); }\n static resolveDockerComposeDir(envName?: string): string { return EnvironmentPaths.resolveDockerComposeDir(envName); }\n static detectSiblingSecretsRepo(frameworkPath: string): string | null { return EnvironmentPaths.detectSiblingSecretsRepo(frameworkPath); }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawnSync } from 'child_process';
|
|
1
|
+
import { spawn, spawnSync } from 'child_process';
|
|
2
2
|
/** OCI annotation keys (image-spec `annotations.md`, dead-plan-citation: the OCI spec's own file), used here as build labels. */
|
|
3
3
|
export declare const FRAMEWORK_IMAGE_REVISION_LABEL = "org.opencontainers.image.revision";
|
|
4
4
|
export declare const FRAMEWORK_IMAGE_CREATED_LABEL = "org.opencontainers.image.created";
|
|
@@ -147,22 +147,52 @@ export interface FrameworkDockerPublishResult {
|
|
|
147
147
|
*/
|
|
148
148
|
export declare const FRAMEWORK_DOCKER_IMAGE_PLATFORMS: readonly ["linux/amd64", "linux/arm64"];
|
|
149
149
|
/**
|
|
150
|
-
* How long one image build may run, and how many times it is tried (#3063).
|
|
150
|
+
* How long one image build may run, and how many times it is tried (#3063, #3963).
|
|
151
151
|
*
|
|
152
152
|
* The arm64 half is built under QEMU, and QEMU can crash the emulated Node process (`qemu: uncaught target
|
|
153
153
|
* signal 4 (Illegal instruction)`) with nothing in the build noticing: the 1.1.13 release (framework-release
|
|
154
154
|
* run 43566115901, 2026-11-14) crashed 103 s into the arm64 `pnpm install`, printed nothing for two hours and
|
|
155
|
-
* was cancelled by GitHub's three-hour job limit, with the version tagged and nothing published. The
|
|
156
|
-
*
|
|
157
|
-
*
|
|
155
|
+
* was cancelled by GitHub's three-hour job limit, with the version tagged and nothing published. The crash is
|
|
156
|
+
* intermittent (same base image digest, same QEMU), and FREQUENT: the 1.1.14 release (run 43853716196,
|
|
157
|
+
* 2026-11-16) crashed on both of its two attempts, so 3 of the 4 arm64 attempts then recorded crashed.
|
|
158
158
|
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
159
|
+
* So an attempt ends the moment QEMU reports the crash (`QEMU_CRASH_PATTERN`) and is tried again, which costs
|
|
160
|
+
* about two minutes rather than the whole bound. The bound stays for a build that hangs WITHOUT that line, and
|
|
161
|
+
* at most `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS` attempts may run it out: the worst case is the two silent
|
|
162
|
+
* 50-minute attempts the lane already allowed, which fit inside the release job's limit with the rest of the
|
|
163
|
+
* lane. A whole build (both platforms, attestations, push) took 8 min 14 s for 1.1.12.
|
|
164
|
+
*
|
|
165
|
+
* A retry cannot release half an image: `buildx build --push` writes the tag only after every platform has
|
|
166
|
+
* built, and the tag is the release's own, which nothing names until the npm step that follows.
|
|
163
167
|
*/
|
|
164
168
|
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS: number;
|
|
165
|
-
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS =
|
|
169
|
+
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS = 4;
|
|
170
|
+
export declare const FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS = 2;
|
|
171
|
+
/**
|
|
172
|
+
* What QEMU prints when an emulated process dies of a signal nothing handled. A process that probes a CPU
|
|
173
|
+
* feature by catching SIGILL (OpenSSL does) never produces it, because the signal is caught; this line means
|
|
174
|
+
* an emulated process is DEAD, and in every recorded instance the build then hung without another word. It
|
|
175
|
+
* appears in none of the successful release logs read (#3963), so ending the attempt on it cannot end a build
|
|
176
|
+
* that would have finished.
|
|
177
|
+
*/
|
|
178
|
+
export declare const QEMU_CRASH_PATTERN: RegExp;
|
|
179
|
+
/**
|
|
180
|
+
* How one image build attempt ended (#3963). Only `SUCCEEDED` ends the build; `TIMED_OUT` counts against
|
|
181
|
+
* `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS`; `SPAWN_FAILED` (docker itself could not start) is not retried, since
|
|
182
|
+
* a second start would fail the same way; the rest are tried again.
|
|
183
|
+
*/
|
|
184
|
+
export declare enum DockerBuildAttemptOutcome {
|
|
185
|
+
/** buildx exited 0: every platform built and the index was pushed. */
|
|
186
|
+
SUCCEEDED = "succeeded",
|
|
187
|
+
/** The attempt ran out of `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and was ended. */
|
|
188
|
+
TIMED_OUT = "timed-out",
|
|
189
|
+
/** QEMU printed `QEMU_CRASH_PATTERN`, and the attempt was ended without waiting for the bound. */
|
|
190
|
+
EMULATOR_CRASHED = "emulator-crashed",
|
|
191
|
+
/** The `docker` process could not be started at all. */
|
|
192
|
+
SPAWN_FAILED = "spawn-failed",
|
|
193
|
+
/** buildx exited non-zero, or was ended by a signal this lane did not send. */
|
|
194
|
+
FAILED = "failed"
|
|
195
|
+
}
|
|
166
196
|
export declare class FrameworkDockerPublishService {
|
|
167
197
|
static publishImages(options?: FrameworkDockerPublishOptions): Promise<FrameworkDockerPublishResult>;
|
|
168
198
|
/** The image index digest buildx recorded in its metadata file, or undefined when it recorded none. */
|
|
@@ -230,12 +260,22 @@ export declare class FrameworkDockerPublishService {
|
|
|
230
260
|
*/
|
|
231
261
|
private static runDockerLogin;
|
|
232
262
|
/**
|
|
233
|
-
* Run one image build, bounded by `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and tried
|
|
234
|
-
* `FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS` times
|
|
235
|
-
*
|
|
236
|
-
*
|
|
263
|
+
* Run one image build, bounded by `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and tried up to
|
|
264
|
+
* `FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS` times (#3063, #3963).
|
|
265
|
+
*
|
|
266
|
+
* The output is streamed through, unchanged, and watched: the moment QEMU reports a crashed emulated process
|
|
267
|
+
* (`QEMU_CRASH_PATTERN`) the attempt is ended and tried again, instead of waiting out the bound in silence. A
|
|
268
|
+
* build that runs out of time is ended the same way; at most `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS` attempts
|
|
269
|
+
* may, so the worst case stays two full bounds. Ending an attempt sends SIGTERM to the buildx client, and
|
|
270
|
+
* BuildKit cancels the build when its session closes. Every failure says which attempt it was and why.
|
|
271
|
+
*/
|
|
272
|
+
static runDockerBuild(label: string, args: string[], spawnProcess?: typeof spawn, log?: (message: string) => void, timeoutMs?: number): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* One build attempt: docker's output goes to this process's own stdout/stderr as it arrives (a release log
|
|
275
|
+
* reads exactly as before), and each line is checked against `QEMU_CRASH_PATTERN`. Lines are reassembled
|
|
276
|
+
* across chunks so a crash line split by the pipe is still seen.
|
|
237
277
|
*/
|
|
238
|
-
static
|
|
278
|
+
private static runOneDockerBuild;
|
|
239
279
|
private static runDockerCommand;
|
|
240
280
|
}
|
|
241
281
|
//# sourceMappingURL=framework-docker-publish.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"framework-docker-publish.service.d.ts","sourceRoot":"","sources":["../../../../src/services/framework/framework-docker-publish.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAkBjD,iIAAiI;AACjI,eAAO,MAAM,8BAA8B,sCAAsC,CAAC;AAClF,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAChF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qCAAqC,CAAC;AAChF,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,oCAAoC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,mDAAoD,CAAC;AAElG;;;;GAIG;AACH,oBAAY,qBAAqB;IAC/B;;;;;;;;;OASG;IACH,cAAc,mBAAmB;CAClC;AAED,wHAAwH;AACxH,eAAO,MAAM,2BAA2B,kCAAkC,CAAC;AAE3E,6HAA6H;AAC7H,eAAO,MAAM,0BAA0B,gDAAgD,CAAC;AAExF;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAGxG;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AajD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAmBlC;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAWtF,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAkBlC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAOhC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAe7B;;;;;;;;;OASG;WACU,cAAc,CACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EAAE,EACd,YAAY,GAAE,OAAO,KAAa,EAClC,GAAG,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAA0C,EACpE,SAAS,GAAE,MAAgD,GAC1D,OAAO,CAAC,IAAI,CAAC;IA0BhB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgDhC,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAShC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawnSync } from 'child_process';
|
|
1
|
+
import { spawn, spawnSync } from 'child_process';
|
|
2
2
|
import { existsSync, mkdtempSync, readFileSync, rmSync } from 'fs';
|
|
3
3
|
import { tmpdir } from 'os';
|
|
4
4
|
import { join, relative } from 'path';
|
|
@@ -161,22 +161,53 @@ const FRAMEWORK_DOCKER_IMAGE_BUILD_DEFINITIONS = {
|
|
|
161
161
|
*/
|
|
162
162
|
export const FRAMEWORK_DOCKER_IMAGE_PLATFORMS = ['linux/amd64', 'linux/arm64'];
|
|
163
163
|
/**
|
|
164
|
-
* How long one image build may run, and how many times it is tried (#3063).
|
|
164
|
+
* How long one image build may run, and how many times it is tried (#3063, #3963).
|
|
165
165
|
*
|
|
166
166
|
* The arm64 half is built under QEMU, and QEMU can crash the emulated Node process (`qemu: uncaught target
|
|
167
167
|
* signal 4 (Illegal instruction)`) with nothing in the build noticing: the 1.1.13 release (framework-release
|
|
168
168
|
* run 43566115901, 2026-11-14) crashed 103 s into the arm64 `pnpm install`, printed nothing for two hours and
|
|
169
|
-
* was cancelled by GitHub's three-hour job limit, with the version tagged and nothing published. The
|
|
170
|
-
*
|
|
171
|
-
*
|
|
169
|
+
* was cancelled by GitHub's three-hour job limit, with the version tagged and nothing published. The crash is
|
|
170
|
+
* intermittent (same base image digest, same QEMU), and FREQUENT: the 1.1.14 release (run 43853716196,
|
|
171
|
+
* 2026-11-16) crashed on both of its two attempts, so 3 of the 4 arm64 attempts then recorded crashed.
|
|
172
172
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
173
|
+
* So an attempt ends the moment QEMU reports the crash (`QEMU_CRASH_PATTERN`) and is tried again, which costs
|
|
174
|
+
* about two minutes rather than the whole bound. The bound stays for a build that hangs WITHOUT that line, and
|
|
175
|
+
* at most `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS` attempts may run it out: the worst case is the two silent
|
|
176
|
+
* 50-minute attempts the lane already allowed, which fit inside the release job's limit with the rest of the
|
|
177
|
+
* lane. A whole build (both platforms, attestations, push) took 8 min 14 s for 1.1.12.
|
|
178
|
+
*
|
|
179
|
+
* A retry cannot release half an image: `buildx build --push` writes the tag only after every platform has
|
|
180
|
+
* built, and the tag is the release's own, which nothing names until the npm step that follows.
|
|
177
181
|
*/
|
|
178
182
|
export const FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS = 50 * 60_000;
|
|
179
|
-
export const FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS =
|
|
183
|
+
export const FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS = 4;
|
|
184
|
+
export const FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS = 2;
|
|
185
|
+
/**
|
|
186
|
+
* What QEMU prints when an emulated process dies of a signal nothing handled. A process that probes a CPU
|
|
187
|
+
* feature by catching SIGILL (OpenSSL does) never produces it, because the signal is caught; this line means
|
|
188
|
+
* an emulated process is DEAD, and in every recorded instance the build then hung without another word. It
|
|
189
|
+
* appears in none of the successful release logs read (#3963), so ending the attempt on it cannot end a build
|
|
190
|
+
* that would have finished.
|
|
191
|
+
*/
|
|
192
|
+
export const QEMU_CRASH_PATTERN = /qemu: uncaught target signal \d+/;
|
|
193
|
+
/**
|
|
194
|
+
* How one image build attempt ended (#3963). Only `SUCCEEDED` ends the build; `TIMED_OUT` counts against
|
|
195
|
+
* `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS`; `SPAWN_FAILED` (docker itself could not start) is not retried, since
|
|
196
|
+
* a second start would fail the same way; the rest are tried again.
|
|
197
|
+
*/
|
|
198
|
+
export var DockerBuildAttemptOutcome;
|
|
199
|
+
(function (DockerBuildAttemptOutcome) {
|
|
200
|
+
/** buildx exited 0: every platform built and the index was pushed. */
|
|
201
|
+
DockerBuildAttemptOutcome["SUCCEEDED"] = "succeeded";
|
|
202
|
+
/** The attempt ran out of `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and was ended. */
|
|
203
|
+
DockerBuildAttemptOutcome["TIMED_OUT"] = "timed-out";
|
|
204
|
+
/** QEMU printed `QEMU_CRASH_PATTERN`, and the attempt was ended without waiting for the bound. */
|
|
205
|
+
DockerBuildAttemptOutcome["EMULATOR_CRASHED"] = "emulator-crashed";
|
|
206
|
+
/** The `docker` process could not be started at all. */
|
|
207
|
+
DockerBuildAttemptOutcome["SPAWN_FAILED"] = "spawn-failed";
|
|
208
|
+
/** buildx exited non-zero, or was ended by a signal this lane did not send. */
|
|
209
|
+
DockerBuildAttemptOutcome["FAILED"] = "failed";
|
|
210
|
+
})(DockerBuildAttemptOutcome || (DockerBuildAttemptOutcome = {}));
|
|
180
211
|
export class FrameworkDockerPublishService {
|
|
181
212
|
static async publishImages(options = {}) {
|
|
182
213
|
const resolvedFrameworkRoot = options.frameworkRoot ?? FrameworkReleaseService.getFrameworkRoot();
|
|
@@ -250,7 +281,7 @@ export class FrameworkDockerPublishService {
|
|
|
250
281
|
const metadataDir = mkdtempSync(join(tmpdir(), 'wildo-image-metadata-'));
|
|
251
282
|
const metadataFile = join(metadataDir, 'metadata.json');
|
|
252
283
|
try {
|
|
253
|
-
FrameworkDockerPublishService.runDockerBuild('buildx build --push', [
|
|
284
|
+
await FrameworkDockerPublishService.runDockerBuild('buildx build --push', [
|
|
254
285
|
'buildx',
|
|
255
286
|
'build',
|
|
256
287
|
'--platform',
|
|
@@ -481,29 +512,88 @@ export class FrameworkDockerPublishService {
|
|
|
481
512
|
}
|
|
482
513
|
}
|
|
483
514
|
/**
|
|
484
|
-
* Run one image build, bounded by `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and tried
|
|
485
|
-
* `FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS` times
|
|
486
|
-
*
|
|
487
|
-
*
|
|
515
|
+
* Run one image build, bounded by `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS` and tried up to
|
|
516
|
+
* `FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS` times (#3063, #3963).
|
|
517
|
+
*
|
|
518
|
+
* The output is streamed through, unchanged, and watched: the moment QEMU reports a crashed emulated process
|
|
519
|
+
* (`QEMU_CRASH_PATTERN`) the attempt is ended and tried again, instead of waiting out the bound in silence. A
|
|
520
|
+
* build that runs out of time is ended the same way; at most `FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS` attempts
|
|
521
|
+
* may, so the worst case stays two full bounds. Ending an attempt sends SIGTERM to the buildx client, and
|
|
522
|
+
* BuildKit cancels the build when its session closes. Every failure says which attempt it was and why.
|
|
488
523
|
*/
|
|
489
|
-
static runDockerBuild(label, args,
|
|
524
|
+
static async runDockerBuild(label, args, spawnProcess = spawn, log = (message) => console.error(message), timeoutMs = FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS) {
|
|
490
525
|
const minutes = Math.round(FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUT_MS / 60_000);
|
|
526
|
+
let timeouts = 0;
|
|
491
527
|
for (let attempt = 1; attempt <= FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS; attempt += 1) {
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
528
|
+
const outcome = await FrameworkDockerPublishService.runOneDockerBuild(args, spawnProcess, timeoutMs);
|
|
529
|
+
if (outcome.kind === DockerBuildAttemptOutcome.SUCCEEDED)
|
|
494
530
|
return;
|
|
495
|
-
|
|
496
|
-
|
|
531
|
+
if (outcome.kind === DockerBuildAttemptOutcome.TIMED_OUT)
|
|
532
|
+
timeouts += 1;
|
|
533
|
+
const reason = outcome.kind === DockerBuildAttemptOutcome.TIMED_OUT
|
|
497
534
|
? `it ran out of its ${minutes} minutes (an emulated platform can hang without a word)`
|
|
498
|
-
:
|
|
499
|
-
? `
|
|
500
|
-
:
|
|
501
|
-
|
|
535
|
+
: outcome.kind === DockerBuildAttemptOutcome.EMULATOR_CRASHED
|
|
536
|
+
? `QEMU crashed an emulated process ("${outcome.line}"), after which the build never finishes`
|
|
537
|
+
: outcome.kind === DockerBuildAttemptOutcome.SPAWN_FAILED
|
|
538
|
+
? `docker could not be started (${outcome.message})`
|
|
539
|
+
: outcome.signal
|
|
540
|
+
? `it was ended by ${outcome.signal}`
|
|
541
|
+
: `it exited ${outcome.status ?? 'without a status'}`;
|
|
542
|
+
const last = attempt === FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS ||
|
|
543
|
+
timeouts >= FRAMEWORK_DOCKER_IMAGE_BUILD_TIMEOUTS ||
|
|
544
|
+
outcome.kind === DockerBuildAttemptOutcome.SPAWN_FAILED;
|
|
502
545
|
log(`Docker ${label}, attempt ${attempt} of ${FRAMEWORK_DOCKER_IMAGE_BUILD_ATTEMPTS}: ${reason}.${last ? '' : ' Trying again.'}`);
|
|
503
546
|
if (last)
|
|
504
|
-
throw new Error(`Docker ${label} failed after ${
|
|
547
|
+
throw new Error(`Docker ${label} failed after ${attempt} attempt${attempt === 1 ? '' : 's'}: ${reason}.`);
|
|
505
548
|
}
|
|
506
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* One build attempt: docker's output goes to this process's own stdout/stderr as it arrives (a release log
|
|
552
|
+
* reads exactly as before), and each line is checked against `QEMU_CRASH_PATTERN`. Lines are reassembled
|
|
553
|
+
* across chunks so a crash line split by the pipe is still seen.
|
|
554
|
+
*/
|
|
555
|
+
static runOneDockerBuild(args, spawnProcess, timeoutMs) {
|
|
556
|
+
return new Promise((resolve) => {
|
|
557
|
+
const child = spawnProcess('docker', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
558
|
+
let ended;
|
|
559
|
+
const end = (reason) => {
|
|
560
|
+
if (ended)
|
|
561
|
+
return;
|
|
562
|
+
ended = reason;
|
|
563
|
+
child.kill('SIGTERM');
|
|
564
|
+
};
|
|
565
|
+
const timer = setTimeout(() => end({ kind: DockerBuildAttemptOutcome.TIMED_OUT }), timeoutMs);
|
|
566
|
+
const watch = (stream, sink) => {
|
|
567
|
+
let pending = '';
|
|
568
|
+
stream?.on('data', (chunk) => {
|
|
569
|
+
const text = chunk.toString();
|
|
570
|
+
sink.write(text);
|
|
571
|
+
const lines = (pending + text).split('\n');
|
|
572
|
+
pending = lines.pop() ?? '';
|
|
573
|
+
for (const line of lines) {
|
|
574
|
+
const crash = QEMU_CRASH_PATTERN.exec(line);
|
|
575
|
+
if (crash)
|
|
576
|
+
end({ kind: DockerBuildAttemptOutcome.EMULATOR_CRASHED, line: line.slice(crash.index).trim() });
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
watch(child.stdout, process.stdout);
|
|
581
|
+
watch(child.stderr, process.stderr);
|
|
582
|
+
child.on('error', (error) => {
|
|
583
|
+
clearTimeout(timer);
|
|
584
|
+
resolve({ kind: DockerBuildAttemptOutcome.SPAWN_FAILED, message: error.message });
|
|
585
|
+
});
|
|
586
|
+
child.on('close', (status, signal) => {
|
|
587
|
+
clearTimeout(timer);
|
|
588
|
+
if (ended)
|
|
589
|
+
resolve(ended);
|
|
590
|
+
else if (status === 0)
|
|
591
|
+
resolve({ kind: DockerBuildAttemptOutcome.SUCCEEDED });
|
|
592
|
+
else
|
|
593
|
+
resolve({ kind: DockerBuildAttemptOutcome.FAILED, status, signal });
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
}
|
|
507
597
|
static runDockerCommand(label, args) {
|
|
508
598
|
const result = spawnSync('docker', args, {
|
|
509
599
|
encoding: 'utf8',
|