Skip to content

Advance latest node image on every main update - #3044

Open
UnArbosFive wants to merge 1 commit into
mainfrom
fix/onchain-runtime-docker
Open

Advance latest node image on every main update#3044
UnArbosFive wants to merge 1 commit into
mainfrom
fix/onchain-runtime-docker

Conversation

@UnArbosFive

@UnArbosFive UnArbosFive commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Publish the production node image on every successful push to main.
  • Tag the same validated multi-architecture image as both :main and :latest.
  • Keep release, vN, devnet, testnet, and feature-ref images from changing :latest.
  • Serialize main publications and reject a built SHA that is no longer the current main head.
  • Add focused tag-policy tests and a lightweight pull-request check.

Why

The stable image should not depend on runtime-release polling, protected environment approvals, or one workflow dispatching another. A merge to main already runs the production image build, architecture checks, and executable validation. Once those checks pass, that build is the correct default image.

This makes the publication rule deterministic: the newest successful main build is the only workflow allowed to move :latest.

The current main SHA is checked immediately before the registry push. Older reruns fail instead of rolling the default image backward, while a newer queued main build runs after the older build exits.

Verification

  • bash -n .github/scripts/resolve-node-image.sh .github/scripts/test-resolve-node-image.sh
  • .github/scripts/test-resolve-node-image.sh
  • YAML parsing for .github/workflows/docker.yml and .github/workflows/check-node-image-publication.yml
  • git diff --check origin/main...HEAD

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview Aug 22, 2026 1:46pm

Request Review

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH account-age/public-repo scrutiny, mitigated by repository admin permission and substantial merged history; no Gittensor association or commit-author mismatch; fix/onchain-runtime-docker -> main.

The publication resolver executes only after checkout of the immutable revision produced by setup. The new policy limits :latest advancement to current main builds, and the pull-request validation workflow has read-only contents permission with no secret-bearing path.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in the reviewed diff. The stale-publication and privileged pre-checkout execution paths are both guarded in the current head.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

UNKNOWN Gittensor association; despite the account’s recent creation, repository admin permission and substantial merged contributions support established-contributor calibration.

The implementation matches the substantive PR description. The current-head check addresses the prior stale-publication concern, while serialization prevents competing main publication jobs from racing.

Validated with bash -n .github/scripts/resolve-node-image.sh .github/scripts/test-resolve-node-image.sh, .github/scripts/test-resolve-node-image.sh, and git diff --check. actionlint was unavailable. No overlapping PRs were reported.

Findings

No findings.

Prior-comment reconciliation

  • aee1e58e: addressed — The publish job now compares the built SHA with the current main head immediately before the registry push and rejects stale revisions.

Conclusion

The publication policy is focused, tested, and now prevents stale main runs from moving :latest. No blocking domain issues remain.


📜 Previous run (superseded)
Sev File Finding Status
MEDIUM .github/scripts/resolve-node-image.sh:17 Prevent stale main runs from rolling back latest ✅ Addressed
The publish job now compares the built SHA with the current main head immediately before the registry push and rejects stale revisions.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines -344 to -350
run: |
tag="v${{ needs.check.outputs.spec_version }}"
gh workflow run docker.yml \
--repo "$GITHUB_REPOSITORY" --ref "$tag" -f tag="$tag"
gh workflow run docker-localnet.yml \
--repo "$GITHUB_REPOSITORY" --ref "$tag" -f branch-or-tag="$tag"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Preserve release-tag publication of the localnet image

This removes both Docker dispatches, but watch-mainnet-docker.yml replaces only docker.yml. The deleted comment documents that GitHub releases created with GITHUB_TOKEN do not trigger either workflow's release event, so docker-localnet.yml now has no reliable path to publish the finalized vN image. Add an equivalent reusable-workflow call or an independent reconciler for the localnet image before deleting this dispatch.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@UnArbosFive
UnArbosFive force-pushed the fix/onchain-runtime-docker branch from 188652f to db5065f Compare August 22, 2026 13:35
@UnArbosFive UnArbosFive changed the title Publish runtime Docker images independently of release approvals Advance latest node image on every main update Aug 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

# Docker requires lowercase image names; github.repository is RaoFoundation/subtensor
echo "image=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
EVENT_NAME: ${{ github.event_name }}
run: ./.github/scripts/resolve-node-image.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CRITICAL] Checkout the trusted revision before executing its script

This self-hosted job executes a workspace-relative script before actions/checkout establishes ${{ needs.setup.outputs.sha }}. A stale or attacker-controlled workspace can therefore supply this executable, retain control of the publication job, and reach the package credential used later. Move the immutable checkout ahead of this step, then execute the resolver from that checked-out tree.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@UnArbosFive
UnArbosFive force-pushed the fix/onchain-runtime-docker branch 2 times, most recently from 7f462e8 to 39d0bbd Compare August 22, 2026 13:38

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread .github/scripts/resolve-node-image.sh Outdated
# Main is the only production publication path. A successful main build
# updates :main and :latest together; release and network tags cannot race it
# and move :latest backward.
if [[ "$tag" == main ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Prevent stale main runs from rolling back latest

This trusts the tag name without verifying that the checked-out SHA is still the current main head. Re-running an older main push (or dispatching tag=main before main advances) can finish later and overwrite :latest with an older image; a stale push rerun also shares the concurrency group and can cancel a newer in-progress run. Before enabling latest_tag, compare needs.setup.outputs.sha with the current immutable main head as late as practical, and add a test that rejects a stale main SHA.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant