Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-13 Thread Dumitru Ceara
On 1/12/23 21:09, Dumitru Ceara wrote:
> On 1/12/23 21:08, Mark Michelson wrote:
>> On 1/12/23 15:03, Dumitru Ceara wrote:
>>> On 1/12/23 20:58, Mark Michelson wrote:
 I made the change Dumitru suggested (checkout@v3 instead of checkout@v2)
 and merged both patches to main.

 Thanks Dumitru and Ales!

>>>
>>> Thanks, Mark, but the second patch should not be pushed to branches
>>> newer than 22.09.  We should revert it on main because we actually want
>>> to run the ovnkube session affinity tests there and skip them on
>>> branches <=22.09.
>>>
>>> I can take care of the backports tomorrow, but it would be great if you
>>> could already revert the patch on main branch.
>>>
>>
>> Sorry about that. I pushed a commit to revert patch 2 on main:
>> https://github.com/ovn-org/ovn/commit/3abc62da8d323c52cfbf7f7dbad9cd50eb9afdcc
>>
> 
> Thanks for the quick response!

I pushed the corresponding patches to all stable branches down to 22.03.

Unfortunately upstream ovn-kubernetes CI is flaky again so we still have
some control-plane test failures:

https://github.com/dceara/ovn/actions/runs/3910245152/jobs/6682549215#step:12:12531

Tim, Surya, do you maybe have some time to help us determine why these
fail so often?  I don't think anything major changed in OVN lately that
would cause these to fail.

The session affinity timeout conformance tests OTOH are skipped/run as
needed:

https://github.com/dceara/ovn/actions/runs/3910245152/jobs/6682548617
(skipped)

https://github.com/dceara/ovn/actions/runs/3910234735/jobs/6682600435
(executed)

Best regards,
Dumitru

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-12 Thread Dumitru Ceara
On 1/12/23 21:08, Mark Michelson wrote:
> On 1/12/23 15:03, Dumitru Ceara wrote:
>> On 1/12/23 20:58, Mark Michelson wrote:
>>> I made the change Dumitru suggested (checkout@v3 instead of checkout@v2)
>>> and merged both patches to main.
>>>
>>> Thanks Dumitru and Ales!
>>>
>>
>> Thanks, Mark, but the second patch should not be pushed to branches
>> newer than 22.09.  We should revert it on main because we actually want
>> to run the ovnkube session affinity tests there and skip them on
>> branches <=22.09.
>>
>> I can take care of the backports tomorrow, but it would be great if you
>> could already revert the patch on main branch.
>>
> 
> Sorry about that. I pushed a commit to revert patch 2 on main:
> https://github.com/ovn-org/ovn/commit/3abc62da8d323c52cfbf7f7dbad9cd50eb9afdcc
> 

Thanks for the quick response!

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-12 Thread Mark Michelson

On 1/12/23 15:03, Dumitru Ceara wrote:

On 1/12/23 20:58, Mark Michelson wrote:

I made the change Dumitru suggested (checkout@v3 instead of checkout@v2)
and merged both patches to main.

Thanks Dumitru and Ales!



Thanks, Mark, but the second patch should not be pushed to branches
newer than 22.09.  We should revert it on main because we actually want
to run the ovnkube session affinity tests there and skip them on
branches <=22.09.

I can take care of the backports tomorrow, but it would be great if you
could already revert the patch on main branch.



Sorry about that. I pushed a commit to revert patch 2 on main: 
https://github.com/ovn-org/ovn/commit/3abc62da8d323c52cfbf7f7dbad9cd50eb9afdcc



Thanks,
Dumitru



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-12 Thread Dumitru Ceara
On 1/12/23 20:58, Mark Michelson wrote:
> I made the change Dumitru suggested (checkout@v3 instead of checkout@v2)
> and merged both patches to main.
> 
> Thanks Dumitru and Ales!
> 

Thanks, Mark, but the second patch should not be pushed to branches
newer than 22.09.  We should revert it on main because we actually want
to run the ovnkube session affinity tests there and skip them on
branches <=22.09.

