This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/3][BACKPORT] fix release branch tests (#1070)
* pep8 again * add DISPATCH_BUILD_NAME to all test containers * use github cli to determine the merge target * fix bash linting * fix makefile shell * log in github cli * bump github cli * logging in fails if GITHUB_TOKEN is set * set -x * actually use the kba-branch flag * workaround for bad "make clean" in kubeaddons-tests * fix wrong module name Co-authored-by: Joe Julian <[email protected]>
- Loading branch information
Showing
7 changed files
with
142 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ load("github.com/mesosphere/cluster-claim-controller/starlark/claim@master", "ma | |
load("github.com/mesosphere/dispatch-catalog/starlark/stable/[email protected]", "dindTask") | ||
load("github.com/mesosphere/dispatch-catalog/starlark/stable/[email protected]", "git_resource") | ||
load("github.com/mesosphere/dispatch-catalog/starlark/stable/[email protected]", "secret_var") | ||
load("github.com/mesosphere/dispatch-catalog/starlark/stable/[email protected]", "push", "pull_request", "cron", "clean", "task_step_result", "storage_resource") | ||
load("github.com/mesosphere/dispatch-catalog/starlark/stable/[email protected]", | ||
"push", "pull_request", "cron", "clean", "task_step_result", "storage_resource") | ||
load("github.com/mesosphere/dispatch-tasks/bump_charts/bump_charts@master", "bump_charts") | ||
|
||
git_clone_dirname = "kba-git-src" | ||
|
@@ -28,14 +29,29 @@ kind_cluster = make_kind_cluster(kind_cluster_name, git_clone_dirname) | |
install_kind_cluster = make_kind_cluster(kind_install_cluster_name, git_clone_dirname) | ||
upgrade_kind_cluster = make_kind_cluster(kind_upgrade_cluster_name, git_clone_dirname) | ||
|
||
common_env = [ | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_PER_ADDON_WAIT_DURATION", value="10m"), | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_SETUP_WAIT_DURATION", value="60m"), | ||
k8s.corev1.EnvVar(name="AWS_ACCESS_KEY_ID", valueFrom=secret_var( "d2iq-dispatch-aws-creds", "AWS_ACCESS_KEY_ID")), | ||
k8s.corev1.EnvVar(name="AWS_REGION", value="us-west-2"), | ||
k8s.corev1.EnvVar(name="AWS_SECRET_ACCESS_KEY", valueFrom=secret_var( "d2iq-dispatch-aws-creds", "AWS_SECRET_ACCESS_KEY")), | ||
k8s.corev1.EnvVar(name="DISPATCH_BUILD_NAME", value="$(context.build.name)"), | ||
k8s.corev1.EnvVar(name="DISPATCH_CI", value="true"), | ||
k8s.corev1.EnvVar(name="GIT_TERMINAL_PROMPT", value="1"), | ||
k8s.corev1.EnvVar(name="GITHUB_TOKEN", valueFrom=secret_var("d2iq-dispatch-basic-auth", "password")), | ||
k8s.corev1.EnvVar(name="GOPRIVATE", value="github.com/mesosphere"), | ||
k8s.corev1.EnvVar(name="KONVOY_VERSION", value="v1.6.1"), | ||
k8s.corev1.EnvVar(name="KUBEADDONS_ADDON_DELETE_DURATION", value="5m"), | ||
k8s.corev1.EnvVar(name="SSH_KEY_BASE64", valueFrom=secret_var( "d2iq-dispatch-git-ssh-base64", "ssh-privatekey-base64")), | ||
] | ||
|
||
dindTask("lint-yaml", | ||
inputs=[git_clone_dirname], | ||
steps=[ | ||
k8s.corev1.Container( | ||
name="fetch-master", | ||
name="fetch-branches", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
args=["git", "fetch", "origin", "master"] | ||
args=["git", "fetch", "origin"] | ||
), | ||
|
||
k8s.corev1.Container( | ||
|
@@ -53,31 +69,20 @@ dindTask("test-install", | |
fetch_kubeconfig(kind_install_cluster_name, git_clone_dirname), | ||
|
||
k8s.corev1.Container( | ||
name="fetch-master", | ||
name="fetch-branches", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
args=["git", "fetch", "origin", "master"]), | ||
args=["git", "fetch", "origin"]), | ||
|
||
k8s.corev1.Container( | ||
name="test-install", | ||
image="mesosphere/kubeaddons-ci:dispatch@sha256:80a6f3c8775133b4ad2fab3d44ab4fbb4b541dbc03fcdb296b13f67611427d8c", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
command=["/entrypoint.sh", "make", "dispatch-test-install-upgrade"], | ||
|
||
env=[ | ||
k8s.corev1.EnvVar(name="DISPATCH_CI", value="true"), | ||
k8s.corev1.EnvVar(name="AWS_REGION", value="us-west-2"), | ||
k8s.corev1.EnvVar(name="AWS_ACCESS_KEY_ID", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_ACCESS_KEY_ID")), | ||
k8s.corev1.EnvVar(name="AWS_SECRET_ACCESS_KEY", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_SECRET_ACCESS_KEY")), | ||
k8s.corev1.EnvVar(name="SSH_KEY_BASE64", valueFrom=secret_var("d2iq-dispatch-git-ssh-base64", "ssh-privatekey-base64")), | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_PER_ADDON_WAIT_DURATION", value="10m"), | ||
k8s.corev1.EnvVar(name="GIT_TERMINAL_PROMPT", value="1"), | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_SETUP_WAIT_DURATION", value="60m"), | ||
k8s.corev1.EnvVar(name="KUBEADDONS_ADDON_DELETE_DURATION", value="5m"), | ||
k8s.corev1.EnvVar(name="GOPRIVATE", value="github.com/mesosphere/kubeaddons,github.com/mesosphere/ksphere-testing-framework"), | ||
k8s.corev1.EnvVar(name="KONVOY_VERSION", value="v1.6.1"), | ||
env= common_env + [ | ||
k8s.corev1.EnvVar(name="CLAIM_NAME", value=task_step_result(kind_install_cluster_name, "cluster-claim")), | ||
k8s.corev1.EnvVar(name="KBA_TESTGROUP_TYPE", value="install"), | ||
k8s.corev1.EnvVar(name = "CLAIM_NAME", value = task_step_result(kind_install_cluster_name, "cluster-claim")) | ||
], | ||
], | ||
|
||
resources=k8s.corev1.ResourceRequirements( | ||
requests={ | ||
|
@@ -92,31 +97,20 @@ dindTask("test-upgrade", | |
fetch_kubeconfig(kind_upgrade_cluster_name, git_clone_dirname), | ||
|
||
k8s.corev1.Container( | ||
name="fetch-master", | ||
name="fetch-branches", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
args=["git", "fetch", "origin", "master"]), | ||
args=["git", "fetch", "origin"]), | ||
|
||
k8s.corev1.Container( | ||
name="test-upgrade", | ||
image="mesosphere/kubeaddons-ci:dispatch@sha256:80a6f3c8775133b4ad2fab3d44ab4fbb4b541dbc03fcdb296b13f67611427d8c", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
command=["/entrypoint.sh", "make", "dispatch-test-install-upgrade"], | ||
|
||
env=[ | ||
k8s.corev1.EnvVar(name="DISPATCH_CI", value="true"), | ||
k8s.corev1.EnvVar(name="AWS_REGION", value="us-west-2"), | ||
k8s.corev1.EnvVar(name="AWS_ACCESS_KEY_ID", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_ACCESS_KEY_ID")), | ||
k8s.corev1.EnvVar(name="AWS_SECRET_ACCESS_KEY", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_SECRET_ACCESS_KEY")), | ||
k8s.corev1.EnvVar(name="SSH_KEY_BASE64", valueFrom=secret_var("d2iq-dispatch-git-ssh-base64", "ssh-privatekey-base64")), | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_PER_ADDON_WAIT_DURATION", value="10m"), | ||
k8s.corev1.EnvVar(name="GIT_TERMINAL_PROMPT", value="1"), | ||
k8s.corev1.EnvVar(name="ADDON_TESTS_SETUP_WAIT_DURATION", value="60m"), | ||
k8s.corev1.EnvVar(name="KUBEADDONS_ADDON_DELETE_DURATION", value="5m"), | ||
k8s.corev1.EnvVar(name="GOPRIVATE", value="github.com/mesosphere/kubeaddons,github.com/mesosphere/ksphere-testing-framework"), | ||
k8s.corev1.EnvVar(name="KONVOY_VERSION", value="v1.6.1"), | ||
env= common_env + [ | ||
k8s.corev1.EnvVar(name="CLAIM_NAME", value=task_step_result(kind_upgrade_cluster_name, "cluster-claim")), | ||
k8s.corev1.EnvVar(name="KBA_TESTGROUP_TYPE", value="upgrade"), | ||
k8s.corev1.EnvVar(name = "CLAIM_NAME", value = task_step_result(kind_upgrade_cluster_name, "cluster-claim")) | ||
], | ||
], | ||
|
||
resources=k8s.corev1.ResourceRequirements( | ||
requests={ | ||
|
@@ -135,73 +129,63 @@ dindTask("test-aws-install-addons", | |
outputs=[konvoy_artifacts_resource_name], | ||
steps=[ | ||
k8s.corev1.Container( | ||
name="fetch-master", | ||
name="fetch-branches", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
args=["git", "fetch", "origin", "master"]), | ||
args=["git", "fetch", "origin"]), | ||
|
||
k8s.corev1.Container( | ||
name="test-addons", | ||
image="mesosphere/kubeaddons-ci:dispatch@sha256:80a6f3c8775133b4ad2fab3d44ab4fbb4b541dbc03fcdb296b13f67611427d8c", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
command=["/entrypoint.sh", "make", "test-aws"], | ||
|
||
env=[ | ||
k8s.corev1.EnvVar(name="ARTIFACTS_DIR", value="$(resources.outputs.{}.path)".format(konvoy_artifacts_resource_name)), | ||
k8s.corev1.EnvVar(name="DISPATCH_CI", value="true"), | ||
k8s.corev1.EnvVar(name="GOPRIVATE", value="github.com/mesosphere"), | ||
k8s.corev1.EnvVar(name="AWS_REGION", value="us-west-2"), | ||
env=common_env + [ | ||
k8s.corev1.EnvVar(name="ARTIFACTS_DIR", value="$(resources.outputs.{}.path)".format( | ||
konvoy_artifacts_resource_name)), | ||
k8s.corev1.EnvVar(name="KBA_TESTGROUP_TYPE", value="install"), | ||
k8s.corev1.EnvVar(name="AWS_ACCESS_KEY_ID", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_ACCESS_KEY_ID")), | ||
k8s.corev1.EnvVar(name="AWS_SECRET_ACCESS_KEY", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_SECRET_ACCESS_KEY")), | ||
k8s.corev1.EnvVar(name="SSH_KEY_BASE64", valueFrom=secret_var("d2iq-dispatch-git-ssh-base64", "ssh-privatekey-base64")) | ||
], | ||
resources=k8s.corev1.ResourceRequirements( | ||
requests={ | ||
"cpu": k8s.resource_quantity("1000m"), | ||
"memory": k8s.resource_quantity("3Gi")}, | ||
limits={ | ||
"cpu": k8s.resource_quantity("8000m"), | ||
"memory": k8s.resource_quantity("15Gi")} | ||
) | ||
)]) | ||
], | ||
resources=k8s.corev1.ResourceRequirements( | ||
requests={ | ||
"cpu": k8s.resource_quantity("1000m"), | ||
"memory": k8s.resource_quantity("3Gi")}, | ||
limits={ | ||
"cpu": k8s.resource_quantity("8000m"), | ||
"memory": k8s.resource_quantity("15Gi")} | ||
) | ||
)]) | ||
|
||
dindTask("test-aws-upgrade-addons", | ||
inputs=[git_clone_dirname], | ||
outputs=[konvoy_artifacts_upgrade_name], | ||
steps=[ | ||
k8s.corev1.Container( | ||
name="fetch-master", | ||
name="fetch-branches", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
args=["git", "fetch", "origin", "master"]), | ||
args=["git", "fetch", "origin"]), | ||
|
||
k8s.corev1.Container( | ||
name="test-addons", | ||
image="mesosphere/kubeaddons-ci:dispatch@sha256:80a6f3c8775133b4ad2fab3d44ab4fbb4b541dbc03fcdb296b13f67611427d8c", | ||
workingDir="/workspace/{git_clone_dirname}/".format(git_clone_dirname=git_clone_dirname), | ||
command=["/entrypoint.sh", "make", "test-aws"], | ||
|
||
env=[ | ||
k8s.corev1.EnvVar(name="DISPATCH_CI", value="true"), | ||
k8s.corev1.EnvVar(name="GOPRIVATE", value="github.com/mesosphere"), | ||
k8s.corev1.EnvVar(name="AWS_REGION", value="us-west-2"), | ||
env=common_env + [ | ||
k8s.corev1.EnvVar(name="ARTIFACTS_DIR", value="$(resources.outputs.{}.path)".format( | ||
konvoy_artifacts_upgrade_name)), | ||
k8s.corev1.EnvVar(name="KBA_TESTGROUP_TYPE", value="upgrade"), | ||
k8s.corev1.EnvVar(name="AWS_ACCESS_KEY_ID", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_ACCESS_KEY_ID")), | ||
k8s.corev1.EnvVar(name="AWS_SECRET_ACCESS_KEY", valueFrom=secret_var("d2iq-dispatch-aws-creds", "AWS_SECRET_ACCESS_KEY")), | ||
k8s.corev1.EnvVar(name="SSH_KEY_BASE64", valueFrom=secret_var("d2iq-dispatch-git-ssh-base64", "ssh-privatekey-base64")), | ||
k8s.corev1.EnvVar(name="ARTIFACTS_DIR", value="$(resources.outputs.{}.path)".format(konvoy_artifacts_upgrade_name)) | ||
], | ||
], | ||
|
||
resources=k8s.corev1.ResourceRequirements( | ||
requests={ | ||
"cpu": k8s.resource_quantity("1000m"), | ||
"memory": k8s.resource_quantity("3Gi") | ||
}, | ||
limits={ | ||
"cpu": k8s.resource_quantity("8000m"), | ||
"memory": k8s.resource_quantity("15Gi")} | ||
) | ||
}, | ||
limits={ | ||
"cpu": k8s.resource_quantity("8000m"), | ||
"memory": k8s.resource_quantity("15Gi")} | ||
) | ||
|
||
)]) | ||
)]) | ||
|
||
clean_install_kind = cleanup(install_kind_cluster, "test-install", git_clone_dirname) | ||
clean_upgrade_kind = cleanup(upgrade_kind_cluster, "test-upgrade", git_clone_dirname) | ||
|
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
Oops, something went wrong.