From 59a4ec526a66e8d02ff90e3b3f52017ddcdb32ba Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 7 Mar 2024 09:59:50 -0800 Subject: [PATCH 1/3] feat: print bundle cost in whole units --- proposals/61:lo-bundle-cost/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proposals/61:lo-bundle-cost/test.sh b/proposals/61:lo-bundle-cost/test.sh index 6d141ca0..8ce2ecc4 100755 --- a/proposals/61:lo-bundle-cost/test.sh +++ b/proposals/61:lo-bundle-cost/test.sh @@ -1,10 +1,11 @@ #!/bin/bash set -e -expected=20000000 +expected=20 params="$(agd query swingset params -o json)" -cost="$(echo $params | jq -r ".beans_per_unit | .[] | select(.key == \"storageByte\") | .beans" )" +ucost="$(echo $params | jq -r ".beans_per_unit | .[] | select(.key == \"storageByte\") | .beans")" +cost=$((ucost / 1000000)) # fail if cost is not expected if [ "$cost" != "$expected" ]; then @@ -13,4 +14,3 @@ if [ "$cost" != "$expected" ]; then else echo "Cost is $cost" fi - From 46d4f92def92ea9d6d002b7588aecc0dd06699bb Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 8 Mar 2024 10:07:22 -0800 Subject: [PATCH 2/3] docs: clarify 'latest' image --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c51b687..2c10dcc6 100644 --- a/README.md +++ b/README.md @@ -130,12 +130,14 @@ This repo publishes an image of the synthetic agoric-3 chain with all proposals The CI builds on every push to the trunk branch, (`main`), or a PR branch. You can view all versions at https://github.com/agoric/agoric-3-proposals/pkgs/container/agoric-3-proposals/versions -The versions built from the main branch are at: `ghcr.io/agoric/agoric-3-proposals:main`. For each PR, they're at a URL like `ghcr.io/agoric/agoric-3-proposals:pr-11`. +PR builds don't push images. + +The trunk build pushes "use" images for each proposal and a "latest" which points to the highest passed proposal: `ghcr.io/agoric/agoric-3-proposals:latest`. If you RUN this image, you'll get a working chain running `agd` until you terminate, ```sh -docker run ghcr.io/agoric/agoric-3-proposals:main +docker run ghcr.io/agoric/agoric-3-proposals:latest ``` Or locally, From c340b98d2cc867fc8d70e058a72d8daf19f653da Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 8 Mar 2024 08:27:28 -0800 Subject: [PATCH 3/3] fix: push 'latest' image from latest 'use' image --- .github/workflows/ci.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcebc28a..6d090f78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,17 +142,33 @@ jobs: # Push the images if the tests pass and this is not a PR - name: Push proposal "use" images - uses: depot/bake-action@v1 # If we pushed from PRs, each one would overwrite main's (e.g. use-upgrade-8) # To push PR "use" images we'll need to qualify the tag (e.g. use-upgrade-8-pr-2). if: ${{ github.event_name != 'pull_request' }} + uses: depot/bake-action@v1 + with: + files: | + ./docker-bake.json + ./docker-bake.hcl + ${{ steps.meta.outputs.bake-file }} + targets: use + push: true + + # Just like the "use" image above but has to begin after that ends + # because the "build" here is merely to retag the latest "use" image. + # We could do this with imagetools but this lets use keep the tagging logic + # in Bake instead of mixed into CI. This step should do hardly any building + # because its FROM image was just built above. + - name: Push "latest" image + # Same reason as for "use" images + if: ${{ github.event_name != 'pull_request' }} + uses: depot/bake-action@v1 with: files: | ./docker-bake.json ./docker-bake.hcl ${{ steps.meta.outputs.bake-file }} - # Include "latest" which is latest "use" image - targets: use, latest + targets: latest push: true - name: notify on failure