Make sure ovn-kubernetes is compiled against the NB/SB schema from the OVN source tree. By default upstream ovn-kubernetes uses the schema from the latest released OVN version. But that doesn't work fine if in the meantime there were changes to the schema that are not yet part of a stable release.
Signed-off-by: Dumitru Ceara <[email protected]> --- .ci/ovn-kubernetes/Dockerfile | 13 ++++++++++++- .github/workflows/ovn-kubernetes.yml | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.ci/ovn-kubernetes/Dockerfile b/.ci/ovn-kubernetes/Dockerfile index 9be9f2ab2c..bd220b1e29 100644 --- a/.ci/ovn-kubernetes/Dockerfile +++ b/.ci/ovn-kubernetes/Dockerfile @@ -1,4 +1,5 @@ ARG OVNKUBE_COMMIT=master +ARG LIBOVSDB_COMMIT=8081fe24e48f FROM fedora:35 AS ovnbuilder @@ -38,11 +39,21 @@ RUN rm rpm/rpmbuild/RPMS/x86_64/*docker* # Build ovn-kubernetes FROM golang:1.17 as ovnkubebuilder ARG OVNKUBE_COMMIT +ARG LIBOVSDB_COMMIT + +# Get a working version of libovsdb (for modelgen). +RUN GO111MODULE=on go install github.com/ovn-org/libovsdb/cmd/modelgen@${LIBOVSDB_COMMIT} + # Clone OVN Kubernetes and build the binary based on the commit passed as argument WORKDIR /root RUN git clone https://github.com/ovn-org/ovn-kubernetes.git WORKDIR /root/ovn-kubernetes/go-controller -RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1 && make +RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1 + +# Make sure we use the OVN NB/SB schema from the local code. +COPY --from=ovnbuilder /tmp/ovn/ovn-nb.ovsschema pkg/nbdb/ovn-nb.ovsschema +COPY --from=ovnbuilder /tmp/ovn/ovn-sb.ovsschema pkg/sbdb/ovn-sb.ovsschema +RUN go generate ./pkg/nbdb && go generate ./pkg/sbdb && make # Build the final image FROM fedora:35 diff --git a/.github/workflows/ovn-kubernetes.yml b/.github/workflows/ovn-kubernetes.yml index 60c585a240..6fd1f329a7 100644 --- a/.github/workflows/ovn-kubernetes.yml +++ b/.github/workflows/ovn-kubernetes.yml @@ -12,6 +12,7 @@ env: GO_VERSION: "1.16.3" K8S_VERSION: v1.20.2 OVNKUBE_COMMIT: "master" + LIBOVSDB_COMMIT: "8081fe24e48f" KIND_CLUSTER_NAME: ovn KIND_INSTALL_INGRESS: true KIND_ALLOW_SYSTEM_WRITES: true @@ -31,7 +32,9 @@ jobs: - name: Build ovn-kubernetes container run: | - docker build --build-arg OVNKUBE_COMMIT=${{ env.OVNKUBE_COMMIT }} -t ovn-daemonset-f:dev -f .ci/ovn-kubernetes/Dockerfile . + docker build --build-arg OVNKUBE_COMMIT=${{ env.OVNKUBE_COMMIT }} \ + --build-arg LIBOVSDB_COMMIT=${{ env.LIBOVSDB_COMMIT }} \ + -t ovn-daemonset-f:dev -f .ci/ovn-kubernetes/Dockerfile . mkdir /tmp/_output docker save ovn-daemonset-f:dev > /tmp/_output/image.tar _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
