Skip to content

Commit b2a72cb

Browse files
committed
migrates tests to run on GCP
Signed-off-by: Skyler Clark <[email protected]>
1 parent eb558b8 commit b2a72cb

File tree

14 files changed

+67
-72
lines changed

14 files changed

+67
-72
lines changed

contrib/test/ci/build/cri-o.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
- name: check if cri-o.tar.gz exists
1010
stat:
11-
path: /root/cri-o.tar.gz
11+
path: "/home/deadbeef/cri-o.tar.gz"
1212
register: source_tar
1313

1414
- name: extract cri-o
1515
unarchive:
16-
src: /root/cri-o.tar.gz
16+
src: "/home/deadbeef/cri-o.tar.gz"
1717
dest: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
1818
when: source_tar.stat.exists
1919

@@ -24,21 +24,10 @@
2424

2525
- name: copy vagrant source
2626
synchronize:
27-
dest: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
27+
dest: "/home/deadbeef/src/github.com/cri-o/cri-o"
2828
src: /vagrant/
2929
when: (vagrant_dir.stat.isdir is defined) and (vagrant_dir.stat.isdir)
3030

31-
- name: extract cri-o
32-
unarchive:
33-
src: /root/cri-o.tar.gz
34-
dest: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
35-
when: source_tar.stat.exists
36-
37-
- name: stat the expected cri-o directory
38-
stat:
39-
path: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
40-
register: dir_stat
41-
4231
## Check for python executable
4332

4433
- name: see if the python executable or symlink is available
@@ -57,11 +46,6 @@
5746
command:
5847
cmd: git config --global --add safe.directory "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
5948

60-
- name: expect cri-o to be cloned already
61-
fail:
62-
msg: "Expected cri-o to be cloned at {{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o but it wasn't!"
63-
when: not dir_stat.stat.exists
64-
6549
- name: build cri-o
6650
make:
6751
chdir: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"
@@ -98,6 +82,7 @@
9882
[crio.runtime]
9983
default_runtime = "crun"
10084
[crio.runtime.runtimes.crun]
85+
runtime_root = "/run/crun"
10186
when: "build_crun | default(False) | bool"
10287

10388
- name: use kata

contrib/test/ci/build/crun.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -51,44 +51,3 @@
5151
make:
5252
target: "install"
5353
chdir: "{{ ansible_env.GOPATH }}/src/github.com/containers/crun"
54-
55-
- name: remove old runc binary
56-
file:
57-
path: /usr/bin/runc
58-
state: absent
59-
60-
- name: remove old runc binary under /usr/local/bin
61-
file:
62-
path: /usr/local/bin/runc
63-
state: absent
64-
65-
- name: remove old runc binary under /usr/local/sbin
66-
file:
67-
path: /usr/local/sbin/runc
68-
state: absent
69-
70-
- name: crun state directory
71-
file:
72-
path: /run/crun
73-
state: directory
74-
75-
- name: crun state directory
76-
file:
77-
src: /run/crun
78-
dest: /run/runc
79-
state: link
80-
force: yes
81-
82-
- name: link crun
83-
file:
84-
src: /usr/local/bin/crun
85-
dest: /usr/bin/runc
86-
state: link
87-
force: yes
88-
89-
- name: link crun to /usr/local/bin
90-
file:
91-
src: /usr/local/bin/crun
92-
dest: /usr/local/bin/runc
93-
state: link
94-
force: yes

contrib/test/ci/build/kubernetes.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
version: "{{ k8s_git_version }}"
99
force: "{{ force_clone | default(False) | bool}}"
1010

11+
#TODO this replaces all github downloads for etcd and replaces them with the same version
12+
- name: set etcd url
13+
ansible.builtin.replace:
14+
path: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/hack/lib/etcd.sh"
15+
regexp: "^.*https://github.com.*$"
16+
replace: "url=\"https://storage.googleapis.com/crio-ci/etcd-v${ETCD_VERSION}.tar.gz\""
17+
1118
- name: install etcd
1219
command: "hack/install-etcd.sh"
1320
args:
@@ -17,12 +24,17 @@
1724
make:
1825
chdir: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes"
1926
target: clean
27+
async: '{{ 60 * 60 * 4 }}'
28+
poll: 60
2029

2130
- name: build kubernetes
2231
make:
2332
chdir: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes"
33+
async: '{{ 60 * 60 * 4 }}'
34+
poll: 60
2435

2536
- name: Add custom cluster service file for the e2e testing
37+
become: yes
2638
copy:
2739
dest: /etc/systemd/system/customcluster.service
2840
content: |
@@ -38,6 +50,7 @@
3850
WantedBy=multi-user.target
3951
4052
- name: Add create cluster background script for e2e testing
53+
become: yes
4154
copy:
4255
dest: /usr/local/bin/createcluster.sh
4356
content: |
@@ -69,6 +82,7 @@
6982
mode: "u=rwx,g=rwx,o=x"
7083

7184
- name: Set kubernetes_provider to be local
85+
become: yes
7286
lineinfile:
7387
dest: /etc/environment
7488
line: |
@@ -78,12 +92,14 @@
7892
state: present
7993

8094
- name: install kubectl (for kubetest)
95+
become: yes
8196
copy:
8297
src: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/bin/kubectl"
8398
dest: "{{ ansible_env.GOPATH }}/bin/kubectl"
8499
mode: "preserve"
85100

86101
- name: copy kubectl (for e2e tests)
102+
become: yes
87103
copy:
88104
src: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/bin/kubectl"
89105
dest: "/usr/bin/kubectl"

