Skip to content

Commit

Permalink
Merge branch 'dev' into xinhl/kversion
Browse files Browse the repository at this point in the history
  • Loading branch information
fseldow authored Dec 4, 2024
2 parents e6148a2 + 0888591 commit 9277bd7
Show file tree
Hide file tree
Showing 19 changed files with 861 additions and 913 deletions.
24 changes: 24 additions & 0 deletions .pipelines/.vsts-garabge-collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pool:
name: $(POOL_NAME)

parameters:
- name: DRY_RUN
displayName: Dry Run
type: boolean
default: false

jobs:
- job: gc
displayName: Garbage Collection
steps:
- checkout: self
fetchTags: false
fetchDepth: 1

- bash: |
chmod +x ./vhdbuilder/scripts/gc.sh
./vhdbuilder/scripts/gc.sh
env:
SUBSCRIPTION_ID: $(SUBSCRIPTION_ID)
DRY_RUN: ${{ parameters.DRY_RUN }}
displayName: Garbage collect resource groups
2 changes: 1 addition & 1 deletion e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Configuration struct {
TagsToRun string `env:"TAGS_TO_RUN"`
TagsToSkip string `env:"TAGS_TO_SKIP"`
TestTimeout time.Duration `env:"TEST_TIMEOUT" envDefault:"35m"`
TestTimeoutVMSS time.Duration `env:"TEST_TIMEOUT_VMSS" envDefault:"15m"`
TestTimeoutVMSS time.Duration `env:"TEST_TIMEOUT_VMSS" envDefault:"17m"`
WindowsAdminPassword string `env:"WINDOWS_ADMIN_PASSWORD"`
}

Expand Down
39 changes: 22 additions & 17 deletions e2e/config/vhd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,61 @@ type Gallery struct {
Name string
}

type OS string

var (
OSWindows OS = "windows"
OSUbuntu OS = "ubuntu"
OSMariner OS = "mariner"
OSAzureLinux OS = "azurelinux"
)

