-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds Debian Bullseye and Bookworm support. The only real change needed here was to update the distro config to allow us to enable the `bullseye-backports` repo so the tests can install a more recent version of go (and as such pass the test). Signed-off-by: Brian Goff <[email protected]>
- Loading branch information
Showing
12 changed files
with
165 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package debian | ||
|
||
import ( | ||
"github.com/Azure/dalec/frontend/deb/distro" | ||
) | ||
|
||
const ( | ||
BookwormDefaultTargetKey = "bookworm" | ||
BookwormAptCachePrefix = "bookworm" | ||
BookwormWorkerContextName = "dalec-bookworm-worker" | ||
|
||
bookwormRef = "mcr.microsoft.com/mirror/docker/library/debian:bookworm" | ||
bookwormVersionID = "debian12" | ||
) | ||
|
||
var ( | ||
BookwormConfig = &distro.Config{ | ||
ImageRef: bookwormRef, | ||
AptCachePrefix: BookwormAptCachePrefix, | ||
VersionID: bookwormVersionID, | ||
ContextRef: BookwormWorkerContextName, | ||
DefaultOutputImage: bookwormRef, | ||
BuilderPackages: basePackages, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package debian | ||
|
||
import ( | ||
"github.com/Azure/dalec" | ||
"github.com/Azure/dalec/frontend/deb/distro" | ||
) | ||
|
||
const ( | ||
BullseyeDefaultTargetKey = "bullseye" | ||
BullseyeAptCachePrefix = "bullseye" | ||
BullseyeWorkerContextName = "dalec-bullseye-worker" | ||
|
||
bullseyeRef = "mcr.microsoft.com/mirror/docker/library/debian:bullseye" | ||
bullseyeVersionID = "debian11" | ||
) | ||
|
||
var ( | ||
BullseyeConfig = &distro.Config{ | ||
ImageRef: bullseyeRef, | ||
AptCachePrefix: BullseyeAptCachePrefix, | ||
VersionID: bullseyeVersionID, | ||
ContextRef: BullseyeWorkerContextName, | ||
DefaultOutputImage: bullseyeRef, | ||
BuilderPackages: basePackages, | ||
|
||
// Ubuntu typically has backports repos already in it but Debian does not. | ||
// Without this the go modules test will fail since there is no viable | ||
// version of go except with the backports repository added. | ||
ExtraRepos: []dalec.PackageRepositoryConfig{ | ||
{ | ||
Envs: []string{"build", "test", "install"}, | ||
Config: map[string]dalec.Source{ | ||
"backports.list": { | ||
Inline: &dalec.SourceInline{ | ||
File: &dalec.SourceInlineFile{ | ||
Contents: "deb http://deb.debian.org/debian bullseye-backports main", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package debian | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/Azure/dalec/frontend" | ||
gwclient "github.com/moby/buildkit/frontend/gateway/client" | ||
) | ||
|
||
var ( | ||
basePackages = []string{ | ||
"aptitude", | ||
"dpkg-dev", | ||
"devscripts", | ||
"equivs", | ||
"fakeroot", | ||
"dh-make", | ||
"build-essential", | ||
"dh-apparmor", | ||
"dh-make", | ||
"dh-exec", | ||
} | ||
|
||
targets = map[string]gwclient.BuildFunc{ | ||
BookwormDefaultTargetKey: BookwormConfig.Handle, | ||
BullseyeDefaultTargetKey: BullseyeConfig.Handle, | ||
} | ||
) | ||
|
||
func Handlers(ctx context.Context, client gwclient.Client, m *frontend.BuildMux) error { | ||
return frontend.LoadBuiltinTargets(targets)(ctx, client, m) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/Azure/dalec/frontend/debian" | ||
) | ||
|
||
func TestBookworm(t *testing.T) { | ||
t.Parallel() | ||
|
||
ctx := startTestSpan(baseCtx, t) | ||
testLinuxDistro(ctx, t, debLinuxTestConfigFor(debian.BookwormDefaultTargetKey, debian.BookwormConfig)) | ||
} | ||
|
||
func TestBullseye(t *testing.T) { | ||
t.Parallel() | ||
|
||
ctx := startTestSpan(baseCtx, t) | ||
testLinuxDistro(ctx, t, debLinuxTestConfigFor(debian.BullseyeDefaultTargetKey, debian.BullseyeConfig, withPackageOverride("golang", "golang-1.19"))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters