Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OVN IC CI #55

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ jobs:
lighthouse: lighthouse
- extra-toggles: air-gap
ovn: ovn
- extra-toggles: air-gap
ovn: ovn-ic
- extra-toggles: dual-stack
- extra-toggles: ovn
- extra-toggles: ovn-ic
- deploytool: operator
extra-toggles: lighthouse
- deploytool: helm
Expand All @@ -132,7 +135,7 @@ jobs:
- extra-toggles: prometheus
steps:
- name: Reclaim space on GHA host (if the job needs it)
if: ${{ matrix.ovn != '' }}
if: ${{ matrix.ovn != '' }} || ${{ matrix.ovn-ic != '' }}
run: rm -rf /usr/share/dotnet

- name: Check out the repository
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ ifneq (,$(DAPPER_HOST_ARCH))

# Running in Dapper

ifneq (,$(filter ovn,$(USING)))
ifneq (,$(filter ovn%,$(USING)))
SETTINGS ?= $(DAPPER_SOURCE)/.shipyard.e2e.ovn.yml
else
SETTINGS ?= $(DAPPER_SOURCE)/.shipyard.e2e.yml
endif

ifneq (,$(filter ovn-ic,$(USING)))
export OVN_IC = true
endif

export LAZY_DEPLOY = false

scale: SETTINGS = $(DAPPER_SOURCE)/.shipyard.scale.yml
Expand Down
1 change: 1 addition & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ override PRELOAD_IMAGES += submariner-globalnet
endif
ifneq (,$(shell grep -w ovn $(SETTINGS)))
override PRELOAD_IMAGES += submariner-networkplugin-syncer
# TODO Peload OVN IC image for air-gapped
endif
ifeq ($(LIGHTHOUSE),true)
override PRELOAD_IMAGES += lighthouse-agent lighthouse-coredns
Expand Down
50 changes: 41 additions & 9 deletions scripts/shared/lib/clusters_kind
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,13 @@ EOF
}

function deploy_kind_ovn(){
local OVN_SRC_IMAGE="ghcr.io/ovn-org/ovn-kubernetes/ovn-kube-f:master"
export K8s_VERSION="${K8S_VERSION}"
export NET_CIDR_IPV4="${cluster_CIDRs[${cluster}]}"
export SVC_CIDR_IPV4="${service_CIDRs[${cluster}]}"
export KIND_CLUSTER_NAME="${cluster}"

export OVN_IMAGE="localhost:5000/ovn-daemonset-f:latest"
docker pull "${OVN_SRC_IMAGE}"
docker tag "${OVN_SRC_IMAGE}" "${OVN_IMAGE}"
docker push "${OVN_IMAGE}"

delete_cluster_on_fail ./ovn-kubernetes/contrib/kind.sh -ov "$OVN_IMAGE" -cn "${KIND_CLUSTER_NAME}" -ric -lr -dd "${KIND_CLUSTER_NAME}.local"
[[ "$OVN_IC" = true ]] && delete_cluster_on_fail ./ovn-kubernetes/contrib/kind.sh -ov "$OVN_IMAGE" -cn "${KIND_CLUSTER_NAME}" -ric -ic -npz 1 -wk 3 -lr -dd "${KIND_CLUSTER_NAME}.local"
[[ "$OVN_IC" != true ]] && delete_cluster_on_fail ./ovn-kubernetes/contrib/kind.sh -ov "$OVN_IMAGE" -cn "${KIND_CLUSTER_NAME}" -ric -lr -dd "${KIND_CLUSTER_NAME}.local"

[[ "$AIR_GAPPED" = true ]] && air_gap_iptables
}
Expand All @@ -229,6 +224,7 @@ function run_local_registry() {
for image in "${local_image_list[@]}"; do
docker push "${image}" || echo "Failed to push ${image@Q} to registry."
done
return 0 # Avoid returning non-zero if there are no local images
fi
}

Expand All @@ -247,7 +243,7 @@ function provider_failed() {
# ovn-kubernetes repo from master in order to access the required
# kind scripts, and manifest generation templates.
function download_ovnk() {
echo "Cloning ovn-kubernetes from source"
echo "Cloning ovn-kubernetes source"
mkdir -p ovn-kubernetes
# We only need the contrib directory, use a sparse checkout
(
Expand All @@ -264,11 +260,47 @@ function download_ovnk() {
)
}

function prepare_ovn_ic() {
echo "Building ovn-kubernetes with interconnect (OVN-IC) from source"
rm -rf ovn-kubernetes || true
git clone https://github.com/ovn-org/ovn-kubernetes
pushd ovn-kubernetes || exit

pushd go-controller || exit
make
popd || exit

cp go-controller/_output/go/bin/* dist/images

pushd dist/images || exit
echo "ref: $(git rev-parse --symbolic-full-name HEAD) commit: $(git rev-parse HEAD)" > git_info
docker build -t "${OVN_IMAGE}" -f Dockerfile.fedora .
docker push "${OVN_IMAGE}"
popd || exit

popd || exit
}

function prepare_ovn() {
export OVN_IMAGE="localhost:5000/ovn-daemonset-f:latest"

if [[ "$OVN_IC" = true ]]; then
prepare_ovn_ic
else
download_ovnk

local OVN_SRC_IMAGE="ghcr.io/ovn-org/ovn-kubernetes/ovn-kube-f:master"
docker pull "${OVN_SRC_IMAGE}"
docker tag "${OVN_SRC_IMAGE}" "${OVN_IMAGE}"
docker push "${OVN_IMAGE}"
fi
}

function provider_prepare() {
[[ -z "${K8S_VERSION}" ]] && K8S_VERSION="${DEFAULT_K8S_VERSION}"
[[ -n "${kind_k8s_versions[$K8S_VERSION]}" ]] && K8S_VERSION="${kind_k8s_versions[$K8S_VERSION]}"

download_kind
[[ "${cluster_cni[*]}" != *"ovn"* ]] || download_ovnk
run_local_registry
[[ "${cluster_cni[*]}" != *"ovn"* ]] || prepare_ovn
}