var (
VHDUbuntu1804Gen2Containerd = &Image{
Name: "1804gen2containerd",
OS: "ubuntu",
OS: OSUbuntu,
Arch: "amd64",
Distro: datamodel.AKSUbuntuContainerd1804Gen2,
Gallery: linuxGallery,
}
VHDUbuntu2204Gen2Arm64Containerd = &Image{
Name: "2204gen2arm64containerd",
OS: "ubuntu",
OS: OSUbuntu,
Arch: "arm64",
Distro: datamodel.AKSUbuntuArm64Containerd2204Gen2,
Gallery: linuxGallery,
}
VHDUbuntu2204Gen2Containerd = &Image{
Name: "2204gen2containerd",
OS: "ubuntu",
OS: OSUbuntu,
Arch: "amd64",
Distro: datamodel.AKSUbuntuContainerd2404Gen2,
Gallery: linuxGallery,
}
VHDAzureLinuxV2Gen2Arm64 = &Image{
Name: "AzureLinuxV2gen2arm64",
OS: "azurelinux",
OS: OSAzureLinux,
Arch: "arm64",
Distro: datamodel.AKSAzureLinuxV2Arm64Gen2,
Gallery: linuxGallery,
}
VHDAzureLinuxV2Gen2 = &Image{
Name: "AzureLinuxV2gen2",
OS: "azurelinux",
OS: OSAzureLinux,
Arch: "amd64",
Distro: datamodel.AKSAzureLinuxV2Gen2,
Gallery: linuxGallery,
}
VHDCBLMarinerV2Gen2Arm64 = &Image{
Name: "CBLMarinerV2gen2arm64",
OS: "mariner",
OS: OSMariner,
Arch: "arm64",
Distro: datamodel.AKSCBLMarinerV2Arm64Gen2,
Gallery: linuxGallery,
}
VHDCBLMarinerV2Gen2 = &Image{
Name: "CBLMarinerV2gen2",
OS: "mariner",
OS: OSMariner,
Arch: "amd64",
Distro: datamodel.AKSCBLMarinerV2Gen2,
Gallery: linuxGallery,
Expand All @@ -89,7 +98,7 @@ var (
VHDUbuntu2204Gen2ContainerdPrivateKubePkg = &Image{
// 2204Gen2 is a special image definition holding historical VHDs used by agentbaker e2e's.
Name: "2204Gen2",
OS: "ubuntu",
OS: OSUbuntu,
Arch: "amd64",
Version: "1.1704411049.2812",
Distro: datamodel.AKSUbuntuContainerd2404Gen2,
Expand All @@ -99,7 +108,7 @@ var (
// without kubelet, kubectl, credential-provider and wasm
VHDUbuntu2204Gen2ContainerdAirgappedK8sNotCached = &Image{
Name: "2204Gen2",
OS: "ubuntu",
OS: OSUbuntu,
Arch: "amd64",
Version: "1.1725612526.29638",
Distro: datamodel.AKSUbuntuContainerd2404Gen2,
Expand All @@ -126,7 +135,7 @@ var (

VHDWindows2022ContainerdGen2 = &Image{
Name: "windows-2022-containerd-gen2",
OS: "windows",
OS: OSWindows,
Arch: "amd64",
Distro: datamodel.AKSWindows2022ContainerdGen2,
Latest: true,
Expand All @@ -135,7 +144,7 @@ var (

VHDWindows23H2 = &Image{
Name: "windows-23H2",
OS: "windows",
OS: OSWindows,
Arch: "amd64",
Distro: datamodel.AKSWindows23H2,
Latest: true,
Expand All @@ -144,7 +153,7 @@ var (

VHDWindows23H2Gen2 = &Image{
Name: "windows-23H2-gen2",
OS: "windows",
OS: OSWindows,
Arch: "amd64",
Distro: datamodel.AKSWindows23H2Gen2,
Latest: true,
Expand All @@ -158,7 +167,7 @@ type Image struct {
Arch string
Distro datamodel.Distro
Name string
OS string
OS OS
Version string
Gallery *Gallery
Latest bool // a hack to get the latest version of the image for windows, currently windows images are not tagged
Expand Down Expand Up @@ -191,10 +200,6 @@ func (i *Image) VHDResourceID(ctx context.Context, t *testing.T) (VHDResourceID,
return i.vhd, i.vhdErr
}

func (i *Image) Windows() bool {
return i.OS == "windows"
}

// VHDResourceID represents a resource ID pointing to a VHD in Azure. This could be theoretically
// be the resource ID of a managed image or SIG image version, though for now this will always be a SIG image version.
type VHDResourceID string
Expand Down
6 changes: 2 additions & 4 deletions e2e/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ func getBootstrapToken(ctx context.Context, t *testing.T, kube *Kubeclient) stri
return fmt.Sprintf("%s.%s", id, token)
}

func execOnVM(ctx context.Context, kube *Kubeclient, vmPrivateIP, jumpboxPodName, sshPrivateKey, command string, isShellBuiltIn bool) (*podExecResult, error) {
func execOnVM(ctx context.Context, kube *Kubeclient, vmPrivateIP, jumpboxPodName, sshPrivateKey, command string) (*podExecResult, error) {
sshCommand := fmt.Sprintf(sshCommandTemplate, sshPrivateKey, strings.ReplaceAll(vmPrivateIP, ".", ""), vmPrivateIP)
if !isShellBuiltIn {
sshCommand = sshCommand + " sudo"
}
sshCommand = sshCommand + " sudo"
commandToExecute := fmt.Sprintf("%s %s", sshCommand, command)

execResult, err := execOnPrivilegedPod(ctx, kube, defaultNamespace, jumpboxPodName, commandToExecute)
Expand Down
Loading

0 comments on commit 9277bd7

Please sign in to comment.