Skip to content

Commit 9efe951

Browse files
authored
Merge pull request #29907 from justinsb/boskos_in_aws_jobs
kops tests: support passing --boskos-resource-type flag
2 parents 4ef0557 + 46d2956 commit 9efe951

File tree

6 files changed

+87
-4
lines changed

6 files changed

+87
-4
lines changed

config/jobs/kubernetes/kops/build_jobs.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ def presubmit_test(branch='master',
273273
kops_ssh_user = 'prow'
274274
kops_ssh_key_path = '/etc/ssh-key-secret/ssh-private'
275275

276+
boskos_resource_type = None
277+
if use_boskos:
278+
if cloud == 'aws':
279+
boskos_resource_type = 'aws-account'
280+
else:
281+
raise Exception(f"use_boskos not supported on cloud {cloud}")
282+
276283
if extra_flags is None:
277284
extra_flags = []
278285

@@ -326,7 +333,7 @@ def presubmit_test(branch='master',
326333
artifacts=artifacts,
327334
env=env,
328335
template_path=template_path,
329-
use_boskos=use_boskos,
336+
boskos_resource_type=boskos_resource_type,
330337
)
331338

332339
spec = {
@@ -1614,6 +1621,11 @@ def generate_presubmits_e2e():
16141621
always_run=False,
16151622
use_boskos=True,
16161623
),
1624+
presubmit_test(
1625+
name='presubmit-kops-aws-boskos-kubetest2',
1626+
always_run=False,
1627+
use_boskos=True,
1628+
),
16171629
]
16181630

16191631
return jobs

config/jobs/kubernetes/kops/kops-presubmits-e2e.yaml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Test jobs generated by build_jobs.py (do not manually edit)
2-
# 39 jobs
2+
# 40 jobs
33
presubmits:
44
kubernetes/kops:
55

@@ -2490,3 +2490,67 @@ presubmits:
24902490
testgrid-dashboards: kops-presubmits, presubmits-kops, sig-cluster-lifecycle-kops
24912491
testgrid-days-of-results: '90'
24922492
testgrid-tab-name: presubmit-kops-aws-boskos
2493+
2494+
# {"cloud": "aws", "distro": "u2204", "extra_flags": "--discovery-store=s3://k8s-kops-prow/discovery", "k8s_version": "stable", "kops_channel": "alpha", "networking": "cilium"}
2495+
- name: presubmit-kops-aws-boskos-kubetest2
2496+
branches:
2497+
- master
2498+
always_run: false
2499+
optional: false
2500+
skip_report: false
2501+
labels:
2502+
preset-service-account: "true"
2503+
preset-aws-ssh: "true"
2504+
preset-dind-enabled: "true"
2505+
decorate: true
2506+
decoration_config:
2507+
timeout: 90m
2508+
path_alias: k8s.io/kops
2509+
spec:
2510+
containers:
2511+
- image: gcr.io/k8s-staging-test-infra/kubekins-e2e:v20230616-e730b60769-master
2512+
imagePullPolicy: Always
2513+
command:
2514+
- runner.sh
2515+
args:
2516+
- bash
2517+
- -c
2518+
- |
2519+
make test-e2e-install
2520+
kubetest2 kops \
2521+
-v 2 \
2522+
--up --build --down \
2523+
--cloud-provider=aws \
2524+
--create-args="--image='099720109477/ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230608' --channel=alpha --networking=cilium --discovery-store=s3://k8s-kops-prow/discovery" \
2525+
--boskos-resource-type=aws-account \
2526+
--kubernetes-version=https://dl.k8s.io/release/stable.txt \
2527+
--kops-binary-path=/home/prow/go/src/k8s.io/kops/.build/dist/linux/amd64/kops \
2528+
--test=kops \
2529+
-- \
2530+
--ginkgo-args="--debug" \
2531+
--test-args="-test.timeout=60m -num-nodes=0" \
2532+
--test-package-marker=stable.txt \
2533+
--parallel=25
2534+
securityContext:
2535+
privileged: true
2536+
env:
2537+
- name: KUBE_SSH_KEY_PATH
2538+
value: /etc/aws-ssh/aws-ssh-private
2539+
- name: KUBE_SSH_USER
2540+
value: ubuntu
2541+
- name: GOPATH
2542+
value: /home/prow/go
2543+
resources:
2544+
requests:
2545+
cpu: "2"
2546+
memory: "6Gi"
2547+
annotations:
2548+
test.kops.k8s.io/cloud: aws
2549+
test.kops.k8s.io/distro: u2204
2550+
test.kops.k8s.io/extra_flags: --discovery-store=s3://k8s-kops-prow/discovery
2551+
test.kops.k8s.io/k8s_version: stable
2552+
test.kops.k8s.io/kops_channel: alpha
2553+
test.kops.k8s.io/networking: cilium
2554+
testgrid-dashboards: kops-presubmits, presubmits-kops, sig-cluster-lifecycle-kops
2555+
testgrid-days-of-results: '90'
2556+
testgrid-tab-name: presubmit-kops-aws-boskos-kubetest2

config/jobs/kubernetes/kops/templates/periodic-scenario.yaml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
labels:
55
preset-service-account: "true"
66
preset-aws-ssh: "true"
7+
{%- if not boskos_resource_type %}
78
preset-aws-credential: "true"
9+
{%- endif %}
810
preset-dind-enabled: "true"
911
max_concurrency: 1
1012
decorate: true

config/jobs/kubernetes/kops/templates/periodic.yaml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
{%- if cloud == "aws" %}
66
preset-service-account: "true"
77
preset-aws-ssh: "true"
8+
{%- if not boskos_resource_type %}
89
preset-aws-credential: "true"
10+
{%- endif %}
911
{%- else %}
1012
preset-k8s-ssh: "true"
1113
{%- endif %}

config/jobs/kubernetes/kops/templates/presubmit-scenario.yaml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
labels:
1212
preset-service-account: "true"
1313
preset-aws-ssh: "true"
14-
{%- if not use_boskos %}
14+
{%- if not boskos_resource_type %}
1515
preset-aws-credential: "true"
1616
{%- endif %}
1717
preset-dind-enabled: "true"

config/jobs/kubernetes/kops/templates/presubmit.yaml.jinja

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{%- if cloud == "aws" %}
1313
preset-service-account: "true"
1414
preset-aws-ssh: "true"
15-
{%- if not use_boskos %}
15+
{%- if not boskos_resource_type %}
1616
preset-aws-credential: "true"
1717
{%- endif %}
1818
{%- if branch in ["release-1.22", "release-1.23"] %}
@@ -49,6 +49,9 @@
4949
{%- if kops_feature_flags %}
5050
--env=KOPS_FEATURE_FLAGS={{kops_feature_flags}} \
5151
{%- endif %}
52+
{%- if boskos_resource_type %}
53+
--boskos-resource-type={{boskos_resource_type}} \
54+
{%- endif %}
5255
--kubernetes-version={{k8s_deploy_url}} \
5356
{%- if branch in ["release-1.22", "release-1.23"] %}
5457
--kops-binary-path=/home/prow/go/src/k8s.io/kops/bazel-bin/cmd/kops/linux-amd64/kops \

0 commit comments

Comments
 (0)