I can take care of the backports tomorrow, but it would be great if you
could already revert the patch on main branch.

Thanks,
Dumitru

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-12 Thread Mark Michelson
I made the change Dumitru suggested (checkout@v3 instead of checkout@v2) 
and merged both patches to main.


Thanks Dumitru and Ales!

On 1/12/23 12:45, Ales Musil wrote:

On Tue, Dec 20, 2022 at 4:44 PM Dumitru Ceara  wrote:


On 12/20/22 16:30, Dumitru Ceara wrote:

One example is to allow us to change the ovn-kubernetes code that
decides what e2e tests are run.  That's needed on older stable branches
that don't support all the features that newer OVN versions do.

Currently, on the main branch, there's no custom change required but on
older branches (branch-22.09 -> branch-22.03) the affinity timeout
related tests should be disabled because the OVN feature didn't exist
there.  An upcoming patch does that.

Signed-off-by: Dumitru Ceara 
---
  .ci/ovn-kubernetes/Dockerfile|   10 +-
  .ci/ovn-kubernetes/custom.patch  |0
  .ci/ovn-kubernetes/prepare.sh|   20 
  .github/workflows/ovn-kubernetes.yml |7 +++
  Makefile.am  |2 ++
  5 files changed, 38 insertions(+), 1 deletion(-)
  create mode 100644 .ci/ovn-kubernetes/custom.patch
  create mode 100755 .ci/ovn-kubernetes/prepare.sh

diff --git a/.ci/ovn-kubernetes/Dockerfile

b/.ci/ovn-kubernetes/Dockerfile

index e74b620be8..7edf86a13a 100644
--- a/.ci/ovn-kubernetes/Dockerfile
+++ b/.ci/ovn-kubernetes/Dockerfile
@@ -47,9 +47,17 @@ RUN GO111MODULE=on go install

