Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/actions/setup-build-deps/action.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/actions/setup-dfx/action.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/actions/setup-nodejs/action.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/docker-image.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/e2e-tests.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/lint-and-test.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dist/
# e2e tests
test-results/
playwright-report/
e2e/icp_ledger/ledger.wasm.gz
e2e/icp_ledger/ledger.did

# reviews
/reviews
Expand Down
1 change: 1 addition & 0 deletions .icp-ledger-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
920df8055260f443ac3335cc0f2b06e285a688b4
1 change: 0 additions & 1 deletion .nns-extension-version

This file was deleted.

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN apt-get -yq update && \
build-essential pkg-config libssl-dev llvm-dev liblmdb-dev clang cmake rsync libunwind-dev jq xz-utils && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Node.js
COPY .node-version ./
RUN curl --fail -sSf https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash && \
Expand All @@ -36,6 +38,7 @@ RUN mkdir -p /opt/ic-wasm && \
chmod +x /opt/ic-wasm/ic-wasm

# Install dfx
ENV HOME=/root
COPY dfx.json ./
RUN DFXVM_INIT_YES=1 DFX_VERSION=$(cat dfx.json | jq -r .dfx) sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
ENV PATH=${HOME}/.local/share/dfx/bin:${PATH}
Expand All @@ -46,4 +49,7 @@ RUN npm ci

COPY . .

# Test deps: Playwright (Chromium + system libs) for the e2e step.
RUN npx playwright install chromium --with-deps

ENTRYPOINT [ "./release.sh" ]
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Prefer podman if installed, else fall back to docker. Override with CONTAINER=docker.
CONTAINER ?= $(shell command -v podman >/dev/null 2>&1 && echo podman || echo docker)

start:
ulimit -n 65000 && dfx start --background -qqqq 2>&1 | grep -v sgymv &
ulimit -n 65000 && dfx start --background -qqqq &

cycles:
dfx --identity local-minter ledger fabricate-cycles --all --cycles 1000000000000000
Expand All @@ -10,7 +13,7 @@ staging_deploy:
FEATURES=staging dfx --identity prod deploy --network $(if $(CANISTER),$(CANISTER),staging) taggr

local_deploy:
FEATURES=dev dfx deploy
FEATURES=dev dfx deploy taggr

dev_build:
FEATURES=dev ./build.sh bucket
Expand Down Expand Up @@ -59,6 +62,8 @@ e2e_build:
e2e_test:
npm run install:e2e
dfx canister create --all
./e2e/import_local_minter.sh
./e2e/install_icp_ledger.sh
make e2e_build
make start || true # don't fail if DFX is already running
npm run test:e2e
Expand All @@ -69,10 +74,24 @@ podman_machine:
podman machine rm -f || true
CONTAINERS_MACHINE_PROVIDER=qemu podman machine init --cpus 4 --memory 4096 --now

tests:
$(CONTAINER) build --quiet -t taggr . >/dev/null
mkdir -p $(shell pwd)/test-results $(shell pwd)/playwright-report
$(CONTAINER) run --rm \
--shm-size=1g \
-v $(shell pwd)/test-results:/app/test-results \
-v $(shell pwd)/playwright-report:/app/playwright-report \
taggr tests

release:
$(if $(PODMAN),podman,docker) build -t taggr .
mkdir -p $(shell pwd)/release-artifacts
$(if $(PODMAN),podman,docker) run --rm -v $(shell pwd)/release-artifacts:/target/wasm32-unknown-unknown/release taggr
$(CONTAINER) build --quiet -t taggr . >/dev/null
mkdir -p $(shell pwd)/release-artifacts $(shell pwd)/test-results $(shell pwd)/playwright-report
$(CONTAINER) run --rm \
--shm-size=1g \
-v $(shell pwd)/release-artifacts:/app/target/wasm32-unknown-unknown/release \
-v $(shell pwd)/test-results:/app/test-results \
-v $(shell pwd)/playwright-report:/app/playwright-report \
taggr
make hashes

hashes:
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,29 @@ Assume you want to verify a new upgrade proposal with code commit `<COMMIT>` and
4. `make release`
5. Verify that the printed hash matches the `<HASH>` value from the release page.

`make release` runs the full validation pipeline (lints, Rust tests, Playwright e2e) inside the container and only produces a hash if everything passes. A failing release therefore cannot be hashed — the printed hash is a signal that the wasm is both reproducible and tested. Podman is used automatically if installed; otherwise Docker. Override with `CONTAINER=docker make release`.

Outputs of a successful run:

- `release-artifacts/taggr.wasm.gz` — the production wasm.
- `test-results/` and `playwright-report/` — Playwright traces and the HTML report (open `playwright-report/index.html` to inspect any failures).

Note: the first run is slow (Chromium install layer is several hundred MB) and `dfx nns install` downloads the NNS canisters on every run.

## Release proposal

To propose a release, follow the steps above first.
If they were successful, you'll find a binary `taggr.wasm.gz` in the `release-artifacts` directory.
Use the printed code commit and the binary to submit a new release proposal.

## Running tests during development

For day-to-day iteration, skip the prod build and just run the test suite:

make tests

Same image as `make release` and the same checks (lints, Rust tests, Playwright e2e), but stops before the deterministic prod build. Use this while iterating; use `make release` when you actually want a hash.

## Backups

Make sure you have [installed cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Expand Down
13 changes: 13 additions & 0 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"networks": ["local", "ic", "staging", "staging2"]
}
]
},
"icp_ledger": {
"type": "custom",
"candid": "e2e/icp_ledger/ledger.did",
"wasm": "e2e/icp_ledger/ledger.wasm.gz",
"specified_id": "ryjl3-tyaaa-aaaaa-aaaba-cai",
"remote": {
"id": {
"ic": "ryjl3-tyaaa-aaaaa-aaaba-cai",
"staging": "ryjl3-tyaaa-aaaaa-aaaba-cai",
"staging2": "ryjl3-tyaaa-aaaaa-aaaba-cai"
}
}
}
},
"networks": {
Expand Down
Loading