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

Azure: Add self managed provisioner for e2e test #1447

Conversation

kartikjoshi21
Copy link
Contributor

Add self managed provisioner class to handle e2e test request for already existing cluster

Fixes: #1441

@surajssd
Copy link
Member

@kartikjoshi21 this fails for me as:

=== RUN   TestCreateSimplePodAzure/SimplePeerPod_test/PodVM_is_created
--- FAIL: TestCreateSimplePodAzure (55.36s)
    --- FAIL: TestCreateSimplePodAzure/SimplePeerPod_test (55.36s)
        --- FAIL: TestCreateSimplePodAzure/SimplePeerPod_test/PodVM_is_created (0.09s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x103f417fc]

goroutine 121 [running]:
testing.tRunner.func1.2({0x104557920, 0x105ddd0a0})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1545 +0x1c8
testing.tRunner.func1()
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1548 +0x360
panic({0x104557920?, 0x105ddd0a0?})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/runtime/panic.go:914 +0x218
github.com/confidential-containers/cloud-api-adaptor/test/e2e.AzureCloudAssert.HasPodVM({0x1400186d3b0?}, 0x140019951e0, {0x140015a1325, 0x5})
        /Users/suraj/code/work/cloud-api-adaptor/test/e2e/azure_test.go:75 +0x4c
github.com/confidential-containers/cloud-api-adaptor/test/e2e.(*testCase).run.func2({0x104b28540, 0x105ee9d40}, 0x140019951e0, 0x140001c0460?)
        /Users/suraj/code/work/cloud-api-adaptor/test/e2e/common_suite_test.go:295 +0x9a0
sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).executeSteps(0x14000542080, {0x104b28540?, 0x105ee9d40?}, 0x30000007d?, {0x14000f05f48?, 0x1, 0x154c7a6bff271?})
        /Users/suraj/go/pkg/mod/sigs.k8s.io/e2e-framework@v0.1.0/pkg/env/env.go:421 +0x9c
sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).processTestFeature.(*testEnv).execFeature.func1.1(0x140019951e0)
        /Users/suraj/go/pkg/mod/sigs.k8s.io/e2e-framework@v0.1.0/pkg/env/env.go:452 +0xa8
testing.tRunner(0x140019951e0, 0x14001a544b0)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1595 +0xe8
created by testing.(*T).Run in goroutine 165
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1648 +0x33c
FAIL    github.com/confidential-containers/cloud-api-adaptor/test/e2e   56.633s
FAIL
make: *** [test-e2e] Error 1

@kartikjoshi21 kartikjoshi21 force-pushed the kartikjoshi21/e2e-panic-fix branch 2 times, most recently from 3975fa1 to 97575d6 Compare September 25, 2023 10:17
@kartikjoshi21
Copy link
Contributor Author

@kartikjoshi21 this fails for me as:

=== RUN   TestCreateSimplePodAzure/SimplePeerPod_test/PodVM_is_created
--- FAIL: TestCreateSimplePodAzure (55.36s)
    --- FAIL: TestCreateSimplePodAzure/SimplePeerPod_test (55.36s)
        --- FAIL: TestCreateSimplePodAzure/SimplePeerPod_test/PodVM_is_created (0.09s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x103f417fc]

goroutine 121 [running]:
testing.tRunner.func1.2({0x104557920, 0x105ddd0a0})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1545 +0x1c8
testing.tRunner.func1()
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1548 +0x360
panic({0x104557920?, 0x105ddd0a0?})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/runtime/panic.go:914 +0x218
github.com/confidential-containers/cloud-api-adaptor/test/e2e.AzureCloudAssert.HasPodVM({0x1400186d3b0?}, 0x140019951e0, {0x140015a1325, 0x5})
        /Users/suraj/code/work/cloud-api-adaptor/test/e2e/azure_test.go:75 +0x4c
github.com/confidential-containers/cloud-api-adaptor/test/e2e.(*testCase).run.func2({0x104b28540, 0x105ee9d40}, 0x140019951e0, 0x140001c0460?)
        /Users/suraj/code/work/cloud-api-adaptor/test/e2e/common_suite_test.go:295 +0x9a0
sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).executeSteps(0x14000542080, {0x104b28540?, 0x105ee9d40?}, 0x30000007d?, {0x14000f05f48?, 0x1, 0x154c7a6bff271?})
        /Users/suraj/go/pkg/mod/sigs.k8s.io/e2e-framework@v0.1.0/pkg/env/env.go:421 +0x9c
sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).processTestFeature.(*testEnv).execFeature.func1.1(0x140019951e0)
        /Users/suraj/go/pkg/mod/sigs.k8s.io/e2e-framework@v0.1.0/pkg/env/env.go:452 +0xa8
testing.tRunner(0x140019951e0, 0x14001a544b0)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1595 +0xe8
created by testing.(*T).Run in goroutine 165
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/testing/testing.go:1648 +0x33c
FAIL    github.com/confidential-containers/cloud-api-adaptor/test/e2e   56.633s
FAIL
make: *** [test-e2e] Error 1

@surajssd i have added appropriate field to properties file when it is set to true then provisioner knows about already existing cluster.

@surajssd
Copy link
Member

This is a bit confusing, now we have two fields: IS_SELF_MANAGED_CLUSTER and IS_CI_MANAGED_CLUSTER.

It feels that we should change the name of IS_CI_MANAGED_CLUSTER to IS_CI_MANAGED_VPC or IS_CI_MANAGED_RG. Because that's what is going on in essence.

@kartikjoshi21
Copy link
Contributor Author

This is a bit confusing, now we have two fields: IS_SELF_MANAGED_CLUSTER and IS_CI_MANAGED_CLUSTER.

It feels that we should change the name of IS_CI_MANAGED_CLUSTER to IS_CI_MANAGED_VPC or IS_CI_MANAGED_RG. Because that's what is going on in essence.

Lets rename it as part of next PR as that has to go in without testing. I will raise a separate PR for that

@mkulke
Copy link
Contributor

mkulke commented Sep 28, 2023

Can you elaborate, what is a "self-managed" provisioner?

@surajssd
Copy link
Member

surajssd commented Sep 28, 2023

This failed with the following error:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags=azure -o caa-provisioner-cli "provisioner-cli/main.go"
time="2023-09-28T[14](https://github.com/surajssd/caa-test2/actions/runs/6339870050/job/17220207460#step:8:15):00:24Z" level=info msg="Creating VPC..."
time="2023-09-28T14:00:24Z" level=info msg="Resource group \"***\" is CI managed. No need to create new one manually."
time="2023-09-28T14:00:25Z" level=info msg="Creating Cluster..."
time="2023-09-28T14:00:25Z" level=fatal msg="envconfig: client failed: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined"
Error: Process completed with exit code 1.

Check out the detailed logs here: https://github.com/surajssd/caa-test2/actions/runs/6339870050/job/17220207460 the code for the same is here: surajssd/caa-test2#1

@surajssd
Copy link
Member

Ignore the above error. I think the code here looks ok.

Add self managed provisioner class to handle e2e test
request for already existing cluster

Fixes: confidential-containers#1441
Signed-off-by: Kartik Joshi <kartikjoshi@microsoft.com>
Copy link
Member

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

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

/lgtm

@kartikjoshi21 kartikjoshi21 merged commit 968ffe9 into confidential-containers:main Oct 31, 2023
19 checks passed
@kartikjoshi21 kartikjoshi21 deleted the kartikjoshi21/e2e-panic-fix branch October 31, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure: e2e test panics when using preinstalled cluster
4 participants