added block explorer image in integration test#273
Conversation
Signed-off-by: farooqazamwasimnl <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
| # ────────────────────────────────────────────────────────────────────────────── | ||
| # Pull explorer image (:latest — independently released, non-blocking) | ||
| # If the pull fails the E2E test continues without the explorer smoke check. | ||
| # ────────────────────────────────────────────────────────────────────────────── | ||
| EXPLORER_IMAGE="${EXPLORER_REPO:-}/${EXPLORER_IMAGE_NAME:-}:latest" | ||
| EXPLORER_AVAILABLE="false" | ||
| if [[ -n "${EXPLORER_REPO:-}" && -n "${EXPLORER_IMAGE_NAME:-}" ]]; then | ||
| echo "Pulling explorer image: ${EXPLORER_IMAGE}..." | ||
| if docker pull "${EXPLORER_IMAGE}" 2>/dev/null; then | ||
| EXPLORER_AVAILABLE="true" | ||
| echo " ✅ ${EXPLORER_IMAGE}" | ||
| else | ||
| echo " ⚠️ Explorer image unavailable — smoke check will be skipped" | ||
| fi | ||
| fi | ||
|
|
||
| if [ -n "${GITHUB_OUTPUT:-}" ]; then | ||
| echo "explorer_image=${EXPLORER_IMAGE}" >> "${GITHUB_OUTPUT}" | ||
| echo "explorer_available=${EXPLORER_AVAILABLE}" >> "${GITHUB_OUTPUT}" | ||
| fi |
There was a problem hiding this comment.
We support three ways to do this.
- refs.conf holds the url and branch/tag to be used for all dependencies.
- override the same with a flag while running build script.
- provide branch/tag as input via github action to workflow to test the integration on the CI.
Hence, we need to do the same for explorer too. Given that the docker image PR is merged, we can create a tag at the explorer and update this integration test.
There was a problem hiding this comment.
@cendhu I have applied the changes , please have a review
Signed-off-by: farooqazamwasimnl <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
| required: false | ||
| default: "" | ||
| explorer-ref: | ||
| description: "fabric-x-block-explorer image tag. Empty=use refs.conf default" |
There was a problem hiding this comment.
for consistency with other refs.
| description: "fabric-x-block-explorer image tag. Empty=use refs.conf default" | |
| description: "fabric-x-block-explorer ref. Empty=use refs.conf default" |
There was a problem hiding this comment.
@cendhu
Pin EXPLORER_REF to a real tag in refs.conf (e.g. v0.1.0) once a tag is cut in the explorer repo?
In explorer repo , every tag also get an image with latest tag as well.
What you recommend?
| COMMITTER_IMAGE: ${{ steps.images.outputs.committer_image }} | ||
| LOADGEN_IMAGE: ${{ steps.images.outputs.loadgen_image }} | ||
| EXPLORER_IMAGE: ${{ steps.images.outputs.explorer_image }} | ||
| EXPLORER_AVAILABLE: ${{ steps.images.outputs.explorer_available }} |
There was a problem hiding this comment.
Why do we have Explorer available?
There was a problem hiding this comment.
@cendhu it was added to check availability of the image, now that we will be adding repo , so it will be removed
| echo " --fabric-x-ref=REF Tag, branch, or commit for fabric-x tools" | ||
| echo " --committer-ref=REF Tag, branch, or commit for fabric-x-committer" | ||
| echo " --orderer-ref=REF Tag, branch, or commit for fabric-x-orderer" | ||
| echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)" |
There was a problem hiding this comment.
| echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)" | |
| echo " --explorer-ref=REF Tag, branch, or commit for fabric-x-explorer" |
| echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)" | ||
| echo " --fabric-x-repo=URL Override default fabric-x GitHub repo URL" | ||
| echo " --committer-repo=URL Override default committer GitHub repo URL" | ||
| echo " --orderer-repo=URL Override default orderer GitHub repo URL" |
There was a problem hiding this comment.
we also need to introduce a --explorer-repo=URL to override the default one. For example, when we fix some issues, we may use our local fork and branch.
| # If the pull fails the E2E test continues without the explorer smoke check. | ||
| # ────────────────────────────────────────────────────────────────────────────── | ||
| EXPLORER_IMAGE="${EXPLORER_REPO}/${EXPLORER_IMAGE_NAME}:${EXPLORER_REF}" | ||
| EXPLORER_AVAILABLE="false" |
There was a problem hiding this comment.
It should always be available. Remove this available check.
| 11. Prompt user before cleanup (so they can view Grafana dashboards) | ||
| 11. Explorer smoke check — start explorer + postgres, wait for /healthz (non-blocking) | ||
| 12. Explorer block ingestion check — poll /blocks/height > 0 (non-blocking) | ||
| 13. Prompt user before cleanup (so they can view Grafana dashboards) |
There was a problem hiding this comment.
| 13. Prompt user before cleanup (so they can view Grafana dashboards) | |
| 13. Prompt user before cleanup (so they can view Grafana dashboards and block explorer) |
| FABRIC_X_REPO="https://github.com/hyperledger/fabric-x.git" | ||
| ORDERER_REPO="https://github.com/hyperledger/fabric-x-orderer.git" | ||
| COMMITTER_REPO="https://github.com/hyperledger/fabric-x-committer.git" | ||
| EXPLORER_REPO="ghcr.io/lf-decentralized-trust-labs" |
There was a problem hiding this comment.
We should specify the github URL.
| # EXPLORER_AVAILABLE is set to "true" by build-e2e.sh when the image was | ||
| # successfully pulled. Default to "false" so the smoke check is skipped | ||
| # when run-e2e.sh is invoked standalone without build-e2e.sh. | ||
| EXPLORER_AVAILABLE="${EXPLORER_AVAILABLE:-false}" |
| if [[ "${EXPLORER_AVAILABLE}" != "true" ]]; then | ||
| echo "⏭️ Explorer image not available — skipping smoke check" | ||
| return 0 | ||
| fi |
|
|
||
| local i height | ||
| for ((i = 1; i <= HEALTH_TIMEOUT; i++)); do | ||
| height=$(curl -sf http://127.0.0.1:8080/blocks/height 2>/dev/null \ |
There was a problem hiding this comment.
can we count the number of transactions and it should be >= 5000? This ensures the explorer works for certain duration.
There was a problem hiding this comment.
@cendhu test node generates 50 blocks. Are you referring to blocks or transactions in any of the blocks?
Type of change
Description
Adds a non-blocking block explorer smoke check to the E2E integration test.
The explorer (
ghcr.io/lf-decentralized-trust-labs/fabric-x-block-explorer:latest)is an independently released component — it is not co-versioned with
fabric-x.The integration follows these principles:
:latestfrom GHCR inbuild-e2e.sh(best-effort).If the pull fails the core E2E test is unaffected.
run-e2e.shafterstep_9_verify_results:postgres+explorercompose services, polls/healthzGET /blocks/heightto confirm at least one block was ingested0.step_9_verify_resultsowns the pass/fail decision..github/workflows/e2e.yml— it delegates fully to the shell scripts.Files changed:
integration/test/refs.conf— addedEXPLORER_IMAGE_NAME+EXPLORER_REPOintegration/test/build-e2e.sh— best-effort image pull, writesexplorer_availabletoGITHUB_OUTPUTintegration/test/docker-compose.yaml— addedpostgresandexplorerservicesintegration/test/explorerconfig/explorer.yaml— new explorer config (DB + sidecar + REST)integration/test/run-e2e.sh— addedstep_10_smoke_explorer,step_11_verify_explorerintegration/test/README.md— updated image table, steps list, directory structureRelated issues
LF-Decentralized-Trust-labs/fabric-x-block-explorer#18