contrib/test/ci/build/kubetest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# neither are happening in hack/e2e.go. instead, add this, and set --get=false when
1212
# running e2e
1313
- name: build kubetest
14+
become: yes
1415
shell: GOPROXY=https://proxy.golang.org GOSUMDB=sum.golang.org GO111MODULE=on go install ./kubetest
1516
args:
1617
chdir: "{{ ansible_env.GOPATH }}/src/k8s.io/test-infra"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
defaultTestContainerImage: "quay.io/promethius/busybox:latest"
2+
webServerTestImage: "quay.io/jitesoft/nginx"

contrib/test/ci/critest-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- hosts: localhost, all
3-
remote_user: root
3+
become: yes
44
environment:
55
GOPATH: /usr/go
66
connection: local

contrib/test/ci/critest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
webServerTestImage: {{ critest_mirror_repo }}/nginx:1.18
4545
4646
- name: run critest validation
47+
become: yes
4748
shell: "critest --report-dir={{ artifacts }} --runtime-endpoint unix:///var/run/crio/crio.sock --image-endpoint unix:///var/run/crio/crio.sock --ginkgo.flakeAttempts=3 --test-images-file=critest-images.yml"
4849
args:
4950
chdir: "{{ ansible_env.GOPATH }}/src/github.com/cri-o/cri-o"

contrib/test/ci/e2e-base.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
# only fixup paths for e2e tests which expect to be able to pass 'test-handler' as the runtime handler
33
- name: add test-handler runtime handler for Runtimes test
4+
become: yes
45
blockinfile:
56
path: /etc/crio/crio.conf
67
insertbefore: .*crio.runtime.runtimes.runc.*
@@ -23,13 +24,15 @@
2324
key: "{{ lookup('file', ssh_location + '.pub') }} "
2425

2526
- name: enable and start CRI-O
27+
become: yes
2628
systemd:
2729
name: crio
2830
state: started
2931
enabled: yes
3032
daemon_reload: yes
3133

3234
- name: update the server address for the custom cluster
35+
become: yes
3336
lineinfile:
3437
dest: /usr/local/bin/createcluster.sh
3538
line: |
@@ -43,6 +46,7 @@
4346
- API_HOST_IP
4447

4548
- name: enable and start the custom cluster
49+
become: yes
4650
systemd:
4751
name: customcluster.service
4852
state: started
@@ -51,6 +55,7 @@
5155

5256
- name: wait for the cluster to be running
5357
# ref: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
58+
become: yes
5459
ansible.builtin.shell:
5560
cmd: /usr/bin/kubectl get nodes -o jsonpath='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' | grep 'Ready=True'
5661
environment:
@@ -72,9 +77,11 @@
7277
when: ansible_distribution in ['RedHat']
7378

7479
- name: load br_netfilter module
80+
become: yes
7581
command: modprobe br_netfilter
7682

7783
- name: Enable iptables NAT for the bridge
84+
become: yes
7885
sysctl:
7986
name: net.bridge.bridge-nf-call-iptables
8087
value: 1

contrib/test/ci/e2e-main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- hosts: localhost, all
3-
remote_user: root
3+
become: yes
44
environment:
55
GOPATH: /usr/go
66
connection: local
@@ -13,6 +13,7 @@
1313
include: "setup.yml"
1414

1515
- hosts: localhost, all
16+
become: yes
1617
remote_user: root
1718
vars_files:
1819
- "{{ playbook_dir }}/vars.yml"
@@ -39,6 +40,7 @@
3940

4041

4142
- hosts: localhost, all
43+
become: yes
4244
remote_user: root
4345
vars_files:
4446
- "{{ playbook_dir }}/vars.yml"

contrib/test/ci/e2e.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
- name: include base e2e setup
44
include: "e2e-base.yml"
55

6-
- name: Increase inotify user watches
7-
sysctl:
8-
name: fs.inotify.max_user_watches
9-
state: present
10-
value: 1048576
11-
126
- name: Buffer the e2e testing command to workaround Ansible YAML folding "feature"
7+
become: yes
138
vars:
149
skip_tests:
1510
- "[Slow]"
@@ -23,6 +18,9 @@
2318
- "PersistentVolumes-local"
2419
- "CSI Volumes [Driver: csi-hostpath] [Testpattern: Dynamic PV (block volmode)] provisioning should provision storage with pvc data source"
2520
- "CSI Volumes [Driver: csi-hostpath] [Testpattern: Dynamic PV (block volmode)] volumes should store data"
21+
- "[sig-apps] StatefulSet Basic StatefulSet functionality [StatefulSetBasic] should provide basic identity"
22+
- "[sig-apps] StatefulSet Basic StatefulSet functionality [StatefulSetBasic] should not deadlock when a pod's predecessor fails"
23+
- "[sig-apps] StatefulSet Basic StatefulSet functionality [StatefulSetBasic] should adopt matching orphans and release non-matching pods"
2624
# Started failing at https://github.com/kubernetes/kubernetes/pull/98587, and tests something out of the scope of CRI-O
2725
- "ServiceAccountIssuerDiscovery should support OIDC discovery of service account issuer"
2826
# While fully conformant kubernetes clusters require more than 2 nodes, verifying that CRI-O
@@ -43,8 +41,6 @@
4341
4442
- name: run e2e tests
4543
shell: "{{ e2e_shell_cmd | regex_replace('\\s+', ' ') }}"
46-
environment:
47-
KUBECONFIG: /var/run/kubernetes/admin.kubeconfig
4844
args:
4945
chdir: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes"
5046
async: '{{ 60 * 60 * 4 }}' # seconds

0 commit comments

Comments
 (0)