diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cc9e3c6faf83..8cb76ca3b3d1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -194,21 +194,18 @@ jobs: yarn synthetic-chain prepare-build working-directory: a3p-integration - - name: Override the platforms in docker-bake.json - run: | - jq -n --arg PLATFORMS "$DOCKER_PLATFORMS" \ - '{"variable": {"PLATFORMS": { "default": ($PLATFORMS | split(",")) }}}' \ - > ./docker-bake.override.json - working-directory: a3p-integration - - name: Save SDK_TAG run: echo "SDK_TAG=${{ needs.snapshot.outputs.tag }}" >> $GITHUB_ENV - - name: Override some Docker tags we don't want + - name: Override the docker-bake.json variables run: | - IMAGE="$REGISTRY/agoric/agoric-sdk" - sed -i.bak -e "s%$IMAGE:unreleased%$IMAGE:$SDK_TAG%g" Dockerfile - sed -i.bak -e "s%$REGISTRY/agoric/agoric-3-proposals:%$IMAGE:%g" docker-bake.hcl + REPOSITORY_COLON="$REGISTRY/agoric/agoric-sdk:" + jq -n --arg REPOSITORY_COLON "$REPOSITORY_COLON" \ + --arg PLATFORMS "$DOCKER_PLATFORMS" \ + '{"variable": { + "PLATFORMS": { "default": ($PLATFORMS | split(",")) }, + "REPOSITORY_COLON": { "default": $REPOSITORY_COLON }, + }}' > ./docker-bake.override.json working-directory: a3p-integration - name: Prefix tags @@ -246,6 +243,7 @@ jobs: docker-bake.override.json docker-bake.hcl ${{ steps.meta.outputs.bake-file }} + set: '*.args.SDK_TAG=${{ env.SDK_TAG }}' targets: use-upgrade-next push: true workdir: ./a3p-integration diff --git a/a3p-integration/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch b/a3p-integration/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch index 3d01386399df..a52568daab00 100644 --- a/a3p-integration/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch +++ b/a3p-integration/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch @@ -1,5 +1,5 @@ diff --git a/dist/upgrade-test-scripts/env_setup.sh b/dist/upgrade-test-scripts/env_setup.sh -index 617a0fbe7efdfa457e28fc52806dba1b323930d8..25f52a6cf133dca830bd0dcd47c91700e6a8effe 100755 +index 53bad1db0fcafa8a64727fe635ba6fdfac63a464..7eea07fc5fa5f4b4221d04fafa28ea3aaacce858 100755 --- a/dist/upgrade-test-scripts/env_setup.sh +++ b/dist/upgrade-test-scripts/env_setup.sh @@ -100,7 +100,7 @@ killAgd() { @@ -11,3 +11,145 @@ index 617a0fbe7efdfa457e28fc52806dba1b323930d8..25f52a6cf133dca830bd0dcd47c91700 } provisionSmartWallet() { +diff --git a/dist/cli/cli.js b/dist/cli/cli.js +index 53bad1db0fcafa8a64727fe635ba6fdfac63a464..7eea07fc5fa5f4b4221d04fafa28ea3aaacce858 100755 +--- a/dist/cli/cli.js ++++ b/dist/cli/cli.js +@@ -14,7 +14,9 @@ import path from "node:path"; + var defaultConfig = { + // Tag of the agoric-3 image containing all passed proposals + // Must match the Bake file and CI config +- fromTag: "latest" ++ fromTag: "latest", ++ repositoryColon: "ghcr.io/agoric/agoric-3-proposals:", ++ sdkRepositoryColon: "ghcr.io/agoric/agoric-sdk:", + }; + function readBuildConfig(root2) { + const packageJsonPath = path.join(root2, "package.json"); +@@ -64,7 +66,6 @@ import fs3 from "node:fs"; + import assert from "node:assert"; + import fs2 from "node:fs"; + import * as path2 from "node:path"; +-var repository = "ghcr.io/agoric/agoric-3-proposals"; + function readInfo(proposalPath) { + assert( + proposalPath === proposalPath.toLowerCase(), +@@ -106,7 +107,7 @@ function readProposals(proposalsParent) { + function imageNameForProposal(proposal, stage2) { + const target = `${stage2}-${proposal.proposalName}`; + return { +- name: `${repository}:${target}`, ++ name: `${repositoryColon}${target}`, + target + }; + } +@@ -141,10 +142,10 @@ RUN /usr/src/upgrade-test-scripts/run_prepare_zero.sh + * Resume from state of an existing image. + * Creates a "use" stage upon which a PREPARE or EVAL can stack. + */ +- RESUME(fromTag) { ++ RESUME(fromTag, repositoryColon) { + return ` + ## RESUME +-FROM ghcr.io/agoric/agoric-3-proposals:${fromTag} as use-${fromTag} ++FROM ${repositoryColon}${fromTag} as use-${fromTag} + `; + }, + /** +@@ -184,10 +185,10 @@ RUN ./run_prepare.sh ${path5} + planName, + proposalName, + sdkImageTag +- }) { ++ }, sdkRepositoryColon) { + return ` + # EXECUTE ${proposalName} +-FROM ghcr.io/agoric/agoric-sdk:${sdkImageTag} as execute-${proposalName} ++FROM ${sdkRepositoryColon}${sdkImageTag} as execute-${proposalName} + + WORKDIR /usr/src/upgrade-test-scripts + +@@ -274,7 +275,7 @@ FROM ${useImage} as latest + `; + } + }; +-function writeBakefileProposals(allProposals2, platforms) { ++function writeBakefileProposals(allProposals2, platforms, repositoryColon) { + const json = { + variable: { + PLATFORMS: { +@@ -282,16 +283,19 @@ function writeBakefileProposals(allProposals2, platforms) { + }, + PROPOSALS: { + default: allProposals2.map((p) => p.proposalName) +- } ++ }, ++ REPOSITORY_COLON: { ++ default: repositoryColon ++ }, + } + }; + fs3.writeFileSync("docker-bake.json", JSON.stringify(json, null, 2)); + } +-function writeDockerfile(allProposals2, fromTag) { ++function writeDockerfile(allProposals2, fromTag, repositoryColon, sdkRepositoryColon) { +- const blocks = ["# syntax=docker/dockerfile:1.4"]; ++ const blocks = ["# syntax=docker/dockerfile:1.4\nARG SDK_TAG"; + let previousProposal = null; + if (fromTag) { +- blocks.push(stage.RESUME(fromTag)); ++ blocks.push(stage.RESUME(fromTag, repositoryColon)); + previousProposal = { + proposalName: fromTag, + proposalIdentifier: fromTag, +@@ -320,7 +324,7 @@ function writeDockerfile(allProposals2, fromTag) { + stage.PREPARE_ZERO(proposal.proposalName, proposal.planName) + ); + } +- blocks.push(stage.EXECUTE(proposal)); ++ blocks.push(stage.EXECUTE(proposal, sdkRepositoryColon)); + break; + default: + throw new Error(`unsupported proposal type ${proposal.type}`); +@@ -476,8 +480,8 @@ var prepareDockerBuild = () => { + const cliPath = new URL(import.meta.url).pathname; + const publicDir = path4.resolve(cliPath, "..", ".."); + execSync4(`cp -r ${path4.resolve(publicDir, "docker-bake.hcl")} .`); +- writeDockerfile(allProposals, buildConfig.fromTag); +- writeBakefileProposals(allProposals, buildConfig.platforms); ++ writeDockerfile(allProposals, buildConfig.fromTag, buildConfig.repositoryColon, buildConfig.sdkRepositoryColon); ++ writeBakefileProposals(allProposals, buildConfig.platforms, buildConfig.repositoryColon); + execSync4(`cp -r ${path4.resolve(publicDir, "upgrade-test-scripts")} .`); + buildProposalSubmissions(proposals); + execSync4( +diff --git a/dist/docker-bake.hcl b/dist/docker-bake.hcl +index 75d25cb8e071473b18cc9ea9517b6f4e59f17518..7f54a014b517f82b224e4ec9af68ca55e392b90b 100644 +--- a/dist/docker-bake.hcl ++++ b/dist/docker-bake.hcl +@@ -23,7 +23,7 @@ target "use" { + proposal = PROPOSALS + } + // TODO proposal *number* would be immutable +- tags = ["ghcr.io/agoric/agoric-3-proposals:use-${proposal}"] ++ tags = ["${REPOSITORY_COLON}use-${proposal}"] + labels = { + "org.opencontainers.image.title": "Use ${proposal}", + "org.opencontainers.image.description": "Use agoric-3 synthetic chain after ${proposal} proposal", +@@ -37,7 +37,7 @@ target "test" { + matrix = { + proposal = PROPOSALS + } +- tags = ["ghcr.io/agoric/agoric-3-proposals:test-${proposal}"] ++ tags = ["${REPOSITORY_COLON}test-${proposal}"] + labels = { + "org.opencontainers.image.title": "Test ${proposal}", + } +@@ -49,7 +49,7 @@ target "test" { + target "latest" { + inherits = ["docker-metadata-action"] + platforms = PLATFORMS +- tags = ["ghcr.io/agoric/agoric-3-proposals:latest"] ++ tags = ["${REPOSITORY_COLON}latest"] + labels = { + "org.opencontainers.image.title": "All passed proposals", + "org.opencontainers.image.description": "Use agoric-3 synthetic chain including all passed proposals", diff --git a/a3p-integration/proposals/e:upgrade-next/package.json b/a3p-integration/proposals/e:upgrade-next/package.json index c3bd2a7c3c10..5d9f7b8b4356 100644 --- a/a3p-integration/proposals/e:upgrade-next/package.json +++ b/a3p-integration/proposals/e:upgrade-next/package.json @@ -1,7 +1,7 @@ { "agoricProposal": { "releaseNotes": false, - "sdkImageTag": "unreleased", + "sdkImageTag": "${SDK_TAG:-unreleased}", "planName": "UNRELEASED_A3P_INTEGRATION", "upgradeInfo": { "coreProposals": [] diff --git a/a3p-integration/yarn.lock b/a3p-integration/yarn.lock index c5c8e80616e2..6ed90292caea 100644 --- a/a3p-integration/yarn.lock +++ b/a3p-integration/yarn.lock @@ -21,7 +21,7 @@ __metadata: "@agoric/synthetic-chain@patch:@agoric/synthetic-chain@npm%3A0.1.0#~/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch": version: 0.1.0 - resolution: "@agoric/synthetic-chain@patch:@agoric/synthetic-chain@npm%3A0.1.0#~/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch::version=0.1.0&hash=4a65eb" + resolution: "@agoric/synthetic-chain@patch:@agoric/synthetic-chain@npm%3A0.1.0#~/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch::version=0.1.0&hash=1011e4" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -29,7 +29,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/e974038161b1a9570912a02d9366c6680bc13ee3dfd0e49d06e5ce5e93dbcddf04d1d4cd453af0969bf29ccfe96ce3e141a214539722449add90b13f0785f1f7 + checksum: 10c0/449353e825da1885d174d44f9de2e8fc8a628a2b1d245ba8107c73743c4b7128ddba5a088f18c18d892f235851f17c4607e3a667c860ac7a55210b8870fe9bae languageName: node linkType: hard