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

ci: fix dpdk jobs #3405

Merged
merged 1 commit into from
Nov 13, 2023
Merged
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
65 changes: 44 additions & 21 deletions .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: Build kube-ovn-base
runs-on: ubuntu-22.04
outputs:
build-base: ${{ steps.build.outputs.build-base }}
build-base: ${{ steps.check.outputs.build-base }}
steps:
- uses: jlumbroso/[email protected]
with:
Expand All @@ -52,25 +52,22 @@ jobs:
if [ ${{ github.event_name }} != 'pull_request' ]; then
exit
fi
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base; then
echo buildx=1 >> "$GITHUB_OUTPUT"
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then
echo build-base=1 >> "$GITHUB_OUTPUT"
fi

- uses: docker/setup-buildx-action@v3
if: steps.check.outputs.buildx == 1
if: steps.check.outputs.build-base == 1

- name: Build kube-ovn-base image
id: build
if: steps.check.outputs.buildx == 1
if: steps.check.outputs.build-base == 1
run: |
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then
make base-amd64
make base-tar-amd64
echo build-base=1 >> "$GITHUB_OUTPUT"
fi

- name: Upload base images to artifact
if: steps.build.outputs.build-base == 1
if: steps.check.outputs.build-base == 1
uses: actions/upload-artifact@v3
with:
name: kube-ovn-base
Expand All @@ -80,7 +77,7 @@ jobs:
name: Build kube-ovn-dpdk-base
runs-on: ubuntu-22.04
outputs:
build-base: ${{ steps.build.outputs.build-dpdk-base }}
build-dpdk-base: ${{ steps.check.outputs.build-dpdk-base }}
steps:
- uses: jlumbroso/[email protected]
with:
Expand All @@ -101,24 +98,22 @@ jobs:
if [ ${{ github.event_name }} != 'pull_request' ]; then
exit
fi
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base; then
echo buildx=1 >> "$GITHUB_OUTPUT"
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base-dpdk$; then
echo build-dpdk-base=1 >> "$GITHUB_OUTPUT"
fi

- uses: docker/setup-buildx-action@v3
if: steps.check.outputs.buildx == 1
if: steps.check.outputs.build-dpdk-base == 1

- name: Build kube-ovn-dpdk-base image
id: build
if: steps.check.outputs.buildx == 1
if: steps.check.outputs.build-dpdk-base == 1
run: |
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base-dpdk$; then
make base-amd64-dpdk
echo build-dpdk-base=1 >> "$GITHUB_OUTPUT"
fi
make base-amd64-dpdk
make base-tar-amd64-dpdk

- name: Upload dpdk base images to artifact
if: steps.build.outputs.build-dpdk-base == 1
if: steps.check.outputs.build-dpdk-base == 1
uses: actions/upload-artifact@v3
with:
name: kube-ovn-dpdk-base
Expand All @@ -127,7 +122,9 @@ jobs:
build-kube-ovn:
name: Build kube-ovn
runs-on: ubuntu-22.04
needs: build-kube-ovn-base
needs:
- build-kube-ovn-base
- build-kube-ovn-dpdk-base
steps:
- uses: jlumbroso/[email protected]
with:
Expand Down Expand Up @@ -203,19 +200,36 @@ jobs:
TAG=$(cat VERSION)
docker tag kubeovn/kube-ovn-base:$TAG-amd64 kubeovn/kube-ovn-base:$TAG
docker tag kubeovn/kube-ovn-base:$TAG-debug-amd64 kubeovn/kube-ovn-base:$TAG-debug
docker tag kubeovn/kube-ovn-base:$TAG-amd64-dpdk kubeovn/kube-ovn-base:$TAG-dpdk
make build-kube-ovn
else
make image-kube-ovn
fi
make tar-kube-ovn

- name: Build dpdk
run: |
if [ ${{ needs.build-kube-ovn-dpdk-base.outputs.build-dpdk-base || 0 }} = 1 ]; then
TAG=$(cat VERSION)
docker tag kubeovn/kube-ovn-base:$TAG-amd64-dpdk kubeovn/kube-ovn-base:$TAG-dpdk
make build-kube-ovn-dpdk
else
make image-kube-ovn-dpdk
fi
make tar-kube-ovn-dpdk

- name: Upload images to artifact
uses: actions/upload-artifact@v3
with:
name: kube-ovn
path: kube-ovn.tar

- name: Upload dpdk images to artifact
uses: actions/upload-artifact@v3
if: github.event_name != 'pull_request'
with:
name: kube-ovn-dpdk
path: kube-ovn-dpdk.tar

build-vpc-nat-gateway:
name: Build vpc-nat-gateway
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -2223,6 +2237,12 @@ jobs:
with:
name: kube-ovn

