DO NOT MERGE: TEST SEPARATION OF BUILD VS INSTALL
Stab in the dark, I have no idea what/if there are any dependencies between build tasks and prior install tasks. Assuming not, the order is preserved,by separating build from install/configure, the ``setup`` AMI-cache state is guaranteed to be uniform, no matter what repos were cloned for the build vs install steps. Maybe. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
61cbf79a0b
commit
cae701e08c
13 changed files with 195 additions and 169 deletions
|
@ -10,70 +10,6 @@
|
|||
msg: "Expected cri-o to be cloned at {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o but it wasn't!"
|
||||
when: not dir_stat.stat.exists
|
||||
|
||||
- name: install cri-o tools
|
||||
make:
|
||||
target: install.tools
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: build cri-o
|
||||
make:
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o
|
||||
make:
|
||||
target: install
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o systemd files
|
||||
make:
|
||||
target: install.systemd
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o config
|
||||
make:
|
||||
target: install.config
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install configs
|
||||
copy:
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
remote_src: yes
|
||||
with_items:
|
||||
- src: contrib/cni/10-crio-bridge.conf
|
||||
dest: /etc/cni/net.d/10-crio-bridge.conf
|
||||
- src: contrib/cni/99-loopback.conf
|
||||
dest: /etc/cni/net.d/99-loopback.conf
|
||||
- src: test/redhat_sigstore.yaml
|
||||
dest: /etc/containers/registries.d/registry.access.redhat.com.yaml
|
||||
|
||||
- name: run with overlay
|
||||
replace:
|
||||
regexp: 'storage_driver = ""'
|
||||
replace: 'storage_driver = "overlay"'
|
||||
name: /etc/crio/crio.conf
|
||||
backup: yes
|
||||
|
||||
- name: run with systemd cgroup manager
|
||||
replace:
|
||||
regexp: 'cgroup_manager = "cgroupfs"'
|
||||
replace: 'cgroup_manager = "systemd"'
|
||||
name: /etc/crio/crio.conf
|
||||
backup: yes
|
||||
|
||||
- name: add docker.io default registry
|
||||
lineinfile:
|
||||
dest: /etc/crio/crio.conf
|
||||
line: '"docker.io"'
|
||||
insertafter: 'registries = \['
|
||||
regexp: 'docker\.io'
|
||||
state: present
|
||||
|
||||
- name: add overlay storage opts on RHEL/CentOS
|
||||
lineinfile:
|
||||
dest: /etc/crio/crio.conf
|
||||
line: '"overlay.override_kernel_check=1"'
|
||||
insertafter: 'storage_option = \['
|
||||
regexp: 'overlay\.override_kernel_check=1'
|
||||
state: present
|
||||
when: ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
|
||||
# TODO: Is this required for building kube, or can it happen after?
|
||||
- name: install etcd
|
||||
command: "hack/install-etcd.sh"
|
||||
args:
|
||||
|
@ -8,50 +9,3 @@
|
|||
- name: build kubernetes
|
||||
make:
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes"
|
||||
|
||||
- name: Add custom cluster service file for the e2e testing
|
||||
copy:
|
||||
dest: /etc/systemd/system/customcluster.service
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
[Service]
|
||||
WorkingDirectory={{ ansible_env.GOPATH }}/src/k8s.io/kubernetes
|
||||
ExecStart=/usr/local/bin/createcluster.sh
|
||||
User=root
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
- name: Add create cluster background script for e2e testing
|
||||
copy:
|
||||
dest: /usr/local/bin/createcluster.sh
|
||||
content: |
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/usr/local/go/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/bin:{{ ansible_env.GOPATH }}/bin:{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/third_party/etcd:{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/local/bin/linux/amd64/
|
||||
export CONTAINER_RUNTIME=remote
|
||||
export CGROUP_DRIVER=systemd
|
||||
export CONTAINER_RUNTIME_ENDPOINT='/var/run/crio.sock --runtime-request-timeout=5m'
|
||||
export ALLOW_SECURITY_CONTEXT=","
|
||||
export ALLOW_PRIVILEGED=1
|
||||
export DNS_SERVER_IP={{ ansible_eth0.ipv4.address }}
|
||||
export API_HOST={{ ansible_eth0.ipv4.address }}
|
||||
export API_HOST_IP={{ ansible_eth0.ipv4.address }}
|
||||
export KUBE_ENABLE_CLUSTER_DNS=true
|
||||
./hack/local-up-cluster.sh
|
||||
mode: "u=rwx,g=rwx,o=x"
|
||||
|
||||
- name: Set kubernetes_provider to be local
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
line: 'KUBERNETES_PROVIDER=local'
|
||||
regexp: 'KUBERNETES_PROVIDER='
|
||||
state: present
|
||||
|
||||
- name: Set KUBECONFIG
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
line: 'KUBECONFIG=/var/run/kubernetes/admin.kubeconfig'
|
||||
regexp: 'KUBECONFIG='
|
||||
state: present
|
||||
|
|
|
@ -5,40 +5,8 @@
|
|||
args:
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins"
|
||||
|
||||
- name: install plugins
|
||||
copy:
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins/bin/{{ item }}"
|
||||
dest: "/opt/cni/bin"
|
||||
mode: "o=rwx,g=rx,o=rx"
|
||||
remote_src: yes
|
||||
with_items:
|
||||
- bridge
|
||||
- dhcp
|
||||
- flannel
|
||||
- host-local
|
||||
- ipvlan
|
||||
- loopback
|
||||
- macvlan
|
||||
- ptp
|
||||
- sample
|
||||
- tuning
|
||||
- vlan
|
||||
|
||||
- name: clone runcom plugins source repo
|
||||
git:
|
||||
repo: "https://github.com/runcom/plugins.git"
|
||||
dest: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins"
|
||||
version: "custom-bridge"
|
||||
force: yes
|
||||
|
||||
- name: build plugins
|
||||
# TODO: Okay to rename this plugins -> custom-bridge-plugins?
|
||||
- name: build custom-bridge-plugins
|
||||
command: "./build.sh"
|
||||
args:
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins"
|
||||
|
||||
- name: install custom bridge
|
||||
copy:
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins/bin/bridge"
|
||||
dest: "/opt/cni/bin/bridge-custom"
|
||||
mode: "o=rwx,g=rx,o=rx"
|
||||
remote_src: yes
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/custom-bridge-plugins"
|
||||
|
|
|
@ -4,14 +4,3 @@
|
|||
make:
|
||||
params: BUILDTAGS="seccomp selinux"
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/opencontainers/runc"
|
||||
|
||||
- name: install runc
|
||||
make:
|
||||
target: "install"
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/opencontainers/runc"
|
||||
|
||||
- name: link runc
|
||||
file:
|
||||
src: /usr/local/sbin/runc
|
||||
dest: /usr/bin/runc
|
||||
state: link
|
||||
|
|
65
contrib/test/integration/install/cri-o.yml
Normal file
65
contrib/test/integration/install/cri-o.yml
Normal file
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
|
||||
- name: install cri-o tools
|
||||
make:
|
||||
target: install.tools
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o
|
||||
make:
|
||||
target: install
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o systemd files
|
||||
make:
|
||||
target: install.systemd
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install cri-o config
|
||||
make:
|
||||
target: install.config
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
||||
- name: install configs
|
||||
copy:
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
remote_src: yes
|
||||
with_items:
|
||||
- src: contrib/cni/10-crio-bridge.conf
|
||||
dest: /etc/cni/net.d/10-crio-bridge.conf
|
||||
- src: contrib/cni/99-loopback.conf
|
||||
dest: /etc/cni/net.d/99-loopback.conf
|
||||
- src: test/redhat_sigstore.yaml
|
||||
dest: /etc/containers/registries.d/registry.access.redhat.com.yaml
|
||||
|
||||
- name: run with overlay
|
||||
replace:
|
||||
regexp: 'storage_driver = ""'
|
||||
replace: 'storage_driver = "overlay"'
|
||||
name: /etc/crio/crio.conf
|
||||
backup: yes
|
||||
|
||||
- name: run with systemd cgroup manager
|
||||
replace:
|
||||
regexp: 'cgroup_manager = "cgroupfs"'
|
||||
replace: 'cgroup_manager = "systemd"'
|
||||
name: /etc/crio/crio.conf
|
||||
backup: yes
|
||||
|
||||
- name: add docker.io default registry
|
||||
lineinfile:
|
||||
dest: /etc/crio/crio.conf
|
||||
line: '"docker.io"'
|
||||
insertafter: 'registries = \['
|
||||
regexp: 'docker\.io'
|
||||
state: present
|
||||
|
||||
- name: add overlay storage opts on RHEL/CentOS
|
||||
lineinfile:
|
||||
dest: /etc/crio/crio.conf
|
||||
line: '"overlay.override_kernel_check=1"'
|
||||
insertafter: 'storage_option = \['
|
||||
regexp: 'overlay\.override_kernel_check=1'
|
||||
state: present
|
||||
when: ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS'
|
48
contrib/test/integration/install/kubernetes.yml
Normal file
48
contrib/test/integration/install/kubernetes.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
---
|
||||
|
||||
- name: Add custom cluster service file for the e2e testing
|
||||
copy:
|
||||
dest: /etc/systemd/system/customcluster.service
|
||||
content: |
|
||||
[Unit]
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
[Service]
|
||||
WorkingDirectory={{ ansible_env.GOPATH }}/src/k8s.io/kubernetes
|
||||
ExecStart=/usr/local/bin/createcluster.sh
|
||||
User=root
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
- name: Add create cluster background script for e2e testing
|
||||
copy:
|
||||
dest: /usr/local/bin/createcluster.sh
|
||||
content: |
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/usr/local/go/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/bin:{{ ansible_env.GOPATH }}/bin:{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/third_party/etcd:{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/local/bin/linux/amd64/
|
||||
export CONTAINER_RUNTIME=remote
|
||||
export CGROUP_DRIVER=systemd
|
||||
export CONTAINER_RUNTIME_ENDPOINT='/var/run/crio.sock --runtime-request-timeout=5m'
|
||||
export ALLOW_SECURITY_CONTEXT=","
|
||||
export ALLOW_PRIVILEGED=1
|
||||
export DNS_SERVER_IP={{ ansible_eth0.ipv4.address }}
|
||||
export API_HOST={{ ansible_eth0.ipv4.address }}
|
||||
export API_HOST_IP={{ ansible_eth0.ipv4.address }}
|
||||
export KUBE_ENABLE_CLUSTER_DNS=true
|
||||
./hack/local-up-cluster.sh
|
||||
mode: "u=rwx,g=rwx,o=x"
|
||||
|
||||
- name: Set kubernetes_provider to be local
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
line: 'KUBERNETES_PROVIDER=local'
|
||||
regexp: 'KUBERNETES_PROVIDER='
|
||||
state: present
|
||||
|
||||
- name: Set KUBECONFIG
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
line: 'KUBECONFIG=/var/run/kubernetes/admin.kubeconfig'
|
||||
regexp: 'KUBECONFIG='
|
||||
state: present
|
28
contrib/test/integration/install/plugins.yml
Normal file
28
contrib/test/integration/install/plugins.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
|
||||
- name: install plugins
|
||||
copy:
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins/bin/{{ item }}"
|
||||
dest: "/opt/cni/bin"
|
||||
mode: "o=rwx,g=rx,o=rx"
|
||||
remote_src: yes
|
||||
with_items:
|
||||
- bridge
|
||||
- dhcp
|
||||
- flannel
|
||||
- host-local
|
||||
- ipvlan
|
||||
- loopback
|
||||
- macvlan
|
||||
- ptp
|
||||
- sample
|
||||
- tuning
|
||||
- vlan
|
||||
|
||||
- name: install custom bridge
|
||||
copy:
|
||||
# TODO: Okay to rename this plugins -> custom-bridge-plugins?
|
||||
src: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/custom-bridge-plugins/bin/bridge"
|
||||
dest: "/opt/cni/bin/bridge-custom"
|
||||
mode: "o=rwx,g=rx,o=rx"
|
||||
remote_src: yes
|
12
contrib/test/integration/install/runc.yml
Normal file
12
contrib/test/integration/install/runc.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
|
||||
- name: install runc
|
||||
make:
|
||||
target: "install"
|
||||
chdir: "{{ ansible_env.GOPATH }}/src/github.com/opencontainers/runc"
|
||||
|
||||
- name: link runc
|
||||
file:
|
||||
src: /usr/local/sbin/runc
|
||||
dest: /usr/bin/runc
|
||||
state: link
|
|
@ -17,21 +17,17 @@
|
|||
always_force: False
|
||||
|
||||
post_tasks:
|
||||
- name: clone build and install bats
|
||||
include: "build/bats.yml"
|
||||
|
||||
- name: clone build and install cri-tools
|
||||
include: "build/cri-tools.yml"
|
||||
|
||||
- name: clone build and install kubernetes
|
||||
- name: Install ETCD and Build Kubernetes
|
||||
include: "build/kubernetes.yml"
|
||||
|
||||
- name: clone build and install runc
|
||||
- name: Build runc
|
||||
include: "build/runc.yml"
|
||||
|
||||
- name: clone build and install networking plugins
|
||||
- name: Build networking plugins
|
||||
include: "build/plugins.yml"
|
||||
|
||||
|
||||
- hosts: all
|
||||
remote_user: root
|
||||
vars_files:
|
||||
|
@ -45,9 +41,37 @@
|
|||
always_force: True
|
||||
|
||||
post_tasks:
|
||||
- name: clone build and install cri-o
|
||||
- name: Install BATS
|
||||
include: "install/bats.yml"
|
||||
|
||||
- name: Install cri-tools
|
||||
include: "install/cri-tools.yml"
|
||||
|
||||
- name: Re-Install ETCD and Re-Build Kubernetes
|
||||
include: "build/kubernetes.yml"
|
||||
|
||||
- name: Re-Install kubernetes
|
||||
include: "install/kubernetes.yml"
|
||||
|
||||
- name: Build runc
|
||||
include: "build/runc.yml"
|
||||
|
||||
- name: install runc
|
||||
include: "install/runc.yml"
|
||||
|
||||
- name: Build networking plugins
|
||||
include: "build/plugins.yml"
|
||||
|
||||
- name: Install networking plugins
|
||||
include: "install/plugins.yml"
|
||||
|
||||
- name: Build CRI-O
|
||||
include: "build/cri-o.yml"
|
||||
|
||||
- name: Install CRI-O
|
||||
include: "install/cri-o.yml"
|
||||
|
||||
|
||||
- hosts: all
|
||||
remote_user: root
|
||||
vars_files:
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone build and install cri-tools
|
||||
include: "build/cri-tools.yml"
|
||||
|
||||
- name: Make testing output verbose so it can be converted to xunit
|
||||
lineinfile:
|
||||
dest: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/hack/make-rules/test.sh"
|
||||
|
|
|
@ -18,6 +18,11 @@ git_operations:
|
|||
dest: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/plugins"
|
||||
version: "dcf7368eeab15e2affc6256f0bb1e84dd46a34de"
|
||||
|
||||
# TODO: Okay to rename this plugins -> custom-bridge-plugins and drop force: yes?
|
||||
- repo: "https://github.com/runcom/plugins.git"
|
||||
dest: "{{ ansible_env.GOPATH }}/src/github.com/containernetworking/custom-bridge-plugins"
|
||||
version: "custom-bridge"
|
||||
|
||||
- repo: "https://github.com/opencontainers/runc.git"
|
||||
dest: "{{ ansible_env.GOPATH }}/src/github.com/opencontainers/runc"
|
||||
version: "84a082bfef6f932de921437815355186db37aeb1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue