From d457bb78fea10bbf5cd49946071b9f48152e51fa Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Sun, 3 Dec 2023 21:57:19 +0000 Subject: [PATCH 1/2] chore(upgrade-test): various fixes --- packages/deployment/upgrade-test/Makefile | 2 +- .../deployment/upgrade-test/upgrade-test-scripts/env_setup.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/deployment/upgrade-test/Makefile b/packages/deployment/upgrade-test/Makefile index 83cc1f61f30..67cfa1b1237 100644 --- a/packages/deployment/upgrade-test/Makefile +++ b/packages/deployment/upgrade-test/Makefile @@ -49,6 +49,6 @@ run_bash: $(RUN) --entrypoint /bin/bash $(REPOSITORY):$(dockerLabel) shell: - docker exec -it `docker ps --latest --format json | jq -r .Names` bash + docker exec -it `docker ps --latest --format '{{json .}}' | jq -r .Names` bash .PHONY: local_sdk unreleased-upgrade build build_test run diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh index 5f1248f3c12..8fca4b63ec5 100755 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e # exit when any command fails +if [ -z "$PS1" ]; then + set -e # exit when any command fails +fi echo ENV_SETUP starting From bd840f4e26742159a5a5680f9cfb9cc1f49fc626 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Sun, 3 Dec 2023 23:59:23 +0000 Subject: [PATCH 2/2] chore(upgrade-test): remove BOOTSTRAP_MODE --- .github/workflows/integration.yml | 7 ------- packages/deployment/upgrade-test/Dockerfile | 8 +++----- packages/deployment/upgrade-test/Makefile | 16 +++------------- .../upgrade-test-scripts/constants.js | 1 - .../upgrade-test-scripts/env_setup.sh | 12 +++--------- .../upgrade-test-scripts/start_to_to.sh | 5 ----- 6 files changed, 9 insertions(+), 40 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9f1ac59b6d8..9710fa138eb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -221,11 +221,6 @@ jobs: if: needs.pre_check.outputs.should_run == 'true' runs-on: ubuntu-latest timeout-minutes: 60 - strategy: - matrix: - bootstrap-version: ['test', 'main'] - # Uncomment to mark a failure of the `test` bootstrap job as a successful result - # continue-on-error: ${{ matrix.bootstrap-version == 'test' }} steps: - name: free up disk space run: | @@ -248,7 +243,6 @@ jobs: create-if-needed: true - name: docker build (sdk) # Produces ghcr.io/agoric/agoric-sdk:latest used in the following upgrade test. - # TODO: Build this only once, not for every bootstrap-version. # run: cd packages/deployment && ./scripts/test-docker-build.sh | $TEST_COLLECT # XXX skip TAP test output and collection for now; it hides the output from the logs run: cd packages/deployment && make docker-build-sdk @@ -256,7 +250,6 @@ jobs: run: | cd packages/deployment/upgrade-test && \ docker build \ - --build-arg BOOTSTRAP_MODE=${{ matrix.bootstrap-version }} \ --build-arg DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest \ -t docker-upgrade-test:latest -f Dockerfile upgrade-test-scripts - name: docker run upgrade final stage diff --git a/packages/deployment/upgrade-test/Dockerfile b/packages/deployment/upgrade-test/Dockerfile index 8ce19b6a43f..20cf81e1c32 100644 --- a/packages/deployment/upgrade-test/Dockerfile +++ b/packages/deployment/upgrade-test/Dockerfile @@ -1,15 +1,14 @@ # Defaults ARG BASE_IMAGE=ghcr.io/agoric/agoric-3-proposals:main ARG DEST_IMAGE=ghcr.io/agoric/agoric-sdk:dev -ARG BOOTSTRAP_MODE=main # TODO different naming scheme for upgrade handler (in app.go) and the image name # UPGRADE FROM ${BASE_IMAGE} as propose-unreleased-upgrade # TODO: Replace with actual Zoe core proposal for vat upgrades (MCS, Kread, Zoe, restart-contracts, etc) -ARG BOOTSTRAP_MODE UPGRADE_INFO='{"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]}' -ENV THIS_NAME= UPGRADE_TO="UNRELEASED_UPGRADE" UPGRADE_INFO=${UPGRADE_INFO} BOOTSTRAP_MODE=${BOOTSTRAP_MODE} +ARG UPGRADE_INFO='{"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]}' +ENV THIS_NAME= UPGRADE_TO="UNRELEASED_UPGRADE" UPGRADE_INFO=${UPGRADE_INFO} WORKDIR /usr/src/agoric-sdk/ COPY --chmod=755 ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/ @@ -20,8 +19,7 @@ RUN . ./upgrade-test-scripts/start_to_to.sh #this is unreleased-upgrade ARG DEST_IMAGE FROM ${DEST_IMAGE} as unreleased-upgrade -ARG BOOTSTRAP_MODE -ENV THIS_NAME=unreleased-upgrade BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1 +ENV THIS_NAME=unreleased-upgrade USE_JS=1 COPY --from=propose-unreleased-upgrade /root/.agoric /root/.agoric # start-chain boilerplate WORKDIR /usr/src/agoric-sdk/ diff --git a/packages/deployment/upgrade-test/Makefile b/packages/deployment/upgrade-test/Makefile index 67cfa1b1237..a5602aca8f9 100644 --- a/packages/deployment/upgrade-test/Makefile +++ b/packages/deployment/upgrade-test/Makefile @@ -1,12 +1,6 @@ REPOSITORY = agoric/upgrade-test # use :dev (latest prerelease image) unless we build local sdk DEST_IMAGE ?= $(if $(findstring local_sdk,$(MAKECMDGOALS)),ghcr.io/agoric/agoric-sdk:latest,ghcr.io/agoric/agoric-sdk:dev) -BOOTSTRAP_MODE?=main -ifeq ($(BOOTSTRAP_MODE),main) - TAG_SUFFIX= -else - TAG_SUFFIX=-$(BOOTSTRAP_MODE) -endif TARGET?=unreleased-upgrade dockerLabel?=$(TARGET) @echo target: $(TARGET) @@ -15,22 +9,18 @@ local_sdk: (cd ../ && make docker-build-sdk) BUILD = docker build --progress=plain $(BUILD_OPTS) \ - --build-arg BOOTSTRAP_MODE=$(BOOTSTRAP_MODE) --build-arg DEST_IMAGE=$(DEST_IMAGE) \ + --build-arg DEST_IMAGE=$(DEST_IMAGE) \ -f Dockerfile upgrade-test-scripts propose-unreleased-upgrade: - $(BUILD) --target propose-unreleased-upgrade -t $(REPOSITORY):propose-unreleased-upgrade$(TAG_SUFFIX) + $(BUILD) --target propose-unreleased-upgrade -t $(REPOSITORY):propose-unreleased-upgrade unreleased-upgrade: propose-unreleased-upgrade - $(BUILD) --target unreleased-upgrade -t $(REPOSITORY):unreleased-upgrade$(TAG_SUFFIX) + $(BUILD) --target unreleased-upgrade -t $(REPOSITORY):unreleased-upgrade # build main bootstrap build: $(TARGET) -# build test bootstrap -build_test: BOOTSTRAP_MODE=test -build_test: $(TARGET) - DEBUG ?= SwingSet:ls,SwingSet:vat RUN = docker run --rm -it \ -p 26656:26656 -p 26657:26657 -p 1317:1317 \ diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/constants.js b/packages/deployment/upgrade-test/upgrade-test-scripts/constants.js index d5a7d1c3e8e..35235a95478 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/constants.js +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/constants.js @@ -4,7 +4,6 @@ export const GOV3ADDR = process.env.GOV3ADDR; export const USER1ADDR = process.env.USER1ADDR; export const VALIDATORADDR = process.env.VALIDATORADDR; -export const BOOTSTRAP_MODE = process.env.BOOTSTRAP_MODE; export const PSM_PAIR = process.env.PSM_PAIR; export const ATOM_DENOM = process.env.ATOM_DENOM; diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh index 8fca4b63ec5..e1b2ee402c5 100755 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/env_setup.sh @@ -206,15 +206,9 @@ printKeys() { } -export USDC_DENOM="ibc/toyusdc" -# Recent transfer to Emerynet -export ATOM_DENOM="ibc/06362C6F7F4FB702B94C13CD2E7C03DEC357683FD978936340B43FBFBC5351EB" -export PSM_PAIR="IST.ToyUSD" -if [[ "$BOOTSTRAP_MODE" == "main" ]]; then - export USDC_DENOM="ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F" - export ATOM_DENOM="ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA" - export PSM_PAIR="IST.USDC_axl" -fi +export USDC_DENOM="ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F" +export ATOM_DENOM="ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA" +export PSM_PAIR="IST.USDC_axl" # additional env specific to a version if [[ -n "$THIS_NAME" ]] && test -f ./upgrade-test-scripts/$THIS_NAME/env_setup.sh; then diff --git a/packages/deployment/upgrade-test/upgrade-test-scripts/start_to_to.sh b/packages/deployment/upgrade-test/upgrade-test-scripts/start_to_to.sh index 75ed52d120c..192780549a8 100644 --- a/packages/deployment/upgrade-test/upgrade-test-scripts/start_to_to.sh +++ b/packages/deployment/upgrade-test/upgrade-test-scripts/start_to_to.sh @@ -26,11 +26,6 @@ if [[ "$DEST" != "1" ]]; then exit 0 fi - if [[ "$BOOTSTRAP_MODE" == "test" ]]; then - UPGRADE_TO=${UPGRADE_TO//agoric-/agorictest-} - fi - - voting_period_s=10 latest_height=$(agd status | jq -r .SyncInfo.latest_block_height) height=$(( $latest_height + $voting_period_s + 10 ))