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

Dynamically build e2e test OS image from architecture #1887

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions test/e2e/tests/setup_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ import (
)

var (
project = flag.String("project", "", "Project to run tests in")
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
vmNamePrefix = flag.String("vm-name-prefix", "gce-pd-csi-e2e", "VM name prefix")
architecture = flag.String("arch", "amd64", "Architecture pd csi driver build on")
minCpuPlatform = flag.String("min-cpu-platform", "AMD Milan", "Minimum CPU architecture")
zones = flag.String("zones", "us-east4-a,us-east4-c", "Zones to run tests in. If there are multiple zones, separate each by comma")
machineType = flag.String("machine-type", "n2d-standard-2", "Type of machine to provision instance on")
imageURL = flag.String("image-url", "projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2404-lts-amd64", "OS image url to get image from")
project = flag.String("project", "", "Project to run tests in")
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
vmNamePrefix = flag.String("vm-name-prefix", "gce-pd-csi-e2e", "VM name prefix")
architecture = flag.String("arch", "amd64", "Architecture pd csi driver build on")
minCpuPlatform = flag.String("min-cpu-platform", "AMD Milan", "Minimum CPU architecture")
zones = flag.String("zones", "us-east4-a,us-east4-c", "Zones to run tests in. If there are multiple zones, separate each by comma")
machineType = flag.String("machine-type", "n2d-standard-2", "Type of machine to provision instance on")
// TODO: Remove presubmit is no longer setting --image-url
imageURL = flag.String("image-url", "", "[DEPRECATED] OS image url to get image from. Not actively used")
imageProject = flag.String("image-project", "ubuntu-os-cloud", "OS image url to get image from")
imagePrefix = flag.String("image-family-prefix", "ubuntu-minimal-2404-lts", "Image family prefix, to which \"-<arch>\" is appended")
runInProw = flag.Bool("run-in-prow", false, "If true, use a Boskos loaned project and special CI service accounts and ssh keys")
deleteInstances = flag.Bool("delete-instances", false, "Delete the instances after tests run")
cloudtopHost = flag.Bool("cloudtop-host", false, "The local host is cloudtop, a kind of googler machine with special requirements to access GCP")
Expand Down Expand Up @@ -137,6 +140,7 @@ func NewTestContext(zone string) *remote.TestContext {
nodeID := fmt.Sprintf("%s-%s", *vmNamePrefix, zone)
klog.Infof("Setting up node %s", nodeID)

imageURL := fmt.Sprintf("projects/%s/global/images/family/%s-%s", *imageProject, *imagePrefix, *architecture)
instanceConfig := remote.InstanceConfig{
Project: *project,
Architecture: *architecture,
Expand All @@ -145,7 +149,7 @@ func NewTestContext(zone string) *remote.TestContext {
Name: nodeID,
MachineType: *machineType,
ServiceAccount: *serviceAccount,
ImageURL: *imageURL,
ImageURL: imageURL,
CloudtopHost: *cloudtopHost,
EnableConfidentialCompute: *enableConfidentialCompute,
ComputeService: computeService,
Expand Down
2 changes: 1 addition & 1 deletion test/run-e2e-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if hostname | grep -q c.googlers.com ; then
CLOUDTOP_HOST=--cloudtop-host
fi

ginkgo --v "test/e2e/tests" -- --project "${PROJECT}" --service-account "${IAM_NAME}" "${CLOUDTOP_HOST}" --v=6 --logtostderr $@
ginkgo --v "test/e2e/tests" -- --project "${PROJECT}" --service-account "${IAM_NAME}" ${CLOUDTOP_HOST} --v=6 --logtostderr $@