Skip to content

Commit 77537f4

Browse files
committed
rofl/build: Stream tar directly to sqfstar without extraction
1 parent 9a01701 commit 77537f4

File tree

11 files changed

+286
-450
lines changed

11 files changed

+286
-450
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: docker-rofl-container-builder
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- docker/rofl-container-builder/**
9+
- .github/workflows/docker-rofl-container-builder.yml
10+
tags:
11+
- 'rofl-container-builder/v[0-9]+.[0-9]+*'
12+
pull_request:
13+
paths:
14+
- docker/rofl-container-builder/**
15+
- .github/workflows/docker-rofl-container-builder.yml
16+
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
jobs:
22+
build-rofl-container-builder:
23+
name: build-rofl-container-builder
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha }}
30+
31+
- name: Determine tag name
32+
id: determine-tag
33+
shell: bash
34+
run: |
35+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
36+
echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
37+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
38+
# Trim rofl-container-builder/v prefix from tag
39+
TAG="${{ github.ref_name }}"
40+
TAG="${TAG#rofl-container-builder/v}"
41+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
42+
else
43+
echo "tag=latest" >> "$GITHUB_OUTPUT"
44+
fi
45+
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Login to ghcr.io
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: "Build and push oasisprotocol/rofl-container-builder:${{ steps.determine-tag.outputs.tag }}"
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: docker/rofl-container-builder
61+
file: docker/rofl-container-builder/Dockerfile
62+
tags: ghcr.io/oasisprotocol/rofl-container-builder:${{ steps.determine-tag.outputs.tag }}
63+
pull: true
64+
push: true
65+
labels: |
66+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
67+
org.opencontainers.image.created=${{ steps.determine-tag.outputs.created }}
68+
org.opencontainers.image.revision=${{ github.sha }}
69+
70+
prune-old-images:
71+
name: prune-old-images
72+
if: ${{ always() }}
73+
needs: [build-rofl-container-builder]
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Prune old ghcr.io/oasisprotocol/rofl-container-builder images
77+
uses: vlaurin/[email protected]
78+
with:
79+
token: ${{ secrets.GITHUB_TOKEN }}
80+
organization: oasisprotocol
81+
container: rofl-container-builder
82+
keep-younger-than: 7
83+
keep-last: 2
84+
prune-tags-regexes: ^pr-

build/rofl/artifacts.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package rofl
22

3-
// LatestBuilderImage is the latest builder container image to use when building ROFL apps.
4-
const LatestBuilderImage = "ghcr.io/oasisprotocol/rofl-dev:v0.5.0@sha256:31573686552abeb0edebc450f6872831f0006a6cf38220cef7e0789d4376c2c1"
3+
// Builder images for different app kinds.
4+
const (
5+
// LatestBuilderImage is the full builder with Rust toolchain for raw apps.
6+
LatestBuilderImage = "ghcr.io/oasisprotocol/rofl-dev:v0.5.0@sha256:31573686552abeb0edebc450f6872831f0006a6cf38220cef7e0789d4376c2c1"
7+
// LatestContainerBuilderImage is the minimal builder for container apps.
8+
LatestContainerBuilderImage = "ghcr.io/oasisprotocol/rofl-container-builder:0.0.1@sha256:913ef97ab07dde31f08ce873f825bf3d4f32ad4102ff5797d7c3050c121c4dce"
9+
)
510

611
// LatestBasicArtifacts are the latest TDX ROFL basic app artifacts.
712
var LatestBasicArtifacts = ArtifactsConfig{

0 commit comments

Comments
 (0)