Skip to content

Commit 3cbaa26

Browse files
committed
rofl/build: Stream tar directly to sqfstar without extraction
1 parent a089bd1 commit 3cbaa26

File tree

14 files changed

+552
-470
lines changed

14 files changed

+552
-470
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
29+
- name: Determine tag name
30+
id: determine-tag
31+
shell: bash
32+
run: |
33+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
34+
echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
35+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
36+
# Trim rofl-container-builder/v prefix from tag
37+
TAG="${{ github.ref_name }}"
38+
TAG="${TAG#rofl-container-builder/v}"
39+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "tag=latest" >> "$GITHUB_OUTPUT"
42+
fi
43+
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Login to ghcr.io
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: "Build and push oasisprotocol/rofl-container-builder:${{ steps.determine-tag.outputs.tag }}"
56+
uses: docker/build-push-action@v6
57+
with:
58+
context: docker/rofl-container-builder
59+
file: docker/rofl-container-builder/Dockerfile
60+
tags: ghcr.io/oasisprotocol/rofl-container-builder:${{ steps.determine-tag.outputs.tag }}
61+
pull: true
62+
push: true
63+
labels: |
64+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
65+
org.opencontainers.image.created=${{ steps.determine-tag.outputs.created }}
66+
org.opencontainers.image.revision=${{ github.sha }}
67+
68+
prune-old-images:
69+
name: prune-old-images
70+
if: ${{ always() }}
71+
needs: [build-rofl-container-builder]
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Prune old ghcr.io/oasisprotocol/rofl-container-builder images
75+
uses: vlaurin/[email protected]
76+
with:
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
organization: oasisprotocol
79+
container: rofl-container-builder
80+
keep-younger-than: 7
81+
keep-last: 2
82+
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{

build/rofl/manifest.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,19 @@ type Manifest struct {
7676
// Scripts are custom scripts that are executed by the build system at specific stages.
7777
Scripts map[string]string `yaml:"scripts,omitempty" json:"scripts,omitempty"`
7878

79+
// Tooling contains information about the tooling used to generate/update the manifest.
80+
Tooling *ToolingConfig `yaml:"tooling,omitempty" json:"tooling,omitempty"`
81+
7982
// sourceFn is the filename from which the manifest has been loaded.
8083
sourceFn string
8184
}
8285

86+
// ToolingConfig contains information about the tooling used to manage the manifest.
87+
type ToolingConfig struct {
88+
// Version is the CLI version that last modified this manifest.
89+
Version string `yaml:"version" json:"version"`
90+
}
91+
8392
// ManifestExists checks whether a manifest file exist. No attempt is made to load, parse or
8493
// validate any of the found manifest files.
8594
func ManifestExists() bool {

0 commit comments

Comments
 (0)