github.com/ovn-org/libovsdb/cmd/modelgen@${LIBOVSD


  # 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
+WORKDIR /root/ovn-kubernetes
  RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1

+# Copy the ovn-kubernetes scripts from the OVN sources and apply any
+# custom changes if needed.
+RUN mkdir -p /tmp/ovn/.ci/ovn-kubernetes
+COPY .ci/ovn-kubernetes /tmp/ovn/.ci/ovn-kubernetes
+WORKDIR /tmp/ovn
+RUN .ci/ovn-kubernetes/prepare.sh /root/ovn-kubernetes
+
+WORKDIR /root/ovn-kubernetes/go-controller
  # 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

diff --git a/.ci/ovn-kubernetes/custom.patch

b/.ci/ovn-kubernetes/custom.patch

new file mode 100644
index 00..e69de29bb2
diff --git a/.ci/ovn-kubernetes/prepare.sh

b/.ci/ovn-kubernetes/prepare.sh

new file mode 100755
index 00..8fc9652afd
--- /dev/null
+++ b/.ci/ovn-kubernetes/prepare.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -ev
+
+ovnk8s_path=$1
+topdir=$PWD
+
+pushd ${ovnk8s_path}
+
+# Add here any custom operations that need to performed on the
+# ovn-kubernetes cloned repo, e.g., custom patches.
+
+# git apply --allow-empty is too new so not all git versions from major
+# distros support it, just check if the custom patch file is not empty
+# before applying it.
+[ -s ${topdir}/.ci/ovn-kubernetes/custom.patch ] && \
+git apply -v ${topdir}/.ci/ovn-kubernetes/custom.patch
+
+popd # ${ovnk8s_path}
+exit 0
diff --git a/.github/workflows/ovn-kubernetes.yml

b/.github/workflows/ovn-kubernetes.yml

index 344937e53a..070d96bcb3 100644
--- a/.github/workflows/ovn-kubernetes.yml
+++ b/.github/workflows/ovn-kubernetes.yml
@@ -91,12 +91,19 @@ jobs:
  go-version: ${{ env.GO_VERSION }}
id: go

+- name: Check out ovn
+  uses: actions/checkout@v2
+


This should be actions/checkout@v3, I will fix it in v2 after v1 gets
some review time.


  - name: Check out ovn-kubernetes
uses: actions/checkout@v3
with:
path: src/github.com/ovn-org/ovn-kubernetes
repository: ovn-org/ovn-kubernetes

+- name: Prepare
+  run: |
+.ci/ovn-kubernetes/prepare.sh src/

github.com/ovn-org/ovn-kubernetes

+
  - name: Set up environment
run: |
  export GOPATH=$(go env GOPATH)
diff --git a/Makefile.am b/Makefile.am
index 3b0df83938..8c60d4a719 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -91,6 +91,8 @@ EXTRA_DIST = \
   .ci/osx-build.sh \
   .ci/osx-prepare.sh \
   .ci/ovn-kubernetes/Dockerfile \
+ .ci/ovn-kubernetes/prepare.sh \
+ .ci/ovn-kubernetes/custom.patch \
   .github/workflows/test.yml \
   .github/workflows/ovn-kubernetes.yml \
   boot.sh \

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev



___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev



Looks good to me, thanks.

Acked-by: Ales Musil 




___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2023-01-12 Thread Ales Musil
On Tue, Dec 20, 2022 at 4:44 PM Dumitru Ceara  wrote:

> On 12/20/22 16:30, Dumitru Ceara wrote:
> > One example is to allow us to change the ovn-kubernetes code that
> > decides what e2e tests are run.  That's needed on older stable branches
> > that don't support all the features that newer OVN versions do.
> >
> > Currently, on the main branch, there's no custom change required but on
> > older branches (branch-22.09 -> branch-22.03) the affinity timeout
> > related tests should be disabled because the OVN feature didn't exist
> > there.  An upcoming patch does that.
> >
> > Signed-off-by: Dumitru Ceara 
> > ---
> >  .ci/ovn-kubernetes/Dockerfile|   10 +-
> >  .ci/ovn-kubernetes/custom.patch  |0
> >  .ci/ovn-kubernetes/prepare.sh|   20 
> >  .github/workflows/ovn-kubernetes.yml |7 +++
> >  Makefile.am  |2 ++
> >  5 files changed, 38 insertions(+), 1 deletion(-)
> >  create mode 100644 .ci/ovn-kubernetes/custom.patch
> >  create mode 100755 .ci/ovn-kubernetes/prepare.sh
> >
> > diff --git a/.ci/ovn-kubernetes/Dockerfile
> b/.ci/ovn-kubernetes/Dockerfile
> > index e74b620be8..7edf86a13a 100644
> > --- a/.ci/ovn-kubernetes/Dockerfile
> > +++ b/.ci/ovn-kubernetes/Dockerfile
> > @@ -47,9 +47,17 @@ RUN GO111MODULE=on go install
> github.com/ovn-org/libovsdb/cmd/modelgen@${LIBOVSD
> 
> >  # 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
> > +WORKDIR /root/ovn-kubernetes
> >  RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1
> >
> > +# Copy the ovn-kubernetes scripts from the OVN sources and apply any
> > +# custom changes if needed.
> > +RUN mkdir -p /tmp/ovn/.ci/ovn-kubernetes
> > +COPY .ci/ovn-kubernetes /tmp/ovn/.ci/ovn-kubernetes
> > +WORKDIR /tmp/ovn
> > +RUN .ci/ovn-kubernetes/prepare.sh /root/ovn-kubernetes
> > +
> > +WORKDIR /root/ovn-kubernetes/go-controller
> >  # 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
> > diff --git a/.ci/ovn-kubernetes/custom.patch
> b/.ci/ovn-kubernetes/custom.patch
> > new file mode 100644
> > index 00..e69de29bb2
> > diff --git a/.ci/ovn-kubernetes/prepare.sh
> b/.ci/ovn-kubernetes/prepare.sh
> > new file mode 100755
> > index 00..8fc9652afd
> > --- /dev/null
> > +++ b/.ci/ovn-kubernetes/prepare.sh
> > @@ -0,0 +1,20 @@
> > +#!/bin/bash
> > +
> > +set -ev
> > +
> > +ovnk8s_path=$1
> > +topdir=$PWD
> > +
> > +pushd ${ovnk8s_path}
> > +
> > +# Add here any custom operations that need to performed on the
> > +# ovn-kubernetes cloned repo, e.g., custom patches.
> > +
> > +# git apply --allow-empty is too new so not all git versions from major
> > +# distros support it, just check if the custom patch file is not empty
> > +# before applying it.
> > +[ -s ${topdir}/.ci/ovn-kubernetes/custom.patch ] && \
> > +git apply -v ${topdir}/.ci/ovn-kubernetes/custom.patch
> > +
> > +popd # ${ovnk8s_path}
> > +exit 0
> > diff --git a/.github/workflows/ovn-kubernetes.yml
> b/.github/workflows/ovn-kubernetes.yml
> > index 344937e53a..070d96bcb3 100644
> > --- a/.github/workflows/ovn-kubernetes.yml
> > +++ b/.github/workflows/ovn-kubernetes.yml
> > @@ -91,12 +91,19 @@ jobs:
> >  go-version: ${{ env.GO_VERSION }}
> >id: go
> >
> > +- name: Check out ovn
> > +  uses: actions/checkout@v2
> > +
>
> This should be actions/checkout@v3, I will fix it in v2 after v1 gets
> some review time.
>
> >  - name: Check out ovn-kubernetes
> >uses: actions/checkout@v3
> >with:
> >path: src/github.com/ovn-org/ovn-kubernetes
> >repository: ovn-org/ovn-kubernetes
> >
> > +- name: Prepare
> > +  run: |
> > +.ci/ovn-kubernetes/prepare.sh src/
> github.com/ovn-org/ovn-kubernetes
> > +
> >  - name: Set up environment
> >run: |
> >  export GOPATH=$(go env GOPATH)
> > diff --git a/Makefile.am b/Makefile.am
> > index 3b0df83938..8c60d4a719 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -91,6 +91,8 @@ EXTRA_DIST = \
> >   .ci/osx-build.sh \
> >   .ci/osx-prepare.sh \
> >   .ci/ovn-kubernetes/Dockerfile \
> > + .ci/ovn-kubernetes/prepare.sh \
> > + .ci/ovn-kubernetes/custom.patch \
> >   .github/workflows/test.yml \
> >   .github/workflows/ovn-kubernetes.yml \
> >   boot.sh \
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
>
> ___
> dev mailing list
> d...@openvswitch.org
> 

Re: [ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2022-12-20 Thread Dumitru Ceara
On 12/20/22 16:30, Dumitru Ceara wrote:
> One example is to allow us to change the ovn-kubernetes code that
> decides what e2e tests are run.  That's needed on older stable branches
> that don't support all the features that newer OVN versions do.
> 
> Currently, on the main branch, there's no custom change required but on
> older branches (branch-22.09 -> branch-22.03) the affinity timeout
> related tests should be disabled because the OVN feature didn't exist
> there.  An upcoming patch does that.
> 
> Signed-off-by: Dumitru Ceara 
> ---
>  .ci/ovn-kubernetes/Dockerfile|   10 +-
>  .ci/ovn-kubernetes/custom.patch  |0 
>  .ci/ovn-kubernetes/prepare.sh|   20 
>  .github/workflows/ovn-kubernetes.yml |7 +++
>  Makefile.am  |2 ++
>  5 files changed, 38 insertions(+), 1 deletion(-)
>  create mode 100644 .ci/ovn-kubernetes/custom.patch
>  create mode 100755 .ci/ovn-kubernetes/prepare.sh
> 
> diff --git a/.ci/ovn-kubernetes/Dockerfile b/.ci/ovn-kubernetes/Dockerfile
> index e74b620be8..7edf86a13a 100644
> --- a/.ci/ovn-kubernetes/Dockerfile
> +++ b/.ci/ovn-kubernetes/Dockerfile
> @@ -47,9 +47,17 @@ RUN GO111MODULE=on go install 
> github.com/ovn-org/libovsdb/cmd/modelgen@${LIBOVSD
>  # 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
> +WORKDIR /root/ovn-kubernetes
>  RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1
>  
> +# Copy the ovn-kubernetes scripts from the OVN sources and apply any
> +# custom changes if needed.
> +RUN mkdir -p /tmp/ovn/.ci/ovn-kubernetes
> +COPY .ci/ovn-kubernetes /tmp/ovn/.ci/ovn-kubernetes
> +WORKDIR /tmp/ovn
> +RUN .ci/ovn-kubernetes/prepare.sh /root/ovn-kubernetes
> +
> +WORKDIR /root/ovn-kubernetes/go-controller
>  # 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
> diff --git a/.ci/ovn-kubernetes/custom.patch b/.ci/ovn-kubernetes/custom.patch
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/.ci/ovn-kubernetes/prepare.sh b/.ci/ovn-kubernetes/prepare.sh
> new file mode 100755
> index 00..8fc9652afd
> --- /dev/null
> +++ b/.ci/ovn-kubernetes/prepare.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +
> +set -ev
> +
> +ovnk8s_path=$1
> +topdir=$PWD
> +
> +pushd ${ovnk8s_path}
> +
> +# Add here any custom operations that need to performed on the
> +# ovn-kubernetes cloned repo, e.g., custom patches.
> +
> +# git apply --allow-empty is too new so not all git versions from major
> +# distros support it, just check if the custom patch file is not empty
> +# before applying it.
> +[ -s ${topdir}/.ci/ovn-kubernetes/custom.patch ] && \
> +git apply -v ${topdir}/.ci/ovn-kubernetes/custom.patch
> +
> +popd # ${ovnk8s_path}
> +exit 0
> diff --git a/.github/workflows/ovn-kubernetes.yml 
> b/.github/workflows/ovn-kubernetes.yml
> index 344937e53a..070d96bcb3 100644
> --- a/.github/workflows/ovn-kubernetes.yml
> +++ b/.github/workflows/ovn-kubernetes.yml
> @@ -91,12 +91,19 @@ jobs:
>  go-version: ${{ env.GO_VERSION }}
>id: go
>  
> +- name: Check out ovn
> +  uses: actions/checkout@v2
> +

This should be actions/checkout@v3, I will fix it in v2 after v1 gets
some review time.

>  - name: Check out ovn-kubernetes
>uses: actions/checkout@v3
>with:
>path: src/github.com/ovn-org/ovn-kubernetes
>repository: ovn-org/ovn-kubernetes
>  
> +- name: Prepare
> +  run: |
> +.ci/ovn-kubernetes/prepare.sh src/github.com/ovn-org/ovn-kubernetes
> +
>  - name: Set up environment
>run: |
>  export GOPATH=$(go env GOPATH)
> diff --git a/Makefile.am b/Makefile.am
> index 3b0df83938..8c60d4a719 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -91,6 +91,8 @@ EXTRA_DIST = \
>   .ci/osx-build.sh \
>   .ci/osx-prepare.sh \
>   .ci/ovn-kubernetes/Dockerfile \
> + .ci/ovn-kubernetes/prepare.sh \
> + .ci/ovn-kubernetes/custom.patch \
>   .github/workflows/test.yml \
>   .github/workflows/ovn-kubernetes.yml \
>   boot.sh \
> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn 1/2] .ci: ovn-kubernetes: Add a "prepare" stage to allow for custom actions.

2022-12-20 Thread Dumitru Ceara
One example is to allow us to change the ovn-kubernetes code that
decides what e2e tests are run.  That's needed on older stable branches
that don't support all the features that newer OVN versions do.

Currently, on the main branch, there's no custom change required but on
older branches (branch-22.09 -> branch-22.03) the affinity timeout
related tests should be disabled because the OVN feature didn't exist
there.  An upcoming patch does that.

Signed-off-by: Dumitru Ceara 
---
 .ci/ovn-kubernetes/Dockerfile|   10 +-
 .ci/ovn-kubernetes/custom.patch  |0 
 .ci/ovn-kubernetes/prepare.sh|   20 
 .github/workflows/ovn-kubernetes.yml |7 +++
 Makefile.am  |2 ++
 5 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 .ci/ovn-kubernetes/custom.patch
 create mode 100755 .ci/ovn-kubernetes/prepare.sh

diff --git a/.ci/ovn-kubernetes/Dockerfile b/.ci/ovn-kubernetes/Dockerfile
index e74b620be8..7edf86a13a 100644
--- a/.ci/ovn-kubernetes/Dockerfile
+++ b/.ci/ovn-kubernetes/Dockerfile
@@ -47,9 +47,17 @@ RUN GO111MODULE=on go install 
github.com/ovn-org/libovsdb/cmd/modelgen@${LIBOVSD
 # 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
+WORKDIR /root/ovn-kubernetes
 RUN git checkout ${OVNKUBE_COMMIT} && git log -n 1
 
+# Copy the ovn-kubernetes scripts from the OVN sources and apply any
+# custom changes if needed.
+RUN mkdir -p /tmp/ovn/.ci/ovn-kubernetes
+COPY .ci/ovn-kubernetes /tmp/ovn/.ci/ovn-kubernetes
+WORKDIR /tmp/ovn
+RUN .ci/ovn-kubernetes/prepare.sh /root/ovn-kubernetes
+
+WORKDIR /root/ovn-kubernetes/go-controller
 # 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
diff --git a/.ci/ovn-kubernetes/custom.patch b/.ci/ovn-kubernetes/custom.patch
new file mode 100644
index 00..e69de29bb2
diff --git a/.ci/ovn-kubernetes/prepare.sh b/.ci/ovn-kubernetes/prepare.sh
new file mode 100755
index 00..8fc9652afd
--- /dev/null
+++ b/.ci/ovn-kubernetes/prepare.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -ev
+
+ovnk8s_path=$1
+topdir=$PWD
+
+pushd ${ovnk8s_path}
+
+# Add here any custom operations that need to performed on the
+# ovn-kubernetes cloned repo, e.g., custom patches.
+
+# git apply --allow-empty is too new so not all git versions from major
+# distros support it, just check if the custom patch file is not empty
+# before applying it.
+[ -s ${topdir}/.ci/ovn-kubernetes/custom.patch ] && \
+git apply -v ${topdir}/.ci/ovn-kubernetes/custom.patch
+
+popd # ${ovnk8s_path}
+exit 0
diff --git a/.github/workflows/ovn-kubernetes.yml 
b/.github/workflows/ovn-kubernetes.yml
index 344937e53a..070d96bcb3 100644
--- a/.github/workflows/ovn-kubernetes.yml
+++ b/.github/workflows/ovn-kubernetes.yml
@@ -91,12 +91,19 @@ jobs:
 go-version: ${{ env.GO_VERSION }}
   id: go
 
+- name: Check out ovn
+  uses: actions/checkout@v2
+
 - name: Check out ovn-kubernetes
   uses: actions/checkout@v3
   with:
   path: src/github.com/ovn-org/ovn-kubernetes
   repository: ovn-org/ovn-kubernetes
 
+- name: Prepare
+  run: |
+.ci/ovn-kubernetes/prepare.sh src/github.com/ovn-org/ovn-kubernetes
+
 - name: Set up environment
   run: |
 export GOPATH=$(go env GOPATH)
diff --git a/Makefile.am b/Makefile.am
index 3b0df83938..8c60d4a719 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -91,6 +91,8 @@ EXTRA_DIST = \
.ci/osx-build.sh \
.ci/osx-prepare.sh \
.ci/ovn-kubernetes/Dockerfile \
+   .ci/ovn-kubernetes/prepare.sh \
+   .ci/ovn-kubernetes/custom.patch \
.github/workflows/test.yml \
.github/workflows/ovn-kubernetes.yml \
boot.sh \

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev