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
18 changes: 12 additions & 6 deletions ci/build/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ func (build *Builder) Engine(ctx context.Context) (*dagger.Container, error) {

ctr := base.
WithFile(consts.EngineServerPath, build.engineBinary()).
WithFile(consts.EngineShimPath, build.shimBinary()).
WithFile("/usr/bin/dial-stdio", build.dialstdioBinary()).
WithExec([]string{"ln", "-s", "/usr/bin/dial-stdio", "/usr/bin/buildctl"}).
WithFile("/opt/cni/bin/dnsname", build.dnsnameBinary()).
WithFile("/usr/local/bin/runc", build.runcBin(), dagger.ContainerWithFileOpts{Permissions: 0o700}).
WithFile(consts.RuncPath, build.runcBin(), dagger.ContainerWithFileOpts{Permissions: 0o700}).
WithFile(consts.DumbInitPath, build.dumbInit(), dagger.ContainerWithFileOpts{Permissions: 0o700}).
WithDirectory("/usr/local/bin", build.qemuBins()).
WithDirectory("/", build.cniPlugins()).
WithDirectory(distconsts.EngineDefaultStateDir, dag.Directory())
Expand Down Expand Up @@ -241,10 +241,6 @@ func (build *Builder) engineBinary() *dagger.File {
return build.binary("./cmd/engine", true)
}

func (build *Builder) shimBinary() *dagger.File {
return build.binary("./cmd/shim", false)
}

func (build *Builder) dnsnameBinary() *dagger.File {
return build.binary("./cmd/dnsname", false)
}
Expand Down Expand Up @@ -358,6 +354,16 @@ func (build *Builder) cniPlugins() *dagger.Directory {
return pluginDir
}

func (build *Builder) dumbInit() *dagger.File {
// dumb init is static, so we can use it on any base image
return dag.Container().From(consts.AlpineImage).
WithExec([]string{"apk", "add", "build-base", "bash"}).
WithMountedDirectory("/src", dag.Git("github.com/yelp/dumb-init").Ref(consts.DumbInitVersion).Tree()).
WithWorkdir("/src").
WithExec([]string{"make"}).
File("dumb-init")
}

func (build *Builder) goPlatformEnv(ctr *dagger.Container) *dagger.Container {
ctr = ctr.WithEnvVariable("GOOS", build.platformSpec.OS)
ctr = ctr.WithEnvVariable("GOARCH", build.platformSpec.Architecture)
Expand Down
16 changes: 8 additions & 8 deletions ci/consts/versions.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package consts

import (
"github.com/dagger/dagger/engine/distconsts"
)
import "github.com/dagger/dagger/engine/distconsts"

const (
EngineServerPath = "/usr/local/bin/dagger-engine"
EngineShimPath = distconsts.EngineShimPath
RuncPath = distconsts.RuncPath
DumbInitPath = distconsts.DumbInitPath
)

const (
Expand All @@ -24,8 +23,9 @@ const (

GolangLintImage = "golangci/golangci-lint:" + GolangLintVersion + "-alpine"

UbuntuVersion = "22.04"
RuncVersion = "v1.1.12"
CniVersion = "v1.3.0"
QemuBinImage = "tonistiigi/binfmt@sha256:e06789462ac7e2e096b53bfd9e607412426850227afeb1d0f5dfa48a731e0ba5"
UbuntuVersion = "22.04"
RuncVersion = "v1.1.12"
CniVersion = "v1.3.0"
QemuBinImage = "tonistiigi/binfmt@sha256:e06789462ac7e2e096b53bfd9e607412426850227afeb1d0f5dfa48a731e0ba5"
DumbInitVersion = "v1.2.5"
)
2 changes: 1 addition & 1 deletion cmd/engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func setDaggerDefaults(cfg *config.Config, netConf *networkConfig) error {
}

if cfg.Workers.OCI.Binary == "" {
cfg.Workers.OCI.Binary = distconsts.EngineShimPath
cfg.Workers.OCI.Binary = distconsts.RuncPath
}

if cfg.DNS == nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/engine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,8 @@ func newController(ctx context.Context, c *cli.Context, cfg *config.Config, pubs
return nil, nil, err
}

ctrler.Worker.Controller = ctrler

return ctrler, cacheManager, nil
}

Expand Down
110 changes: 0 additions & 110 deletions cmd/shim/c2h.go

This file was deleted.

Loading