Skip to content

Commit

Permalink
Add jenkins job for Windows OVS containerization
Browse files Browse the repository at this point in the history
Signed-off-by: Naman Agarwal <naman.agarwal75@gmail.com>
  • Loading branch information
NamanAg30 committed Oct 19, 2023
1 parent ae5e29b commit da6f50d
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 6 deletions.
170 changes: 170 additions & 0 deletions ci/jenkins/jobs/projects-lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,63 @@
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-for-pull-request':
test_name: windows-containerd-conformance-ovs
node: 'antrea-windows-containerd-testbed'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-win-containerd:
conformance_type: 'conformance'
win_image_node: '{antrea_win_image_node_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-windows-(containerd-conformance-ovs|all).*
white_list_target_branches: [ ]
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
throttle_concurrent_builds_category:
- e2e-lock-per-testbed
throttle_concurrent_builds_enabled: 'true'
status_context: jenkins-windows-containerd-conformance-ovs
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-windows-containerd-conformance-ovs to re-trigger.
error_status: Failed. Add comment /test-windows-containerd-conformance-ovs to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 120
type: absolute
- credentials-binding:
- text:
credential-id: GOVC_URL
variable: GOVC_URL
- text:
credential-id: GOVC_USERNAME
variable: GOVC_USERNAME
- text:
credential-id: GOVC_PASSWORD
variable: GOVC_PASSWORD
- text:
credential-id: GOVC_DATACENTER
variable: GOVC_DATACENTER
- text:
credential-id: GOVC_DATASTORE
variable: GOVC_DATASTORE
publishers:
- archive:
allow-empty: true
artifacts: 'windows_conformance_result_no_color.txt,network_info.tar.gz,antrea_agent_log.tar.gz,debug_logs.tar.gz'
case-sensitive: true
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-no-scm':
test_name: windows-containerd-networkpolicy-pending-label
node: null
Expand Down Expand Up @@ -1010,6 +1067,63 @@
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-for-pull-request':
test_name: windows-containerd-networkpolicy-ovs
node: 'antrea-windows-containerd-testbed'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-conformance-win-containerd:
conformance_type: 'networkpolicy'
win_image_node: '{antrea_win_image_node_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-windows-(containerd-networkpolicy-ovs|all).*
white_list_target_branches: [ ]
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
throttle_concurrent_builds_category:
- e2e-lock-per-testbed
throttle_concurrent_builds_enabled: 'true'
status_context: jenkins-windows-containerd-networkpolicy-ovs
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-windows-containerd-networkpolicy-ovs to re-trigger.
error_status: Failed. Add comment /test-windows-containerd-networkpolicy-ovs to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 135
type: absolute
- credentials-binding:
- text:
credential-id: GOVC_URL
variable: GOVC_URL
- text:
credential-id: GOVC_USERNAME
variable: GOVC_USERNAME
- text:
credential-id: GOVC_PASSWORD
variable: GOVC_PASSWORD
- text:
credential-id: GOVC_DATACENTER
variable: GOVC_DATACENTER
- text:
credential-id: GOVC_DATASTORE
variable: GOVC_DATASTORE
publishers:
- archive:
allow-empty: true
artifacts: 'windows_conformance_result_no_color.txt,network_info.tar.gz,antrea_agent_log.tar.gz,debug_logs.tar.gz'
case-sensitive: true
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-no-scm':
test_name: windows-containerd-e2e-pending-label
node: null
Expand Down Expand Up @@ -1091,6 +1205,62 @@
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-for-pull-request':
test_name: windows-containerd-e2e-ovs
node: 'antrea-windows-containerd-testbed'
description: 'This is the {test_name} test for {name}.'
branches:
- ${{sha1}}
builders:
- builder-e2e-win-containerd:
win_image_node: '{antrea_win_image_node_name}'
trigger_phrase: ^(?!Thanks for your PR).*/test-windows-(containerd-e2e-ovs|all).*
white_list_target_branches: [ ]
allow_whitelist_orgs_as_admins: true
admin_list: '{antrea_admin_list}'
org_list: '{antrea_org_list}'
white_list: '{antrea_white_list}'
only_trigger_phrase: true
trigger_permit_all: true
throttle_concurrent_builds_category:
- e2e-lock-per-testbed
throttle_concurrent_builds_enabled: 'true'
status_context: jenkins-windows-containerd-e2e
status_url: --none--
success_status: Build finished.
failure_status: Failed. Add comment /test-windows-containerd-e2e-ovs to re-trigger.
error_status: Failed. Add comment /test-windows-containerda-e2e-ovs to re-trigger.
triggered_status: null
started_status: null
wrappers:
- timeout:
fail: true
timeout: 120
type: absolute
- credentials-binding:
- text:
credential-id: GOVC_URL
variable: GOVC_URL
- text:
credential-id: GOVC_USERNAME
variable: GOVC_USERNAME
- text:
credential-id: GOVC_PASSWORD
variable: GOVC_PASSWORD
- text:
credential-id: GOVC_DATACENTER
variable: GOVC_DATACENTER
- text:
credential-id: GOVC_DATASTORE
variable: GOVC_DATASTORE
publishers:
- archive:
allow-empty: true
artifacts: antrea-test-logs.tar.gz
case-sensitive: true
default-excludes: true
fingerprint: false
only-if-success: false
- '{name}-{test_name}-for-pull-request':
test_name: kind-conformance
node: 'antrea-kind-testbed'
Expand Down
20 changes: 14 additions & 6 deletions ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,12 @@ function prepare_env {
function revert_snapshot_windows {
WIN_NAME=$1
echo "==== Reverting Windows VM ${WIN_NAME} ====="
govc snapshot.revert -vm ${WIN_NAME} win-initial
# If Windows VM fails to power on correctly in time, retry several times.
if [[ ${TESTCASE} =~ "containerd-ovs" ]]; then
govc snapshot.revert -vm ${WIN_NAME} pristine-win-initial
else
govc snapshot.revert -vm ${WIN_NAME} win-initial
fi

winVMIPs=""
for i in `seq 10`; do
winVMIPs=$(govc vm.ip -wait=2m -a ${WIN_NAME})
Expand Down Expand Up @@ -516,7 +520,7 @@ function build_and_deliver_antrea_windows_and_linux_docker_images {
function build_and_deliver_antrea_windows_and_linux_containerd_images {
echo "====== Cleanup Antrea Installation Before Delivering Antrea Windows and Antrea Linux containerd Images ====="
clean_antrea
kubectl delete -f ${WORKDIR}/antrea-windows-containerd.yml --ignore-not-found=true || true
kubectl delete -f ${WORKDIR}/antrea-${WINDOWS_YAML_SUFFIX}.yml --ignore-not-found=true || true
kubectl delete -f ${WORKDIR}/kube-proxy-windows-containerd.yml --ignore-not-found=true || true
kubectl delete daemonset antrea-agent -n kube-system --ignore-not-found=true || true
kubectl delete -f ${WORKDIR}/antrea.yml --ignore-not-found=true || true
Expand All @@ -531,11 +535,11 @@ function build_and_deliver_antrea_windows_and_linux_containerd_images {
${PRINT_DOCKER_STATUS}
export_govc_env_var
# Enable verbose log for troubleshooting.
sed -i "s/--v=0/--v=4/g" build/yamls/antrea.yml build/yamls/antrea-windows-containerd.yml
sed -i "s/--v=0/--v=4/g" build/yamls/antrea.yml build/yamls/antrea-${WINDOWS_YAML_SUFFIX}.yml

echo "====== Updating yaml files to enable proxyAll ======"
KUBE_API_SERVER=$(kubectl --kubeconfig=$KubeConfigFile config view -o jsonpath='{.clusters[0].cluster.server}')
sed -i "s|.*kubeAPIServerOverride: \"\"| kubeAPIServerOverride: \"${KUBE_API_SERVER}\"|g" build/yamls/antrea.yml build/yamls/antrea-windows-containerd.yml
sed -i "s|.*kubeAPIServerOverride: \"\"| kubeAPIServerOverride: \"${KUBE_API_SERVER}\"|g" build/yamls/antrea.yml build/yamls/antrea-${WINDOWS_YAML_SUFFIX}.yml

cp -f build/yamls/*.yml $WORKDIR
set +e
Expand Down Expand Up @@ -1147,8 +1151,12 @@ fi

trap clean_antrea EXIT
if [[ ${TESTCASE} =~ "windows" ]]; then
if [[ ${TESTCASE} =~ "containerd" ]]; then
if [[ ${TESTCASE} =~ "containerd-ovs" ]]; then
WINDOWS_YAML_SUFFIX="windows-containerd-ovs"
elif [[ ${TESTCASE} =~ "containerd" ]]; then
WINDOWS_YAML_SUFFIX="windows-containerd"
fi
if [[ ${TESTCASE} =~ "containerd" ]]; then
build_and_deliver_antrea_windows_and_linux_containerd_images
if [[ ${TESTCASE} =~ "e2e" ]]; then
run_e2e_windows
Expand Down

0 comments on commit da6f50d

Please sign in to comment.