- name: Download kube-ovn-dpdk image
uses: actions/download-artifact@v3
if: github.event_name != 'pull_request'
with:
name: kube-ovn-dpdk

- name: Download vpc-nat-gateway image
uses: actions/download-artifact@v3
with:
Expand All @@ -2244,6 +2264,9 @@ jobs:
docker load --input vpc-nat-gateway.tar
docker load --input centos7-compile.tar
# docker load --input centos8-compile.tar
if [ '${{ github.event_name }}' != 'pull_request' ]; then
docker load --input kube-ovn-dpdk.tar
fi

- name: Security Scan
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ broker-info-internal.subm
yamls/clab-bgp.yaml
yamls/clab-bgp-ha.yaml
kube-ovn.tar
kube-ovn-dpdk.tar
vpc-nat-gateway.tar
image-amd64.tar
image-amd64-dpdk.tar
image-arm64.tar
test/**/*.test
kube-ovn-app-sa.yaml
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ build-go-arm:
build-kube-ovn: build-go
docker build -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG) --build-arg VERSION=$(RELEASE_TAG) -f dist/images/Dockerfile dist/images/
docker build -t $(REGISTRY)/kube-ovn:$(DEBUG_TAG) --build-arg BASE_TAG=$(DEBUG_TAG) -f dist/images/Dockerfile dist/images/
docker build -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk -f dist/images/Dockerfile.dpdk dist/images/

.PHONY: build-kube-ovn-dpdk
build-kube-ovn-dpdk: build-go
docker build -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk --build-arg BASE_TAG=$(RELEASE_TAG)-dpdk -f dist/images/Dockerfile dist/images/

.PHONY: build-dev
build-dev: build-go
Expand Down Expand Up @@ -128,7 +131,10 @@ base-arm64:
image-kube-ovn: build-go
docker buildx build --platform linux/amd64 -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG) --build-arg VERSION=$(RELEASE_TAG) -o type=docker -f dist/images/Dockerfile dist/images/
docker buildx build --platform linux/amd64 -t $(REGISTRY)/kube-ovn:$(DEBUG_TAG) --build-arg BASE_TAG=$(DEBUG_TAG) -o type=docker -f dist/images/Dockerfile dist/images/
docker buildx build --platform linux/amd64 -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk --build-arg VERSION=$(RELEASE_TAG) -o type=docker -f dist/images/Dockerfile.dpdk dist/images/

.PHONY: image-kube-ovn-dpdk
image-kube-ovn-dpdk: build-go
docker buildx build --platform linux/amd64 -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk --build-arg VERSION=$(RELEASE_TAG) --build-arg BASE_TAG=$(RELEASE_TAG)-dpdk -o type=docker -f dist/images/Dockerfile dist/images/

.PHONY: image-vpc-nat-gateway
image-vpc-nat-gateway:
Expand Down Expand Up @@ -162,7 +168,11 @@ push-release: release

.PHONY: tar-kube-ovn
tar-kube-ovn:
docker save $(REGISTRY)/kube-ovn:$(RELEASE_TAG) $(REGISTRY)/kube-ovn:$(DEBUG_TAG) $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk -o kube-ovn.tar
docker save $(REGISTRY)/kube-ovn:$(RELEASE_TAG) $(REGISTRY)/kube-ovn:$(DEBUG_TAG) -o kube-ovn.tar

.PHONY: tar-kube-ovn-dpdk
tar-kube-ovn-dpdk:
docker save $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk -o kube-ovn-dpdk.tar

.PHONY: tar-vpc-nat-gateway
tar-vpc-nat-gateway:
Expand Down Expand Up @@ -946,7 +956,7 @@ clean:
$(RM) ovn.yaml kube-ovn.yaml kube-ovn-crd.yaml
$(RM) ovn-ic-0.yaml ovn-ic-1.yaml
$(RM) kustomization.yaml kwok.yaml kwok-node.yaml
$(RM) kube-ovn.tar vpc-nat-gateway.tar image-amd64.tar image-arm64.tar
$(RM) kube-ovn.tar kube-ovn-dpdk.tar vpc-nat-gateway.tar image-amd64.tar image-amd64-dpdk.tar image-arm64.tar

.PHONY: changelog
changelog:
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ARG ARCH
ENV CNI_VERSION=v1.3.0
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap ./macvlan

ENV KUBE_VERSION="v1.28.2"
ENV KUBE_VERSION="v1.28.3"

RUN curl -L https://dl.k8s.io/${KUBE_VERSION}/kubernetes-client-linux-${ARCH}.tar.gz | tar -xz -C . && cp ./kubernetes/client/bin/kubectl /usr/bin/kubectl \
&& chmod +x /usr/bin/kubectl && rm -rf ./kubernetes
Expand Down
23 changes: 0 additions & 23 deletions dist/images/Dockerfile.dpdk

This file was deleted.

Loading