Skip to content

Commit 855e3d2

Browse files
committed
build(miner): pin tip GHCR digests and publicize packages
Point DEFAULT agent and attest-helper images at images CI tip 3056ca7 digests. Add a workflow that sets those GHCR packages public so Phala CVMs can pull without registry credentials.
1 parent 3056ca7 commit 855e3d2

2 files changed

Lines changed: 57 additions & 3 deletions

File tree

.github/workflows/ghcr-public.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Make GHCR container packages public so paid Phala / unauth pulls work.
2+
# GITHUB_TOKEN has packages:write in this workflow; account PATs often lack it.
3+
name: ghcr-public
4+
5+
on:
6+
workflow_dispatch:
7+
workflow_run:
8+
workflows: ["images"]
9+
types: [completed]
10+
branches: [reborn, dev]
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
jobs:
17+
set-public:
18+
if: >
19+
github.event_name == 'workflow_dispatch' ||
20+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Set package visibility public
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
OWNER: ${{ github.repository_owner }}
27+
run: |
28+
set -euo pipefail
29+
# Nested image names: ghcr.io/<owner>/gbase/<suffix> → package name "gbase/<suffix>"
30+
pkgs=(
31+
"gbase/gbase-agent"
32+
"gbase/gbase-attest-helper"
33+
"gbase/gateway"
34+
"gbase/validator"
35+
"gbase/updater"
36+
"gbase/agent-challenge"
37+
)
38+
ok=0
39+
for pkg in "${pkgs[@]}"; do
40+
enc=$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=""))' "$pkg")
41+
code=$(curl -sS -o "/tmp/vis-${enc}.json" -w "%{http_code}" \
42+
-X PUT \
43+
-H "Accept: application/vnd.github+json" \
44+
-H "Authorization: Bearer ${GH_TOKEN}" \
45+
-H "X-GitHub-Api-Version: 2022-11-28" \
46+
"https://api.github.com/orgs/${OWNER}/packages/container/${enc}/visibility" \
47+
-d '{"visibility":"public"}' || true)
48+
echo "pkg=${pkg} http=${code} body=$(head -c 200 /tmp/vis-${enc}.json || true)"
49+
if [ "$code" = "204" ] || [ "$code" = "200" ]; then
50+
ok=$((ok + 1))
51+
fi
52+
done
53+
echo "publicized_ok=${ok}/${#pkgs[@]}"
54+
test "$ok" -ge 1

crates/miner/src/deploy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ use crate::inspect::reject_raw_docker_sock_on_agent;
1111
pub use crate::template::DEFAULT_SOCKET_PROXY_IMAGE;
1212
use crate::template::{docker_compose_yaml, ComposeTemplateInput, DOCKER_BASE_ENV};
1313

14-
/// Default digest-pinned agent image (placeholder pin until CI publishes real digests).
14+
/// Default digest-pinned agent image (digest from images CI tip 3056ca7).
1515
pub const DEFAULT_AGENT_IMAGE: &str =
16-
"ghcr.io/baseintelligence/gbase/gbase-agent@sha256:c4cd56307195c50aab92c4b162c603dbca080061f86c5b9886c0e3c61cf7285f";
16+
"ghcr.io/baseintelligence/gbase/gbase-agent@sha256:50508825f450c6d1b21e53bf61cda8eeee6373eaced24ec3925555feac3ebc83";
1717
/// Default digest-pinned attest-helper image.
1818
pub const DEFAULT_ATTEST_HELPER_IMAGE: &str =
19-
"ghcr.io/baseintelligence/gbase/gbase-attest-helper@sha256:783582207b46ec19ff9a8568d922125e2b6ad6049b493903107746b326289cd2";
19+
"ghcr.io/baseintelligence/gbase/gbase-attest-helper@sha256:9bf28955414f087d27e033e085a16be2fda20290404add83bd919893c24e8d7c";
2020

2121
/// Whether to invoke the Phala CLI after rendering.
2222
#[derive(Debug, Clone, Copy, PartialEq, Eq)]

0 commit comments

Comments
 (0)