From 3a5a9be77b2a066c8bbe61b04ba1b4c8013f5a47 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 25 Oct 2023 14:39:48 -0700 Subject: [PATCH 1/4] remove SDK building feature --- upgrade-test/Dockerfile | 10 ---------- upgrade-test/Makefile | 7 +------ upgrade-test/Readme.md | 31 +++++-------------------------- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/upgrade-test/Dockerfile b/upgrade-test/Dockerfile index e258c158..52a2844a 100644 --- a/upgrade-test/Dockerfile +++ b/upgrade-test/Dockerfile @@ -1,6 +1,3 @@ -# Defaults -ARG DEST_IMAGE=ghcr.io/agoric/agoric-sdk:dev - # TODO different naming scheme for upgrade handler (in app.go) and the image name ### @@ -40,7 +37,6 @@ SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh ## UPGRADE+TEST -ARG DEST_IMAGE #this is agoric-upgrade-8-1 aka pismoB FROM ghcr.io/agoric/agoric-sdk:30 as agoric-upgrade-8-1 ARG UPGRADE_INFO_9 @@ -54,7 +50,6 @@ SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh # UPGRADE+TEST -ARG DEST_IMAGE # this is agoric-upgrade-9 / pismoC with upgrade to agoric-upgrade-10 FROM ghcr.io/agoric/agoric-sdk:31 as agoric-upgrade-9 ARG UPGRADE_INFO_10 @@ -70,7 +65,6 @@ SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh # UPGRADE+TEST -ARG DEST_IMAGE #this is agoric-upgrade-10 / vaults FROM ghcr.io/agoric/agoric-sdk:35 as agoric-upgrade-10 ENV THIS_NAME=agoric-upgrade-10 USE_JS=1 @@ -87,7 +81,6 @@ SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh # UPGRADE -ARG DEST_IMAGE #this is agoric-upgrade-10 upgrading to 11 #it's a separate target because agoric-upgrade-10 takes so long to test FROM ghcr.io/agoric/agoric-sdk:35 as propose-agoric-upgrade-11 @@ -106,7 +99,6 @@ RUN . ./upgrade-test-scripts/start_to_to.sh # TEST #this is agoric-upgrade-11 / vaults+1 -ARG DEST_IMAGE FROM ghcr.io/agoric/agoric-sdk:36 as agoric-upgrade-11 ENV THIS_NAME=agoric-upgrade-11 USE_JS=1 # start-chain boilerplate @@ -122,7 +114,6 @@ SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh # UPGRADE -ARG DEST_IMAGE FROM ghcr.io/agoric/agoric-sdk:36 as propose-agoric-upgrade-12 # TODO: Replace with actual Zoe core proposal for upgrade 12 (MCS, Kread, Zoe, restart-contracts, etc) ARG UPGRADE_INFO_12='{"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]}' @@ -142,7 +133,6 @@ RUN . ./upgrade-test-scripts/start_to_to.sh # DEST (TEST) #this is agoric-upgrade-12 / multi-collateral, etc. ARG DEST_IMAGE -FROM ${DEST_IMAGE} as agoric-upgrade-12 ENV THIS_NAME=agoric-upgrade-12 COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric # start-chain boilerplate diff --git a/upgrade-test/Makefile b/upgrade-test/Makefile index 80ab780a..d9f1e3ef 100644 --- a/upgrade-test/Makefile +++ b/upgrade-test/Makefile @@ -1,15 +1,10 @@ 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) TARGET?=agoric-upgrade-12 dockerLabel?=$(TARGET) @echo target: $(TARGET) -local_sdk: - (cd ../ && make docker-build-sdk) - BUILD = docker build --progress=plain $(BUILD_OPTS) \ - --build-arg DEST_IMAGE=$(DEST_IMAGE) \ -f Dockerfile upgrade-test-scripts agoric-upgrade-7-2: @@ -62,4 +57,4 @@ run_bash: shell: docker exec -it `docker ps --latest --format json | jq -r .Names` bash -.PHONY: local_sdk agoric-upgrade-7-2 agoric-upgrade-8 agoric-upgrade-8-1 agoric-upgrade-9 agoric-upgrade-10 agoric-upgrade-11 agoric-upgrade-12 build build_test run +.PHONY: agoric-upgrade-7-2 agoric-upgrade-8 agoric-upgrade-8-1 agoric-upgrade-9 agoric-upgrade-10 agoric-upgrade-11 agoric-upgrade-12 build build_test run diff --git a/upgrade-test/Readme.md b/upgrade-test/Readme.md index cd6eacb6..1883f357 100644 --- a/upgrade-test/Readme.md +++ b/upgrade-test/Readme.md @@ -20,18 +20,11 @@ This will build all previous upgrades and upgrade each one. make build ``` -By default pre-releases use the lastest image tagged `dev` in our [container repository](https://github.com/agoric/agoric-sdk/pkgs/container/agoric-sdk). To use -a specific build: +Each stage specifies the SDK version in service when it was deployed. -```shell -DEST_IMAGE=docker pull ghcr.io/agoric/agoric-sdk:20230515033839-e56ae7 -``` -To use a build based on local changes: -```shell -# build ghcr.io/agoric/agoric-sdk:latest -make local_sdk build -# or DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest make build -``` +The last stage hasn't been deployed so it uses the lastest image tagged `dev` in our [container repository](https://github.com/agoric/agoric-sdk/pkgs/container/agoric-sdk). + +This repo doesn't yet support specifying an SDK version to test against. **To run the latest upgrade interactively** @@ -50,10 +43,6 @@ The container and chain will halt once you detach from the session. ### Troubleshooting If you get an error about port 26656 already in use, you have a local chain running on your OS. -If you run into other problems, you might have a local `agoric-sdk:latest` that -is stale. Either `make local_sdk` or delete your local image so Docker pulls -from the repository instead. - **To build and run a specific upgrade** ```shell @@ -113,22 +102,13 @@ To make the wallet ui talk to your local chain, set the network config to - the two targets to `Makefile` (e.g. `propose-agoric-upgrade-12` and `agoric-upgrade-12`) - set the default TARGET (e.g. `agoric-upgrade-12`) - add the DEST target to the `.phony` in `Makefile` -7. Test with `make local_sdk build run` +7. Test with `make build run` ## Development You can iterate on a particular upgrade by targeting. When you exit and run again, it will be a fresh state. -By default targets that use "agoric-sdk:latest" will source from CI builds. To use your local checkout of agoric-sdk inside Docker run, - -```shell -make local_sdk -``` -Builds an image: ghcr.io/agoric/agoric-sdk:latest that will be used by all your builds. - -That will produce the an image tagged agoric-sdk:latest in your local resolution. (Then run `make build run` again.) - You can send information from one run to the next using `/envs`. A release N can append ENV variable setting shell commands to `"$HOME/.agoric/envs"`. The N+1 release will then have them in its environment. (Because `env_setup.sh` starts with `source "$HOME/.agoric/envs"`) ### IDE @@ -138,7 +118,6 @@ Note that whatever changes you make within the running container will be lost wh # TODO - [X] make the Docker test environment log verbosely (agd start is just printing "block N" begin, commit) -- [ ] a target like `local_sdk` that just copies the local filesystem, without a full rebuild - [ ] alternately, mount the local agoric-sdk in the container - [ ] provide a utility to import the Docker's GOV123 keys into a local keyring From 321380cc5f4e26edf40942c7b65f5225168572b5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 25 Oct 2023 14:40:01 -0700 Subject: [PATCH 2/4] fix FINAL stage --- upgrade-test/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/upgrade-test/Dockerfile b/upgrade-test/Dockerfile index 52a2844a..944619dd 100644 --- a/upgrade-test/Dockerfile +++ b/upgrade-test/Dockerfile @@ -6,7 +6,7 @@ # UPGRADE+TEST legacy layer type in which the chain upgrade and its tests are comingled # UPGRADE layer that only runs the upgrade handler # TEST layer that only tests a previous upgrade -# DEST the final layer this build is producing, opening an interactive shell +# FINAL the final layer this build is producing, running the chain ## START # on agoric-uprade-7-2, with upgrade to agoric-upgrade-8 @@ -130,10 +130,10 @@ RUN chmod +x ./upgrade-test-scripts/*.sh SHELL ["/bin/bash", "-c"] RUN . ./upgrade-test-scripts/start_to_to.sh -# DEST (TEST) +# FINAL (TEST) #this is agoric-upgrade-12 / multi-collateral, etc. -ARG DEST_IMAGE -ENV THIS_NAME=agoric-upgrade-12 +FROM ghcr.io/agoric/agoric-sdk:dev as agoric-upgrade-12 +ENV THIS_NAME=agoric-upgrade-12 USE_JS=1 COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric # start-chain boilerplate WORKDIR /usr/src/agoric-sdk/ From dff262623b05cab7aed339a76f74ea34ef7b5722 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 25 Oct 2023 14:49:47 -0700 Subject: [PATCH 3/4] enable CI --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..12e6fd72 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: Proposal tests + +# run on all PRs +on: + pull_request: + merge_group: + push: + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-proposals: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: free up disk space + run: | + # Workaround to provide additional free space for testing. + # https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + # If this turns out not to be enough, maybe look instead at + # https://github.com/actions/runner-images/issues/2840#issuecomment-1540506686 + df -h + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + echo "=== After cleanup:" + df -h + - uses: actions/checkout@v3 + - name: build proposals test + run: | + cd upgrade-test + docker build \ + -t docker-upgrade-test:latest \ + -f Dockerfile upgrade-test-scripts + - name: run final proposal + run: docker run --env "DEST=0" docker-upgrade-test:latest + - name: notify on failure + if: failure() && github.event_name != 'pull_request' + uses: ./.github/actions/notify-status + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + from: ${{ secrets.NOTIFY_EMAIL_FROM }} + to: ${{ secrets.NOTIFY_EMAIL_TO }} + password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }} From 71e638b4ef4de8baecc91a0a360524a0286d9f8d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 25 Oct 2023 15:47:06 -0700 Subject: [PATCH 4/4] move upgrade-test files to root --- .github/workflows/ci.yml | 1 - upgrade-test/Dockerfile => Dockerfile | 0 upgrade-test/Makefile => Makefile | 0 README.md | 125 +++++++++++++++++- .../agoric-upgrade-10/actions.js | 0 .../agoric-upgrade-10/actions.test.js | 0 .../agoric-upgrade-10/legacy.sh | 0 .../agoric-upgrade-10/post.test.js | 0 .../agoric-upgrade-10/pre.test.js | 0 .../agoric-upgrade-10/upgradeHelpers.js | 0 .../agoric-upgrade-11/actions.test.js | 0 .../agoric-upgrade-11/legacy.sh | 0 .../agoric-upgrade-11/post.test.js | 0 .../agoric-upgrade-11/pre.test.js | 0 .../agoric-upgrade-12/.gitignore | 0 .../agoric-upgrade-12/actions.js | 0 .../agoric-upgrade-12/actions.test.js | 0 .../agoric-upgrade-12/post.test.js | 0 .../agoric-upgrade-12/pre.test.js | 0 .../agoric-upgrade-12/tools/vat-status.js | 0 .../zoe-full-upgrade/run-prober-script.js | 0 .../zoe-full-upgrade/run-prober.sh | 0 .../zoe-full-upgrade/zcf-upgrade-driver.sh | 0 .../zoe-full-upgrade/zcf-upgrade-permit.json | 0 .../zoe-full-upgrade/zcf-upgrade-script.js | 0 .../agoric-upgrade-8-1/.keep | 0 .../agoric-upgrade-8/.keep | 0 .../agoric-upgrade-8/actions.sh | 0 .../agoric-upgrade-8/pre_test.sh | 0 .../agoric-upgrade-8/test.sh | 0 .../agoric-upgrade-9/.keep | 0 .../agoric-upgrade-9/actions.sh | 0 .../agoric-upgrade-9/test.sh | 0 .../cliHelper.js | 0 .../commonUpgradeHelpers.js | 0 .../constants.js | 0 .../econHelpers.js | 0 .../env_setup.sh | 0 .../package.json | 0 .../propose-agoric-upgrade-11/.keep | 0 .../propose-agoric-upgrade-12/.keep | 0 .../start_ag0.sh | 0 .../start_to_to.sh | 0 upgrade-test/Readme.md | 123 ----------------- 44 files changed, 124 insertions(+), 125 deletions(-) rename upgrade-test/Dockerfile => Dockerfile (100%) rename upgrade-test/Makefile => Makefile (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/actions.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/actions.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/legacy.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/post.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/pre.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-10/upgradeHelpers.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-11/actions.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-11/legacy.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-11/post.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-11/pre.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/.gitignore (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/actions.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/actions.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/post.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/pre.test.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/tools/vat-status.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/zoe-full-upgrade/run-prober-script.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/zoe-full-upgrade/run-prober.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-driver.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-permit.json (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-script.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-8-1/.keep (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-8/.keep (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-8/actions.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-8/pre_test.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-8/test.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-9/.keep (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-9/actions.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/agoric-upgrade-9/test.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/cliHelper.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/commonUpgradeHelpers.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/constants.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/econHelpers.js (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/env_setup.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/package.json (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/propose-agoric-upgrade-11/.keep (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/propose-agoric-upgrade-12/.keep (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/start_ag0.sh (100%) rename {upgrade-test/upgrade-test-scripts => upgrade-test-scripts}/start_to_to.sh (100%) delete mode 100644 upgrade-test/Readme.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12e6fd72..122c388c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: - uses: actions/checkout@v3 - name: build proposals test run: | - cd upgrade-test docker build \ -t docker-upgrade-test:latest \ -f Dockerfile upgrade-test-scripts diff --git a/upgrade-test/Dockerfile b/Dockerfile similarity index 100% rename from upgrade-test/Dockerfile rename to Dockerfile diff --git a/upgrade-test/Makefile b/Makefile similarity index 100% rename from upgrade-test/Makefile rename to Makefile diff --git a/README.md b/README.md index f13a338e..61f8e544 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,125 @@ -# mainnet-proposals +# agoric-3-proposals + Proposals run or planned for Mainnet (agoric-3) + +This will build all previous upgrade proposals and upgrade each one. + +## Upgrades + +| number | description | notes | +| ------ | -------------- | -------------------------------------------------------------------------- | +| 8 | PismoA | Runs with Pismo release agoric-sdk (including CLI) | +| 8.1 | PismoB | +| 9 | PismoC | +| 10 | --> Vaults | Runs with latest SDK. Tests backwards compatibility with Pismo vstorage. | +| 11 | Vaults --> V+1 | Anticipated upgrade. Tests that Vaults release _can be_ upgraded in place. | + +## Testing + +**To build the images to latest** + +```shell +make build +``` + +Each stage specifies the SDK version in service when it was deployed. + +The last stage hasn't been deployed so it uses the lastest image tagged `dev` in our [container repository](https://github.com/agoric/agoric-sdk/pkgs/container/agoric-sdk). + +This repo doesn't yet support specifying an SDK version to test against. + +**To run the latest upgrade interactively** + +```shell +make run +``` + +This will start a container with the output of chain start. + +To get a shell: `make shell` + + For more info: https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/ + +The container and chain will halt once you detach from the session. + +### Troubleshooting +If you get an error about port 26656 already in use, you have a local chain running on your OS. + +**To build and run a specific upgrade** + +```shell +TARGET=agoric-upgrade-10 make build run +``` + +This will put you in `/usr/src/agoric-sdk`. You'll run commands from here. `upgrade-test-scripts` is copied here with only the test scripts for the current image. + + +If you lose the connection and want to get back, +```sh +# find the container id +docker ps +# reattach using the auto-generated goofy name +docker attach sweet_edison +``` + +**To pass specific `software-upgrade --upgrade-info`** + +```shell +json='{"some":"json","here":123}' +make build BUILD_OPTS="--build-arg UPGRADE_INFO_11='$json'" +``` + +Search this directory for `UPGRADE_INFO` if you want to see how it is plumbed +through. + +**To test CLI** + +You can point your local CLI tools to the chain running in Docker. Our Docker config binds on the same port (26656) as running a local chain. So you can use the agoric-cli commands on the Docker chain the same way. But note that the Cosmos account keys will be different from in your dev keyring. + +If when reattaching you get a log tail, you need to start a new TTY (with the container name). +```sh +docker exec -it sweet_edison bash +``` + +or just use this helper, +``` +make shell +``` + + +**To test GUI** + +To make the wallet ui talk to your local chain, set the network config to +`https://local.agoric.net/network-config` + +## To add an upgrade + +1. Update the upgrade handler in app.go +2. Duplicate the last pair of UPGRADE and TEST blocks +3. Update their number from the UPGRADE / DEST block at the end +4. Make directory for tests (e.g. `agoric-upgrade-12`) +4. Make directory for ugprade (e.g. `propose-agoric-upgrade-12` with a `.keep`) +5. Update the UPGRADE/DEST pair to be your new upgrade (THIS_NAME matching the upgrade handler string in app.go) +6. Update the `Makefile` + - the two targets to `Makefile` (e.g. `propose-agoric-upgrade-12` and `agoric-upgrade-12`) + - set the default TARGET (e.g. `agoric-upgrade-12`) + - add the DEST target to the `.phony` in `Makefile` +7. Test with `make build run` + + +## Development + +You can iterate on a particular upgrade by targeting. When you exit and run again, it will be a fresh state. + +You can send information from one run to the next using `/envs`. A release N can append ENV variable setting shell commands to `"$HOME/.agoric/envs"`. The N+1 release will then have them in its environment. (Because `env_setup.sh` starts with `source "$HOME/.agoric/envs"`) + +### IDE + +Some IDEs support connecting to a running container. For VS Code you can use [Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) to connect to a run above. Then you can edit the filesystem using the IDE. Once the workspace opens, you have to add a folder. E.g. `/usr/src/agoric-sdk/packages/agoric-cli/` for tweaking agoric-cli (without a rebuild of SDK). +Note that whatever changes you make within the running container will be lost when you terminate it. Use this just for iterating and be sure to copy any changes you want back to your real workspace. + +# TODO +- [X] make the Docker test environment log verbosely (agd start is just printing "block N" begin, commit) +- [ ] alternately, mount the local agoric-sdk in the container +- [ ] provide a utility to import the Docker's GOV123 keys into a local keyring + diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/actions.js b/upgrade-test-scripts/agoric-upgrade-10/actions.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/actions.js rename to upgrade-test-scripts/agoric-upgrade-10/actions.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/actions.test.js b/upgrade-test-scripts/agoric-upgrade-10/actions.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/actions.test.js rename to upgrade-test-scripts/agoric-upgrade-10/actions.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/legacy.sh b/upgrade-test-scripts/agoric-upgrade-10/legacy.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/legacy.sh rename to upgrade-test-scripts/agoric-upgrade-10/legacy.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/post.test.js b/upgrade-test-scripts/agoric-upgrade-10/post.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/post.test.js rename to upgrade-test-scripts/agoric-upgrade-10/post.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/pre.test.js b/upgrade-test-scripts/agoric-upgrade-10/pre.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/pre.test.js rename to upgrade-test-scripts/agoric-upgrade-10/pre.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-10/upgradeHelpers.js b/upgrade-test-scripts/agoric-upgrade-10/upgradeHelpers.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-10/upgradeHelpers.js rename to upgrade-test-scripts/agoric-upgrade-10/upgradeHelpers.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/actions.test.js b/upgrade-test-scripts/agoric-upgrade-11/actions.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-11/actions.test.js rename to upgrade-test-scripts/agoric-upgrade-11/actions.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/legacy.sh b/upgrade-test-scripts/agoric-upgrade-11/legacy.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-11/legacy.sh rename to upgrade-test-scripts/agoric-upgrade-11/legacy.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/post.test.js b/upgrade-test-scripts/agoric-upgrade-11/post.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-11/post.test.js rename to upgrade-test-scripts/agoric-upgrade-11/post.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/pre.test.js b/upgrade-test-scripts/agoric-upgrade-11/pre.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-11/pre.test.js rename to upgrade-test-scripts/agoric-upgrade-11/pre.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/.gitignore b/upgrade-test-scripts/agoric-upgrade-12/.gitignore similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/.gitignore rename to upgrade-test-scripts/agoric-upgrade-12/.gitignore diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/actions.js b/upgrade-test-scripts/agoric-upgrade-12/actions.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/actions.js rename to upgrade-test-scripts/agoric-upgrade-12/actions.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/actions.test.js b/upgrade-test-scripts/agoric-upgrade-12/actions.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/actions.test.js rename to upgrade-test-scripts/agoric-upgrade-12/actions.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/post.test.js b/upgrade-test-scripts/agoric-upgrade-12/post.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/post.test.js rename to upgrade-test-scripts/agoric-upgrade-12/post.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/pre.test.js b/upgrade-test-scripts/agoric-upgrade-12/pre.test.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/pre.test.js rename to upgrade-test-scripts/agoric-upgrade-12/pre.test.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/tools/vat-status.js b/upgrade-test-scripts/agoric-upgrade-12/tools/vat-status.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/tools/vat-status.js rename to upgrade-test-scripts/agoric-upgrade-12/tools/vat-status.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober-script.js b/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober-script.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober-script.js rename to upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober-script.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober.sh b/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober.sh rename to upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/run-prober.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-driver.sh b/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-driver.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-driver.sh rename to upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-driver.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-permit.json b/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-permit.json similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-permit.json rename to upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-permit.json diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-script.js b/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-script.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-script.js rename to upgrade-test-scripts/agoric-upgrade-12/zoe-full-upgrade/zcf-upgrade-script.js diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-8-1/.keep b/upgrade-test-scripts/agoric-upgrade-8-1/.keep similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-8-1/.keep rename to upgrade-test-scripts/agoric-upgrade-8-1/.keep diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-8/.keep b/upgrade-test-scripts/agoric-upgrade-8/.keep similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-8/.keep rename to upgrade-test-scripts/agoric-upgrade-8/.keep diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-8/actions.sh b/upgrade-test-scripts/agoric-upgrade-8/actions.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-8/actions.sh rename to upgrade-test-scripts/agoric-upgrade-8/actions.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-8/pre_test.sh b/upgrade-test-scripts/agoric-upgrade-8/pre_test.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-8/pre_test.sh rename to upgrade-test-scripts/agoric-upgrade-8/pre_test.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-8/test.sh b/upgrade-test-scripts/agoric-upgrade-8/test.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-8/test.sh rename to upgrade-test-scripts/agoric-upgrade-8/test.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-9/.keep b/upgrade-test-scripts/agoric-upgrade-9/.keep similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-9/.keep rename to upgrade-test-scripts/agoric-upgrade-9/.keep diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-9/actions.sh b/upgrade-test-scripts/agoric-upgrade-9/actions.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-9/actions.sh rename to upgrade-test-scripts/agoric-upgrade-9/actions.sh diff --git a/upgrade-test/upgrade-test-scripts/agoric-upgrade-9/test.sh b/upgrade-test-scripts/agoric-upgrade-9/test.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/agoric-upgrade-9/test.sh rename to upgrade-test-scripts/agoric-upgrade-9/test.sh diff --git a/upgrade-test/upgrade-test-scripts/cliHelper.js b/upgrade-test-scripts/cliHelper.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/cliHelper.js rename to upgrade-test-scripts/cliHelper.js diff --git a/upgrade-test/upgrade-test-scripts/commonUpgradeHelpers.js b/upgrade-test-scripts/commonUpgradeHelpers.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/commonUpgradeHelpers.js rename to upgrade-test-scripts/commonUpgradeHelpers.js diff --git a/upgrade-test/upgrade-test-scripts/constants.js b/upgrade-test-scripts/constants.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/constants.js rename to upgrade-test-scripts/constants.js diff --git a/upgrade-test/upgrade-test-scripts/econHelpers.js b/upgrade-test-scripts/econHelpers.js similarity index 100% rename from upgrade-test/upgrade-test-scripts/econHelpers.js rename to upgrade-test-scripts/econHelpers.js diff --git a/upgrade-test/upgrade-test-scripts/env_setup.sh b/upgrade-test-scripts/env_setup.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/env_setup.sh rename to upgrade-test-scripts/env_setup.sh diff --git a/upgrade-test/upgrade-test-scripts/package.json b/upgrade-test-scripts/package.json similarity index 100% rename from upgrade-test/upgrade-test-scripts/package.json rename to upgrade-test-scripts/package.json diff --git a/upgrade-test/upgrade-test-scripts/propose-agoric-upgrade-11/.keep b/upgrade-test-scripts/propose-agoric-upgrade-11/.keep similarity index 100% rename from upgrade-test/upgrade-test-scripts/propose-agoric-upgrade-11/.keep rename to upgrade-test-scripts/propose-agoric-upgrade-11/.keep diff --git a/upgrade-test/upgrade-test-scripts/propose-agoric-upgrade-12/.keep b/upgrade-test-scripts/propose-agoric-upgrade-12/.keep similarity index 100% rename from upgrade-test/upgrade-test-scripts/propose-agoric-upgrade-12/.keep rename to upgrade-test-scripts/propose-agoric-upgrade-12/.keep diff --git a/upgrade-test/upgrade-test-scripts/start_ag0.sh b/upgrade-test-scripts/start_ag0.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/start_ag0.sh rename to upgrade-test-scripts/start_ag0.sh diff --git a/upgrade-test/upgrade-test-scripts/start_to_to.sh b/upgrade-test-scripts/start_to_to.sh similarity index 100% rename from upgrade-test/upgrade-test-scripts/start_to_to.sh rename to upgrade-test-scripts/start_to_to.sh diff --git a/upgrade-test/Readme.md b/upgrade-test/Readme.md deleted file mode 100644 index 1883f357..00000000 --- a/upgrade-test/Readme.md +++ /dev/null @@ -1,123 +0,0 @@ -# Dockerized Chain Upgrade Tester - -This will build all previous upgrades and upgrade each one. - -## Upgrades - -| number | description | notes | -| ------ | -------------- | -------------------------------------------------------------------------- | -| 8 | PismoA | Runs with Pismo release agoric-sdk (including CLI) | -| 8.1 | PismoB | -| 9 | PismoC | -| 10 | --> Vaults | Runs with latest SDK. Tests backwards compatibility with Pismo vstorage. | -| 11 | Vaults --> V+1 | Anticipated upgrade. Tests that Vaults release _can be_ upgraded in place. | - -## Testing - -**To build the images to latest** - -```shell -make build -``` - -Each stage specifies the SDK version in service when it was deployed. - -The last stage hasn't been deployed so it uses the lastest image tagged `dev` in our [container repository](https://github.com/agoric/agoric-sdk/pkgs/container/agoric-sdk). - -This repo doesn't yet support specifying an SDK version to test against. - -**To run the latest upgrade interactively** - -```shell -make run -``` - -This will start a container with the output of chain start. - -To get a shell: `make shell` - - For more info: https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/ - -The container and chain will halt once you detach from the session. - -### Troubleshooting -If you get an error about port 26656 already in use, you have a local chain running on your OS. - -**To build and run a specific upgrade** - -```shell -TARGET=agoric-upgrade-10 make build run -``` - -This will put you in `/usr/src/agoric-sdk`. You'll run commands from here. `upgrade-test-scripts` is copied here with only the test scripts for the current image. - - -If you lose the connection and want to get back, -```sh -# find the container id -docker ps -# reattach using the auto-generated goofy name -docker attach sweet_edison -``` - -**To pass specific `software-upgrade --upgrade-info`** - -```shell -json='{"some":"json","here":123}' -make build BUILD_OPTS="--build-arg UPGRADE_INFO_11='$json'" -``` - -Search this directory for `UPGRADE_INFO` if you want to see how it is plumbed -through. - -**To test CLI** - -You can point your local CLI tools to the chain running in Docker. Our Docker config binds on the same port (26656) as running a local chain. So you can use the agoric-cli commands on the Docker chain the same way. But note that the Cosmos account keys will be different from in your dev keyring. - -If when reattaching you get a log tail, you need to start a new TTY (with the container name). -```sh -docker exec -it sweet_edison bash -``` - -or just use this helper, -``` -make shell -``` - - -**To test GUI** - -To make the wallet ui talk to your local chain, set the network config to -`https://local.agoric.net/network-config` - -## To add an upgrade - -1. Update the upgrade handler in app.go -2. Duplicate the last pair of UPGRADE and TEST blocks -3. Update their number from the UPGRADE / DEST block at the end -4. Make directory for tests (e.g. `agoric-upgrade-12`) -4. Make directory for ugprade (e.g. `propose-agoric-upgrade-12` with a `.keep`) -5. Update the UPGRADE/DEST pair to be your new upgrade (THIS_NAME matching the upgrade handler string in app.go) -6. Update the `Makefile` - - the two targets to `Makefile` (e.g. `propose-agoric-upgrade-12` and `agoric-upgrade-12`) - - set the default TARGET (e.g. `agoric-upgrade-12`) - - add the DEST target to the `.phony` in `Makefile` -7. Test with `make build run` - - -## Development - -You can iterate on a particular upgrade by targeting. When you exit and run again, it will be a fresh state. - -You can send information from one run to the next using `/envs`. A release N can append ENV variable setting shell commands to `"$HOME/.agoric/envs"`. The N+1 release will then have them in its environment. (Because `env_setup.sh` starts with `source "$HOME/.agoric/envs"`) - -### IDE - -Some IDEs support connecting to a running container. For VS Code you can use [Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) to connect to a run above. Then you can edit the filesystem using the IDE. Once the workspace opens, you have to add a folder. E.g. `/usr/src/agoric-sdk/packages/agoric-cli/` for tweaking agoric-cli (without a rebuild of SDK). -Note that whatever changes you make within the running container will be lost when you terminate it. Use this just for iterating and be sure to copy any changes you want back to your real workspace. - -# TODO -- [X] make the Docker test environment log verbosely (agd start is just printing "block N" begin, commit) -- [ ] alternately, mount the local agoric-sdk in the container -- [ ] provide a utility to import the Docker's GOV123 keys into a local keyring -