Skip to content

Commit

Permalink
Merge pull request #128 from Agoric/121-bundle-cost
Browse files Browse the repository at this point in the history
fix stale "latest" image
  • Loading branch information
turadg authored Mar 12, 2024
2 parents ef32c1d + c340b98 commit 754a8d1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions proposals/61:lo-bundle-cost/test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,4 +14,3 @@ if [ "$cost" != "$expected" ]; then
else
echo "Cost is $cost"
fi

0 comments on commit 754a8d1

Please sign in to comment.