Move config under worker config. Add new integration test to GHA matrix.
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>v0.9
parent
b3cf7c43cf
commit
60d38f972c
|
@ -90,6 +90,9 @@ jobs:
|
|||
-
|
||||
pkg: ./cmd/buildctl ./worker/containerd
|
||||
typ: integration
|
||||
-
|
||||
pkg: ./solver
|
||||
typ: integration
|
||||
-
|
||||
pkg: ''
|
||||
skip-integration-tests: 1
|
||||
|
|
|
@ -22,8 +22,6 @@ type Config struct {
|
|||
Registries map[string]RegistryConfig `toml:"registry"`
|
||||
|
||||
DNS *DNSConfig `toml:"dns"`
|
||||
|
||||
MaxParallelism int `toml:"max-parallelism"`
|
||||
}
|
||||
|
||||
type GRPCConfig struct {
|
||||
|
@ -93,6 +91,8 @@ type OCIConfig struct {
|
|||
// ApparmorProfile is the name of the apparmor profile that should be used to constrain build containers.
|
||||
// The profile should already be loaded (by a higher level system) before creating a worker.
|
||||
ApparmorProfile string `toml:"apparmor-profile"`
|
||||
|
||||
MaxParallelism int `toml:"max-parallelism"`
|
||||
}
|
||||
|
||||
type ContainerdConfig struct {
|
||||
|
@ -108,6 +108,8 @@ type ContainerdConfig struct {
|
|||
// ApparmorProfile is the name of the apparmor profile that should be used to constrain build containers.
|
||||
// The profile should already be loaded (by a higher level system) before creating a worker.
|
||||
ApparmorProfile string `toml:"apparmor-profile"`
|
||||
|
||||
MaxParallelism int `toml:"max-parallelism"`
|
||||
}
|
||||
|
||||
type GCPolicy struct {
|
||||
|
|
|
@ -227,8 +227,8 @@ func containerdWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([
|
|||
}
|
||||
|
||||
var parallelismSem *semaphore.Weighted
|
||||
if common.config.MaxParallelism > 0 {
|
||||
parallelismSem = semaphore.NewWeighted(int64(common.config.MaxParallelism))
|
||||
if cfg.MaxParallelism > 0 {
|
||||
parallelismSem = semaphore.NewWeighted(int64(cfg.MaxParallelism))
|
||||
}
|
||||
|
||||
snapshotter := ctd.DefaultSnapshotter
|
||||
|
|
|
@ -278,8 +278,8 @@ func ociWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([]worker
|
|||
}
|
||||
|
||||
var parallelismSem *semaphore.Weighted
|
||||
if common.config.MaxParallelism > 0 {
|
||||
parallelismSem = semaphore.NewWeighted(int64(common.config.MaxParallelism))
|
||||
if cfg.MaxParallelism > 0 {
|
||||
parallelismSem = semaphore.NewWeighted(int64(cfg.MaxParallelism))
|
||||
}
|
||||
|
||||
opt, err := runc.NewWorkerOpt(common.config.Root, snFactory, cfg.Rootless, processMode, cfg.Labels, idmapping, nc, dns, cfg.Binary, cfg.ApparmorProfile, parallelismSem)
|
||||
|
|
|
@ -93,7 +93,7 @@ func testParallelism(t *testing.T, sb integration.Sandbox) {
|
|||
type parallelismSetterSingle struct{}
|
||||
|
||||
func (*parallelismSetterSingle) UpdateConfigFile(in string) string {
|
||||
return in + "\n\nmax-parallelism = 1\n"
|
||||
return in + "\n\n[worker.oci]\n max-parallelism = 1\n\n[worker.containerd]\n max-parallelism = 1\n"
|
||||
}
|
||||
|
||||
var maxParallelismSingle integration.ConfigUpdater = ¶llelismSetterSingle{}
|
||||
|
|
Loading…
Reference in New Issue