Skip to content

Commit

Permalink
docs(upgrade-test): revise readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Nov 30, 2023
1 parent 65c6efa commit 4a5710e
Showing 1 changed file with 8 additions and 42 deletions.
50 changes: 8 additions & 42 deletions packages/deployment/upgrade-test/Readme.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# 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. |
This will build an image upgrade of [agoric-3-proposals](https://github.com/Agoric/agoric-3-proposals), a Docker based environment simulating the agoric-3 mainnet chain, using the latest agoric-sdk.

## Testing

**To build the images to latest**
**To build the upgrade image**

```shell
make build
Expand All @@ -24,7 +14,7 @@ By default pre-releases use the lastest image tagged `dev` in our [container rep
a specific build:

```shell
DEST_IMAGE=docker pull ghcr.io/agoric/agoric-sdk:20230515033839-e56ae7
DEST_IMAGE=ghcr.io/agoric/agoric-sdk:20230515033839-e56ae7
```
To use a build based on local changes:
```shell
Expand All @@ -33,7 +23,7 @@ make local_sdk build
# or DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest make build
```

**To run the latest upgrade interactively**
**To run the upgrade interactively**

```shell
make run
Expand All @@ -54,15 +44,6 @@ 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
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
Expand All @@ -75,7 +56,7 @@ docker attach sweet_edison

```shell
json='{"some":"json","here":123}'
make build BUILD_OPTS="--build-arg UPGRADE_INFO_11='$json'"
make build BUILD_OPTS="--build-arg UPGRADE_INFO='$json'"
```

Search this directory for `UPGRADE_INFO` if you want to see how it is plumbed
Expand All @@ -101,24 +82,9 @@ make shell
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 local_sdk build run`


## Development

You can iterate on a particular upgrade by targeting. When you exit and run again, it will be a fresh state.
When you exit and run again, the container 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,

Expand All @@ -127,9 +93,9 @@ 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.)
That will produce 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"`)
For more details about the docker upgrade test framework, refer to the [agoric-3-proposals](https://github.com/Agoric/agoric-3-proposals) repository.

### IDE

Expand Down

0 comments on commit 4a5710e

Please sign in to comment.