Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: add a test for checking AKS upstream #939

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

miampf
Copy link
Contributor

@miampf miampf commented Oct 17, 2024

Add a test that checks if something in azure upstream is broken by deploying a simple container with the kata-cc-isolation runtime class. You can view a successful workflow run here.

@miampf miampf added the no changelog PRs not listed in the release notes label Oct 17, 2024
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch 2 times, most recently from b8059ee to 8fc4293 Compare October 17, 2024 15:08
@miampf miampf marked this pull request as ready for review October 17, 2024 15:08
@miampf miampf marked this pull request as draft October 17, 2024 15:08
@miampf miampf marked this pull request as ready for review October 17, 2024 15:09
@miampf
Copy link
Contributor Author

miampf commented Oct 17, 2024

Note that the boilerplate of manually adding the confcom extension to the nixpkgs overlay should be removed before merging. This is currently not possible as the azure-cli package in nixpkgs-unstable is broken.

.github/workflows/e2e_aks_runtime.yml Outdated Show resolved Hide resolved
e2e/aks-runtime/aks_runtime_test.go Outdated Show resolved Hide resolved
e2e/aks-runtime/aks_runtime_test.go Outdated Show resolved Hide resolved
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch from 54b0fb1 to 9985321 Compare October 22, 2024 08:58
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch from da67e5f to 80c55ee Compare October 22, 2024 13:08
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch from 80c55ee to 807b8b3 Compare October 24, 2024 09:37
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch 2 times, most recently from 7904b8f to faad72e Compare October 24, 2024 13:02
two jobs

indentation :(

add forgotten permissions
@miampf miampf force-pushed the miampf/e2e/kata-isolation-cc-test branch from faad72e to 71b3501 Compare October 24, 2024 13:03
@miampf
Copy link
Contributor Author

miampf commented Oct 24, 2024

Due to az installed via nix being a pinned version, I've added an option to not run an E2E test in a nix environment and turned it on for the aks-runtime test. A new successful run with this configuration can be viewed here

Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a few nits

- e2e/aks-runtime/**

jobs:
install-software:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please leave a pointer here to where these instructions come from?

Comment on lines +24 to +29
echo "Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
sudo tee /etc/apt/sources.list.d/azure-cli.sources <<EOF
Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg
EOF

WithSpec(kuberesource.PodSpec().
WithContainers(kuberesource.Container().
WithName(testContainer).
WithImage("docker.io/bash@sha256:ce062497c248eb1cf4d32927f8c1780cce158d3ed0658c586a5be7308d583cbb").
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use quay.io or ghcr.io.

Comment on lines +112 to +122
t.Cleanup(func() {
if skipUndeploy {
return
}

// delete the deployment
deletePolicy := metav1.DeletePropagationForeground
require.NoError(c.Client.AppsV1().Deployments(namespace).Delete(context.Background(), testContainer, metav1.DeleteOptions{
PropagationPolicy: &deletePolicy,
}))
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just delete the namespace?


pods, err := c.Client.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{})
require.NoError(err)
pod := pods.Items[0] // only one pod was deployed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider asserting this.


// KataPolicyGen executes `az confcom katapolicygen --yaml <resourcePath>`.
func KataPolicyGen(resourcePath string) error {
return exec.Command("az", "confcom", "katapolicygen", "--yaml", resourcePath).Run()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this potentially swallow interesting command output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants