Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
# railpack is the builder this frontend wraps: framework detection fixes only
# reach users when the vendored version moves, so it gets its own PR rather
# than riding along in a grouped bump nobody reads.
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
railpack:
patterns:
- "github.com/railwayapp/railpack"
go-dependencies:
patterns:
- "*"
exclude-patterns:
- "github.com/railwayapp/railpack"

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
groups:
actions:
patterns:
- "*"
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ Sugapack is a BuildKit gRPC frontend that accepts a small JSON config as input (
2. **Generate plan** — runs railpack's plan generation (embedded as a Go library) on the fetched source
3. **Execute plan** — converts the plan to LLB using railpack's `build_llb` package, substituting the git source for local context

## The vendored railpack version

Framework support lives in railpack, so the version in `go.mod` is what decides
whether an app builds. It is reported in the plan step's logs and baked into
every image as `RAILPACK_VERSION`.

Dependabot opens a weekly PR for railpack on its own (see
[`.github/dependabot.yml`](.github/dependabot.yml)) so detection fixes are not
buried in a grouped dependency bump. Framework detection itself is railpack's to
test; what we check here is our own handling of the plan it produces.

## Usage

### With Depot
Expand Down
3 changes: 2 additions & 1 deletion convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type convertOptions struct {
SecretsHash string
CacheKey string
GitHubToken string
NoCache bool
}

// Image is the OCI image config attached to the build result.
Expand All @@ -38,7 +39,7 @@ func convertPlanToLLB(bp *plan.BuildPlan, sourceState llb.State, opts convertOpt
platform := opts.Platform

cacheStore := build_llb.NewBuildKitCacheStore(opts.CacheKey)
graph, err := build_llb.NewBuildGraph(bp, &sourceState, cacheStore, opts.SecretsHash, &platform, opts.GitHubToken)
graph, err := build_llb.NewBuildGraph(bp, &sourceState, cacheStore, opts.SecretsHash, &platform, opts.GitHubToken, opts.NoCache)
if err != nil {
return nil, nil, fmt.Errorf("creating build graph: %w", err)
}
Expand Down
8 changes: 8 additions & 0 deletions frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func Build(ctx context.Context, c client.Client) (*client.Result, error) {
SecretsHash: opts["build-arg:secrets-hash"],
CacheKey: opts["build-arg:cache-key"],
GitHubToken: opts["build-arg:github-token"],
NoCache: noCacheRequested(opts),
})
if err != nil {
return nil, fmt.Errorf("converting plan to LLB: %w", err)
Expand Down Expand Up @@ -213,6 +214,13 @@ func buildPlanArgs(config Config) []string {
return args
}

// noCacheRequested reports whether the client asked for a cacheless build.
// BuildKit sets the "no-cache" frontend opt with an empty value for `--no-cache`.
func noCacheRequested(opts map[string]string) bool {
_, ok := opts["no-cache"]
return ok
}

// parsePlatform extracts the target platform from build options, defaulting to linux/amd64.
func parsePlatform(opts map[string]string) specs.Platform {
p := specs.Platform{
Expand Down
88 changes: 43 additions & 45 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,88 +1,86 @@
module github.com/sugapack/sugapack

go 1.26.1
go 1.26.3

require (
github.com/moby/buildkit v0.28.1
github.com/moby/buildkit v0.32.2
github.com/opencontainers/image-spec v1.1.1
github.com/railwayapp/railpack v0.23.0
github.com/urfave/cli/v3 v3.8.0
github.com/railwayapp/railpack v0.36.4
github.com/urfave/cli/v3 v3.10.1
)

require (
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Masterminds/semver/v3 v3.5.0 // indirect
github.com/alexflint/go-filemutex v1.3.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
github.com/buger/jsonparser v1.1.2 // indirect
github.com/buger/jsonparser v1.6.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/lipgloss v1.1.0 // indirect
github.com/charmbracelet/log v1.0.0 // indirect
github.com/charmbracelet/x/ansi v0.11.6 // indirect
github.com/charmbracelet/x/ansi v0.11.8 // indirect
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/containerd/containerd/v2 v2.2.2 // indirect
github.com/containerd/containerd/v2 v2.3.3 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v1.0.0-rc.3 // indirect
github.com/containerd/ttrpc v1.2.8 // indirect
github.com/containerd/typeurl/v2 v2.2.3 // indirect
github.com/containerd/platforms v1.0.0-rc.4 // indirect
github.com/containerd/ttrpc v1.2.9 // indirect
github.com/containerd/typeurl/v2 v2.3.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/in-toto/attestation v1.2.0 // indirect
github.com/in-toto/in-toto-golang v0.10.0 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
github.com/mailru/easyjson v0.9.2 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.21 // indirect
github.com/in-toto/in-toto-golang v0.11.0 // indirect
github.com/invopop/jsonschema v0.14.0 // indirect
github.com/klauspost/compress v1.19.2 // indirect
github.com/lucasb-eyer/go-colorful v1.4.1 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mattn/go-runewidth v0.0.27 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pb33f/ordered-map/v2 v2.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.11.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/stretchr/objx v0.5.3 // indirect
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd // indirect
github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/tailscale/hujson v0.0.0-20260727124030-b80ff77dac4f // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/fsutil v0.0.0-20260717003753-6d9dc2ebad62 // indirect
github.com/xo/terminfo v1.0.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect
go.opentelemetry.io/otel v1.42.0 // indirect
go.opentelemetry.io/otel/metric v1.42.0 // indirect
go.opentelemetry.io/otel/sdk v1.42.0 // indirect
go.opentelemetry.io/otel/trace v1.42.0 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/grpc v1.79.3 // indirect
google.golang.org/protobuf v1.36.11 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.70.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
go.opentelemetry.io/otel v1.45.0 // indirect
go.opentelemetry.io/otel/metric v1.45.0 // indirect
go.opentelemetry.io/otel/sdk v1.45.0 // indirect
go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/exp v0.0.0-20260811152304-ee035b5b010f // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/text v0.41.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260810153831-ec0a7760b754 // indirect
google.golang.org/grpc v1.83.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mvdan.cc/sh/v3 v3.13.0 // indirect
mvdan.cc/sh/v3 v3.13.1 // indirect
)
Loading
Loading