fix(release): pi-unpin S5 review round: compose.yaml loses its build section and sets pull_policy: never, so a compose run (hello.sh, agent.sh, the task runner) never builds or pulls the agent image past the fit step and refuses a missing one; build_image runs docker build -f Containerfile, refuses without MOSAIC_IMAGE_TAG, and with the gate's prepareImage is the only builder; test-task.sh and test-auth.sh stop when the tag can't be read; the gate test's order check no longer passes on a missing call; README and pi-fit-image.mjs say the fit check runs on the host's node, which can differ from the image's (#1873, lane pi-unpin-s5)
This commit is contained in:
1 parent
8e9b05de8d
commit
5210522e13
10 files changed
+49
-25
No files matched your search
@@ -40,7 +40,8 @@ export function verifyImage(receipt,checkout,inspect=inspectImage){
|
||||
// Called by the CLI only while both lanes and the image lock are exclusive.
|
||||
// #1873 S5: the image fit step. The checkout's own scripts/pi-fit-image.mjs runs the fit check on the
|
||||
// pi package-lock.json resolves, as npm ci installed it in the checkout, before the build. It exits
|
||||
// non-zero with one line when that pi is unfit or the check can't tell.
|
||||
// non-zero with one line when that pi is unfit or the check can't tell. compose.yaml has no build
|
||||
// section, so the build below is a plain docker build of the Containerfile under the lock's tag.
|
||||
export function imageFitStep(checkout){
|
||||
try{execFileSync(process.execPath,[join(checkout,'scripts/pi-fit-image.mjs')],{cwd:checkout,encoding:'utf8',stdio:['ignore','pipe','pipe'],env:{PATH:process.env.PATH,HOME:process.env.HOME,...(process.env.TMPDIR?{TMPDIR:process.env.TMPDIR}:{})}});}
|
||||
catch(e){const line=String(e.stderr??'').trim().split('\n').pop();refuse(`image fit step refused: ${line||'it could not run'}`);}
|
||||
@@ -54,7 +55,7 @@ export function prepareImage(checkout,{grant,tempRoot,out},invoke,fit=imageFitSt
|
||||
const tag=lockTag(checkout);
|
||||
fit(checkout);
|
||||
const run=invoke??((args)=>execFileSync('docker',args,{cwd:checkout,encoding:'utf8',stdio:['ignore','pipe','pipe'],env:{PATH:process.env.PATH,HOME:process.env.HOME,...(process.env.DOCKER_HOST?{DOCKER_HOST:process.env.DOCKER_HOST}:{}),COMPOSE_PROJECT_NAME:'mg197-image-prepare',MOSAIC_IMAGE_TAG:tag,MOSAIC_DATA_ROOT:join(tempRoot,'data'),MOSAIC_PROVIDER:'fixture',MOSAIC_MODEL:'fixture',PI_AUTH_FILE:'/dev/null'}}));
|
||||
const start=performance.now();let buildOutput;try{buildOutput=run(['compose','build']);}catch(e){if(out)writeFileSync(join(out,'image-build.log'),String(e.stdout??'')+String(e.stderr??''),{mode:0o600,flag:'wx'});throw e;}if(out)writeFileSync(join(out,'image-build.log'),buildOutput,{mode:0o600,flag:'wx'});const buildWallMs=performance.now()-start;
|
||||
const start=performance.now();let buildOutput;try{buildOutput=run(['build','-f','Containerfile','-t',tag,'.']);}catch(e){if(out)writeFileSync(join(out,'image-build.log'),String(e.stdout??'')+String(e.stderr??''),{mode:0o600,flag:'wx'});throw e;}if(out)writeFileSync(join(out,'image-build.log'),buildOutput,{mode:0o600,flag:'wx'});const buildWallMs=performance.now()-start;
|
||||
if(inputDigest!==imageFingerprint(checkout))refuse('image inputs changed while building');
|
||||
const actual=JSON.parse(run(['image','inspect',tag,'--format','{{json .}}']));
|
||||
const receipt={inputDigest,imageId:actual.Id,tag,baseDigest,platform:`${actual.Os}/${actual.Architecture}`,grant,builds:1,buildWallMs,at:new Date().toISOString()};
|
||||
|
||||
Reference in new issue
Block a user