@fjall/deploy-core 20.0.0 → 21.0.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/.build-source-hash +7 -7
- package/dist/.minified +1 -1
- package/dist/src/orchestration/application/ecrCacheRepository.js +1 -1
- package/dist/src/orchestration/application/ecsDeploymentTail.js +3 -3
- package/dist/src/orchestration/application/schemaGateImage.js +1 -1
- package/dist/src/util/sleepAbortable.d.ts +1 -8
- package/dist/src/util/sleepAbortable.js +1 -1
- package/package.json +4 -4
package/dist/.build-source-hash
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"package.json",
|
|
10
10
|
"tsconfig.json"
|
|
11
11
|
],
|
|
12
|
-
"hash": "
|
|
12
|
+
"hash": "623b78ba79d83f6ebcae4b84de5070792c13fb7d4d7c6cdc07f41e9f44d64d4d",
|
|
13
13
|
"files": {
|
|
14
14
|
"src/__test-utils__/awsMockHelpers.ts": "fea371c1b1869678",
|
|
15
15
|
"src/__test-utils__/index.ts": "e03cf35821157dc4",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"src/orchestration/application/detectionPipeline.ts": "69b7dfcedf22fe01",
|
|
73
73
|
"src/orchestration/application/directDestroy.ts": "4fac968ba765cd76",
|
|
74
74
|
"src/orchestration/application/dockerBuildHelper.ts": "e7a7259e987d93be",
|
|
75
|
-
"src/orchestration/application/ecrCacheRepository.ts": "
|
|
76
|
-
"src/orchestration/application/ecsDeploymentTail.ts": "
|
|
75
|
+
"src/orchestration/application/ecrCacheRepository.ts": "bf396177c8c66e4a",
|
|
76
|
+
"src/orchestration/application/ecsDeploymentTail.ts": "51974290626f5d47",
|
|
77
77
|
"src/orchestration/application/engineCompat.ts": "d3e1cbf906bc785d",
|
|
78
78
|
"src/orchestration/application/lambdaCodeOnlyRollout.ts": "fc347b90ff55c1fd",
|
|
79
79
|
"src/orchestration/application/leaseGate.ts": "26be2e119b32bef4",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"src/orchestration/application/plan/renameDetection.ts": "7242d45be616625f",
|
|
93
93
|
"src/orchestration/application/plan/renderDeployPlan.ts": "d2d77c37aa7b4ed6",
|
|
94
94
|
"src/orchestration/application/plan/types.ts": "191929198672081c",
|
|
95
|
-
"src/orchestration/application/schemaGateImage.ts": "
|
|
95
|
+
"src/orchestration/application/schemaGateImage.ts": "0146ae1ce875a9b6",
|
|
96
96
|
"src/orchestration/application/serviceImageTagsRollback.ts": "55e23a493545511c",
|
|
97
97
|
"src/orchestration/application/taskDefinitionRoll.ts": "d9378c509c7ec287",
|
|
98
98
|
"src/orchestration/application/welcomeImageHelper.ts": "1721ea7edc37a96e",
|
|
@@ -269,12 +269,12 @@
|
|
|
269
269
|
"src/util/dockerfileDetection.ts": "c407ab8208fb65ec",
|
|
270
270
|
"src/util/index.ts": "6fcf776825c4518e",
|
|
271
271
|
"src/util/sequencedCallbacks.ts": "e0eb541cff459083",
|
|
272
|
-
"src/util/sleepAbortable.ts": "
|
|
272
|
+
"src/util/sleepAbortable.ts": "ee2facc7b89ab9f5",
|
|
273
273
|
"src/version.ts": "1811a4475823b27e",
|
|
274
274
|
"../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
|
|
275
|
-
"package.json": "
|
|
275
|
+
"package.json": "5c18b2116f2213eb",
|
|
276
276
|
"tsconfig.json": "1929cf3f99fe9b1e"
|
|
277
277
|
},
|
|
278
|
-
"outputHash": "
|
|
278
|
+
"outputHash": "bfe4f6996414bbbd7e15a07e23aaa67569487e9295fb0ef5dac3afdc6acd1715",
|
|
279
279
|
"outputFileCount": 513
|
|
280
280
|
}
|
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
256 files minified at 2026-08-
|
|
1
|
+
256 files minified at 2026-08-26T08:33:04.444Z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var n=(t,r)=>u(t,"name",{value:r,configurable:!0});import{ECRClient as m,CreateRepositoryCommand as y,PutLifecyclePolicyCommand as d}from"@aws-sdk/client-ecr";import{success as
|
|
1
|
+
var u=Object.defineProperty;var n=(t,r)=>u(t,"name",{value:r,configurable:!0});import{ECRClient as m,CreateRepositoryCommand as y,PutLifecyclePolicyCommand as d}from"@aws-sdk/client-ecr";import{success as g,failure as a}from"@fjall/generator";import{getErrorMessage as c,maskSensitiveOutput as s}from"@fjall/util";import{ecrCreateRepositoryTags as p}from"@fjall/util/aws";import{untaggedLifecyclePolicyText as f,CACHE_REPO_UNTAGGED_RETENTION_DAYS as C}from"@fjall/util/docker";import{logger as E}from"@fjall/util/logger";import{composeSdkAbortSignal as l,extractErrorName as T}from"../../aws/organisations/types.js";const b="EcrCacheRepository";async function L(t,r,o){const i=t.getClient(m);try{await i.send(new y({repositoryName:r,imageScanningConfiguration:{scanOnPush:!0},imageTagMutability:"MUTABLE",tags:p(r)}),{abortSignal:l(o)}),E.debug(b,"Created build-cache repository",{cacheRepositoryName:r})}catch(e){if(T(e)!=="RepositoryAlreadyExistsException")return a(new Error(`Could not create build-cache repository '${r}': ${s(c(e))}`))}try{await i.send(new d({repositoryName:r,lifecyclePolicyText:f(C)}),{abortSignal:l(o)})}catch(e){return a(new Error(`Could not set lifecycle policy on build-cache repository '${r}': ${s(c(e))}`))}return g(void 0)}n(L,"ensureBuildCacheRepository");export{L as ensureBuildCacheRepository};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var B=Object.defineProperty;var
|
|
2
|
-
`);function
|
|
3
|
-
`))}},async finalise(e){if(
|
|
1
|
+
var B=Object.defineProperty;var c=(o,i)=>B(o,"name",{value:i,configurable:!0});import{logger as f}from"@fjall/util/logger";import{getErrorMessage as I,maskSensitiveOutput as p}from"@fjall/util";import{SCHEMA_GATE_CONTAINER_NAME as U,SCHEMA_GATE_EXIT_HINTS as K,schemaGateExitKind as z}from"@fjall/util/migration";import{isAborted as w}from"../../aws/organisations/types.js";import{sleepAbortable as G}from"../../util/sleepAbortable.js";const m="EcsDeploymentTail",Y="AWS::ECS::Service",j="AWS::CloudFormation::Stack",W=new Set(["CREATE_IN_PROGRESS","UPDATE_IN_PROGRESS"]),H=15e3,V=3e4,X=["CloudFormation entered UPDATE_ROLLBACK_FAILED \u2014 the stack is wedged and will refuse further updates until the rollback completes.","To unstick it:"," 1. Find the resource(s) that failed to roll back: aws cloudformation describe-stack-events --stack-name <stack> (look for UPDATE_ROLLBACK_FAILED resource events and their status reasons)."," 2. Fix the underlying cause if possible (an ECS service that cannot stabilise usually means the previous image cannot boot \u2014 check stopped-task reasons above)."," 3. Resume the rollback: aws cloudformation continue-update-rollback --stack-name <stack> [--resources-to-skip <logical-ids>]."," 4. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed"].join(`
|
|
2
|
+
`);function oe(o){const{ecsService:i,callbacks:s,abortSignal:a}=o,S=o.pollIntervalMs??H,u=new Map,E=new AbortController,b=a!==void 0?AbortSignal.any([a,E.signal]):E.signal;let C=!1,N=!1;const D=c(e=>{s.onECSProgress?.(p(e))},"emitProgress"),$=c((e,t)=>t.createdAt!==void 0&&t.createdAt.getTime()>=e.updateStartedAt.getTime()-V,"isFreshDeployment"),O=c(async e=>{const t=await i.describeServices(e.clusterName,[e.serviceArn],b);if(!t.success){f.debug(m,"DescribeServices poll failed (transient, observing)",{serviceArn:e.serviceArn,error:p(t.error.message)});return}const r=t.data[0];if(r===void 0)return;const n=r.deployments?.find(l=>l.status==="PRIMARY");if(n?.id!==void 0&&(e.targetDeploymentId===void 0?$(e,n)&&(e.targetDeploymentId=n.id,e.targetTaskDefinitionArn=n.taskDefinition):n.id!==e.targetDeploymentId&&n.id!==e.replacedByDeploymentId&&(e.replacedByDeploymentId=n.id,D(`${e.serviceName}: ECS replaced the in-flight deployment \u2014 now rolling out ${_(n.taskDefinition)}`)),(n.id===e.targetDeploymentId||n.id===e.replacedByDeploymentId)&&n.rolloutState!==void 0)){const v=`${n.id}:${n.rolloutState}`;if(v!==e.lastNarratedRollout){e.lastNarratedRollout=v;const h=n.rolloutStateReason!==void 0&&n.rolloutStateReason!==""?` (${n.rolloutStateReason})`:"";D(`${e.serviceName}: rollout ${n.rolloutState}${h} \u2014 running ${n.runningCount??0}/${n.desiredCount??0}`),s.onECSUpdate?.(n.rolloutState,e.serviceName)}n.id===e.targetDeploymentId&&(e.lastRolloutState=n.rolloutState,n.rolloutStateReason!==void 0&&n.rolloutStateReason!==""&&(e.lastRolloutReason=n.rolloutStateReason))}if(e.targetDeploymentId===void 0)return;const T=await i.listStoppedTasks(e.clusterName,e.targetDeploymentId,b);if(!T.success){f.debug(m,"ListTasks poll failed (transient, observing)",{serviceArn:e.serviceArn,error:p(T.error.message)});return}const d=T.data.filter(l=>!e.stoppedTaskArns.has(l));if(d.length===0&&e.pendingForensicArns.size===0)return;for(const l of d)e.stoppedTaskArns.add(l);const k=e.pendingForensicArns.size>0,R=[...e.pendingForensicArns,...d];let g=!1;const y=await i.describeTasks(e.clusterName,R,b);if(y.success)g=k,e.pendingForensicArns.clear(),y.data.length>0&&(e.latestForensic=y.data[y.data.length-1]);else{for(const l of R)e.pendingForensicArns.add(l);f.debug(m,"DescribeTasks poll failed (transient, observing)",{serviceArn:e.serviceArn,error:p(y.error.message)})}if(d.length===0&&!g)return;const A=e.latestForensic!==void 0?` \u2014 latest: ${F(e.latestForensic)}`:"";D(`${e.serviceName}: ${e.stoppedTaskArns.size} task(s) from the new revision stopped since the update began${A}`)},"pollOnce"),P=c(async e=>{for(;!C&&!w(b);){try{await O(e)}catch(t){f.debug(m,"Tail poll threw (transient, observing)",{serviceArn:e.serviceArn,error:p(I(t))})}await G(S,b)}},"runTailLoop"),L=c((e,t)=>{const r=q(e);if(r===void 0){f.debug(m,"Cannot derive cluster from legacy-format service ARN; skipping tail",{serviceArn:e});return}const n={serviceArn:e,clusterName:r.clusterName,serviceName:r.serviceName,startedAtMs:Date.now(),updateStartedAt:t,stoppedTaskArns:new Set,pendingForensicArns:new Set,loop:Promise.resolve()};n.loop=P(n),u.set(e,n),f.debug(m,"ECS deployment tail started",{serviceArn:e,clusterName:r.clusterName})},"startTail");return{observeResourceEvent(e){if(!C){if(e.resourceType===Y&&W.has(e.status)&&e.physicalId!==void 0&&e.physicalId!==""&&!u.has(e.physicalId)){L(e.physicalId,e.timestamp);return}e.resourceType===j&&e.status==="UPDATE_ROLLBACK_FAILED"&&!N&&(N=!0,s.onOutput?.(`${X}
|
|
3
|
+
`))}},async finalise(e){if(C)return;C=!0,E.abort();const t=e?.deploySucceeded===!0;await Promise.all([...u.values()].map(async r=>{await r.loop.catch(n=>{f.debug(m,"Tail loop rejected during finalise",{serviceArn:r.serviceArn,error:p(I(n))})}),await M(r,t).catch(n=>{f.debug(m,"Tail completion emission failed",{serviceArn:r.serviceArn,error:p(I(n))})})}))}};async function M(e,t){if(e.targetDeploymentId===void 0){f.debug(m,"No fresh deployment was ever adopted; skipping ECS completion event",{serviceArn:e.serviceArn});return}let r,n,T,d=e.lastRolloutState,k=e.lastRolloutReason;if(!w(a)){const l=await i.describeServices(e.clusterName,[e.serviceArn],a);if(l.success&&l.data[0]!==void 0){const v=l.data[0];r=v.taskDefinition,n=v.runningCount,T=v.desiredCount;const h=v.deployments?.find(x=>x.status==="PRIMARY");h?.id!==void 0&&(h.id===e.targetDeploymentId?h.rolloutState!==void 0&&(d=h.rolloutState,k=h.rolloutStateReason??k):e.replacedByDeploymentId===void 0&&(e.replacedByDeploymentId=h.id))}else l.success||f.debug(m,"Final DescribeServices snapshot failed",{serviceArn:e.serviceArn,error:p(l.error.message)})}const R=e.replacedByDeploymentId!==void 0;let g;R?g=!1:d==="COMPLETED"?g=!0:d==="FAILED"?g=!1:g=t,r!==void 0&&e.targetTaskDefinitionArn!==void 0&&r!==e.targetTaskDefinitionArn&&D(`${e.serviceName}: service settled on ${_(r)}, not the deployment's target ${_(e.targetTaskDefinitionArn)} \u2014 ECS rolled the service back`);const A=[];g||(k!==void 0?A.push(k):R||A.push(`rollout state ${d??"unknown"} when monitoring ended`),R&&A.push("ECS replaced the in-flight deployment before it completed"),e.stoppedTaskArns.size>0&&A.push(`${e.stoppedTaskArns.size} distinct task(s) from the new revision stopped`),e.latestForensic!==void 0&&A.push(`latest: ${F(e.latestForensic)}`)),s.onECSComplete?.({serviceName:e.serviceName,serviceArn:e.serviceArn,success:g,taskDefinitionArn:r??e.targetTaskDefinitionArn??"unknown",durationMs:Date.now()-e.startedAtMs,...A.length>0&&{reason:p(A.join("; "))},...n!==void 0&&{finalRunningCount:n},...T!==void 0&&{finalDesiredCount:T},...d!==void 0&&{rolloutState:d},...R&&{replaced:!0},...e.stoppedTaskArns.size>0&&{stoppedTaskCount:e.stoppedTaskArns.size},...e.latestForensic?.stopCode!==void 0&&{stopCode:e.latestForensic.stopCode},...e.latestForensic?.stoppedReason!==void 0&&{stoppedReason:p(e.latestForensic.stoppedReason)}})}}c(oe,"createEcsDeploymentTail");function q(o){const i=":service/",s=o.indexOf(i);if(s===-1)return;const S=o.slice(s+i.length).split("/");if(S.length<2)return;const u=S[0],E=S[1];if(!(u===void 0||u===""||E===void 0||E===""))return{clusterName:u,serviceName:E}}c(q,"parseServiceArn");function _(o){if(o===void 0)return"unknown revision";const i=o.split("/"),s=i[i.length-1];return s!==void 0&&s!==""?s:o}c(_,"shortTaskDefinition");function F(o){const i=o.containers.filter(a=>a.exitCode!==void 0).map(a=>{const S=`${a.name??"container"} exit ${a.exitCode}`,u=a.name===U&&a.exitCode!==void 0?z(a.exitCode):void 0;return u===void 0?S:`${S} \u2014 ${K[u]}`}).join(", "),s=o.stoppedReason??o.stopCode??"no stopped reason recorded";return i!==""?`${s} (${i})`:s}c(F,"formatForensic");export{H as ECS_TAIL_POLL_INTERVAL_MS,X as UPDATE_ROLLBACK_FAILED_RUNBOOK,oe as createEcsDeploymentTail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var L=Object.defineProperty;var d=(e,t)=>L(e,"name",{value:t,configurable:!0});import{createHash as N}from"node:crypto";import{ECRClient as O,BatchCheckLayerAvailabilityCommand as G,CompleteLayerUploadCommand as D,CreateRepositoryCommand as H,DescribeImagesCommand as j,InitiateLayerUploadCommand as U,PutImageCommand as F,UploadLayerPartCommand as Y}from"@aws-sdk/client-ecr";import{success as S,failure as E}from"@fjall/generator";import{getErrorMessage as w,maskSensitiveOutput as p}from"@fjall/util";import{logger as
|
|
1
|
+
var L=Object.defineProperty;var d=(e,t)=>L(e,"name",{value:t,configurable:!0});import{createHash as N}from"node:crypto";import{ECRClient as O,BatchCheckLayerAvailabilityCommand as G,CompleteLayerUploadCommand as D,CreateRepositoryCommand as H,DescribeImagesCommand as j,InitiateLayerUploadCommand as U,PutImageCommand as F,UploadLayerPartCommand as Y}from"@aws-sdk/client-ecr";import{success as S,failure as E}from"@fjall/generator";import{getErrorMessage as w,maskSensitiveOutput as p}from"@fjall/util";import{ecrCreateRepositoryTags as z}from"@fjall/util/aws";import{logger as R}from"@fjall/util/logger";import{parseSchemaGateImageTagsFromManifest as J}from"@fjall/util/manifest";import{SCHEMA_GATE_ECR_REPO_NAME as c,SCHEMA_GATE_PUBLIC_IMAGE_REPO as h}from"@fjall/util/migration";import{composeSdkAbortSignal as l,extractErrorName as $,isAborted as b}from"../../aws/organisations/types.js";const _="SchemaGateImage",k=h.indexOf("/"),g=h.slice(0,k),T=h.slice(k+1),s='The deploy was refused before any stack changed. Fix the cause and re-run, or set schemaGate: { image: "<uri>" } to bring your own gate image, or schemaGate: { materialise: false } to disable the gate container.',V=["application/vnd.oci.image.index.v1+json","application/vnd.oci.image.manifest.v1+json","application/vnd.docker.distribution.manifest.list.v2+json","application/vnd.docker.distribution.manifest.v2+json"].join(", "),W=new Set(["application/vnd.oci.image.index.v1+json","application/vnd.docker.distribution.manifest.list.v2+json"]),X=10*1024*1024,P=12e4;class r extends Error{static{d(this,"SchemaGateImageError")}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}d(y,"isRecord");async function pe(e){const t=J(e.cdkOutPath);if(t.outcome==="manifest-unreadable")return E(new r(`Cannot determine the assembly's schema-gate image tags: ${p(t.reason)}. Re-run the build to regenerate the assembly, or remove the corrupt cdk.out and redeploy.`));const o=t.tags;if(o.length===0)return S(void 0);const a=e.awsProvider.getClient(O),n=e.fetchFn??fetch;try{for(const i of o){if(b(e.abortSignal))throw new r(`Aborted before ensuring schema-gate image '${c}:${i}'`);if(await Z(a,i,e.abortSignal)){R.debug(_,"Schema-gate image already present",{tag:i});continue}e.onLog?.(`Schema-gate image ${c}:${i} is not in this account's ECR \u2014 mirroring it from ${h} (one-off per engine version)`,"info"),await q(a,e.abortSignal),await K(a,n,i,e.abortSignal),e.onLog?.(`Mirrored schema-gate image ${c}:${i}`,"info")}return S(void 0)}catch(i){return i instanceof r?E(i):E(new Error(`Could not ensure the schema-gate image in this account's ECR: ${p(w(i))}. ${s}`))}}d(pe,"ensureSchemaGateImage");async function Z(e,t,o){try{return await e.send(new j({repositoryName:c,imageIds:[{imageTag:t}]}),{abortSignal:l(o)}),!0}catch(a){const n=$(a);if(n==="ImageNotFoundException"||n==="RepositoryNotFoundException")return!1;throw new r(`Could not check for schema-gate image '${c}:${t}': ${p(w(a))}. ${s}`)}}d(Z,"isTagPresent");async function q(e,t){try{await e.send(new H({repositoryName:c,imageScanningConfiguration:{scanOnPush:!0},imageTagMutability:"IMMUTABLE",tags:z(c)}),{abortSignal:l(t)}),R.debug(_,"Created schema-gate repository",{repositoryName:c})}catch(o){if($(o)!=="RepositoryAlreadyExistsException")throw new r(`Could not create schema-gate repository '${c}': ${p(w(o))}. ${s}`)}}d(q,"ensureGateRepository");async function K(e,t,o,a){const n=await Q(t,a),i=await v(t,n,o,a);if(W.has(i.mediaType))for(const m of te(i.parsed,o)){if(b(a))throw new r(`Aborted while mirroring schema-gate image '${c}:${o}'`);const f=await v(t,n,m,a);await x(e,t,n,f.parsed,o,a),await M(e,f.raw,f.mediaType,{imageDigest:m},a)}else await x(e,t,n,i.parsed,o,a);await M(e,i.raw,i.mediaType,{imageTag:o},a)}d(K,"mirrorTag");async function Q(e,t){const o=`https://${g}/token/?service=${g}&scope=repository:${T}:pull`,a=await e(o,{signal:l(t)});if(!a.ok)throw new r(`Could not obtain an anonymous pull token from ${g}: HTTP ${a.status}. ${s}`);const n=await a.json();if(!y(n)||typeof n.token!="string"||n.token==="")throw new r(`The ${g} token endpoint returned no usable token. ${s}`);return n.token}d(Q,"fetchPublicPullToken");async function v(e,t,o,a){const n=await e(`https://${g}/v2/${T}/manifests/${o}`,{headers:{Authorization:`Bearer ${t}`,Accept:V},signal:l(a)});if(!n.ok)throw new r(`Could not fetch manifest '${o}' from ${h}: HTTP ${n.status}. ${s}`);const i=await n.text();o.startsWith("sha256:")&&B(Buffer.from(i),o,`manifest ${o}`);let m;try{m=JSON.parse(i)}catch{throw new r(`Manifest '${o}' from ${h} is not valid JSON. ${s}`)}if(!y(m))throw new r(`Manifest '${o}' from ${h} has an unexpected shape. ${s}`);const f=n.headers.get("content-type"),A=f!==null&&f!==""?f:typeof m.mediaType=="string"?m.mediaType:"";return{raw:i,mediaType:A,parsed:m}}d(v,"fetchPublicManifest");const ee=/^sha256:[0-9a-f]{64}$/;function C(e,t){if(!ee.test(e))throw new r(`A descriptor for '${h}:${t}' carries a malformed digest. ${s}`);return e}d(C,"assertDigestShape");function te(e,t){if(!Array.isArray(e.manifests))throw new r(`The index manifest for '${h}:${t}' carries no child manifests. ${s}`);const o=[];for(const a of e.manifests){if(!y(a)||typeof a.digest!="string")throw new r(`The index manifest for '${h}:${t}' has a malformed child descriptor. ${s}`);o.push(C(a.digest,t))}return o}d(te,"collectIndexChildDigests");function oe(e,t){const o=[],a=e.config;if(!y(a)||typeof a.digest!="string")throw new r(`An image manifest for '${h}:${t}' has no config digest. ${s}`);if(o.push(C(a.digest,t)),!Array.isArray(e.layers))throw new r(`An image manifest for '${h}:${t}' has no layer list. ${s}`);for(const n of e.layers){if(!y(n)||typeof n.digest!="string")throw new r(`An image manifest for '${h}:${t}' has a malformed layer descriptor. ${s}`);o.push(C(n.digest,t))}return o}d(oe,"collectBlobDigests");async function x(e,t,o,a,n,i){const m=oe(a,n),f=await e.send(new G({repositoryName:c,layerDigests:m}),{abortSignal:l(i)}),A=new Set((f.layers??[]).filter(u=>u.layerAvailability==="AVAILABLE").map(u=>u.layerDigest));for(const u of m){if(b(i))throw new r(`Aborted while mirroring schema-gate image '${c}:${n}'`);if(A.has(u))continue;const I=await ae(t,o,u,i);B(I,u,`blob ${u}`),await ne(e,u,I,i)}}d(x,"mirrorImageBlobs");async function ae(e,t,o,a){const n=await e(`https://${g}/v2/${T}/blobs/${o}`,{headers:{Authorization:`Bearer ${t}`},signal:l(a,P)});if(!n.ok)throw new r(`Could not download blob ${o} from ${h}: HTTP ${n.status}. ${s}`);return new Uint8Array(await n.arrayBuffer())}d(ae,"fetchPublicBlob");function B(e,t,o){const a=`sha256:${N("sha256").update(e).digest("hex")}`;if(a!==t)throw new r(`Integrity check failed for ${o} from ${h}: downloaded content hashes to ${a}. Refusing to push it. ${s}`)}d(B,"assertDigestMatches");async function ne(e,t,o,a){const i=(await e.send(new U({repositoryName:c}),{abortSignal:l(a)})).uploadId;if(i===void 0)throw new r(`ECR returned no upload id for blob ${t}. ${s}`);let m=0;for(;m<o.length;){if(b(a))throw new r(`Aborted while uploading blob ${t} to '${c}'`);const f=Math.min(m+X,o.length);await e.send(new Y({repositoryName:c,uploadId:i,partFirstByte:m,partLastByte:f-1,layerPartBlob:o.subarray(m,f)}),{abortSignal:l(a,P)}),m=f}try{await e.send(new D({repositoryName:c,uploadId:i,layerDigests:[t]}),{abortSignal:l(a)})}catch(f){if($(f)!=="LayerAlreadyExistsException")throw new r(`Could not complete the upload of blob ${t}: ${p(w(f))}. ${s}`)}}d(ne,"uploadBlob");async function M(e,t,o,a,n){try{await e.send(new F({repositoryName:c,imageManifest:t,...o!==""?{imageManifestMediaType:o}:{},...a}),{abortSignal:l(n)})}catch(i){if($(i)!=="ImageAlreadyExistsException")throw new r(`Could not push a schema-gate manifest to '${c}': ${p(w(i))}. ${s}`)}}d(M,"putImage");export{pe as ensureSchemaGateImage};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Promise-based sleep that short-circuits when the supplied abort signal
|
|
3
|
-
* fires. Long-running poll loops MUST use this for inter-poll delays so a
|
|
4
|
-
* shutdown signal (e.g. SIGTERM in the webapp deployment worker) does not
|
|
5
|
-
* stall for the full sleep duration. Resolves (never rejects) on abort;
|
|
6
|
-
* callers check `signal.aborted` after waking.
|
|
7
|
-
*/
|
|
8
|
-
export declare function sleepAbortable(ms: number, signal?: AbortSignal): Promise<void>;
|
|
1
|
+
export { sleepAbortable } from "@fjall/util/migration";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{sleepAbortable as r}from"@fjall/util/migration";export{r as sleepAbortable};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/deploy-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/fjall-tech/fjall.git",
|
|
@@ -96,15 +96,15 @@
|
|
|
96
96
|
"@aws-sdk/client-ssm": "^3.1098.0",
|
|
97
97
|
"@aws-sdk/client-sso-admin": "^3.1098.0",
|
|
98
98
|
"@aws-sdk/client-sts": "^3.1098.0",
|
|
99
|
-
"@fjall/generator": "^
|
|
100
|
-
"@fjall/util": "^
|
|
99
|
+
"@fjall/generator": "^21.0.0",
|
|
100
|
+
"@fjall/util": "^21.0.0",
|
|
101
101
|
"@smithy/node-http-handler": "^4.9.13",
|
|
102
102
|
"aws-cdk": "^2.1134.0",
|
|
103
103
|
"tsx": "^4.23.1",
|
|
104
104
|
"zod": "^4.4.3"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@fjall/components-infrastructure": ">=
|
|
107
|
+
"@fjall/components-infrastructure": ">=21.0.0 <22.0.0"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@fjall/components-infrastructure": {
|