Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Changes:
- update Go version to v 1.21
- update VPP to v23.10
- update gotestsum to v1.11.0
- cleanup Dockerfile

Signed-off-by: Ondrej Fabry <ondrej@fabry.dev>
  • Loading branch information
ondrej-fabry committed Jan 2, 2024
1 parent 304bc5b commit 14610b4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
name: "Check go.mod"
strategy:
matrix:
go: [ '1.20' ]
go: [ '1.21' ]
runs-on: ubuntu-latest
steps:
- name: "Checkout"
Expand All @@ -52,7 +52,7 @@ jobs:
name: "Check generated binapi"
strategy:
matrix:
go: [ '1.20' ]
go: [ '1.21' ]
env:
VERSION: v0.8.0
runs-on: ubuntu-latest
Expand All @@ -73,7 +73,7 @@ jobs:
name: "Build and test"
strategy:
matrix:
go: [ '1.20' ]
go: [ '1.21' ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -86,7 +86,7 @@ jobs:
- name: "Setup gotestsum"
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.9.0
gotestsum_version: 1.11.0
- name: "Go Build"
run: go build -v ./...
- name: "Go Test"
Expand All @@ -101,7 +101,7 @@ jobs:
name: "GolangCI"
strategy:
matrix:
go: [ '1.20' ]
go: [ '1.21' ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
56 changes: 38 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@
ARG VPP_VERSION=v23.06
ARG UBUNTU_VERSION=20.04
ARG VPP_VERSION=v23.10
ARG UBUNTU_VERSION=22.04

FROM ubuntu:${UBUNTU_VERSION} as vppbuild
ARG VPP_VERSION
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive TZ=US/Central apt-get install -y git make python3 sudo asciidoc

RUN set -eux;\
apt-get update && env DEBIAN_FRONTEND=noninteractive TZ=US/Central apt-get install -y \
asciidoc \
ca-certificates \
git \
iproute2 \
iputils-ping \
make \
python3 \
sudo \
tcpdump \
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/FDio/vpp.git

WORKDIR /vpp

ARG VPP_VERSION
RUN git checkout ${VPP_VERSION}
#COPY patch/ patch/
#RUN test -x "patch/patch.sh" && ./patch/patch.sh || exit 1
RUN DEBIAN_FRONTEND=noninteractive TZ=US/Central UNATTENDED=y make install-dep
RUN make pkg-deb
RUN ./src/scripts/version > /vpp/VPP_VERSION

RUN set -eux; \
env DEBIAN_FRONTEND=noninteractive TZ=US/Central UNATTENDED=y make install-dep
RUN set -eux; \
make pkg-deb \
./src/scripts/version > /vpp/VPP_VERSION

FROM vppbuild as vppinstall
#COPY --from=vppbuild /var/lib/apt/lists/* /var/lib/apt/lists/
#COPY --from=vppbuild [ "/vpp/build-root/libvppinfra_*_amd64.deb", "/vpp/build-root/vpp_*_amd64.deb", "/vpp/build-root/vpp-plugin-core_*_amd64.deb", "/vpp/build-root/vpp-plugin-dpdk_*_amd64.deb", "/pkg/"]
#RUN VPP_INSTALL_SKIP_SYSCTL=false apt install -f -y --no-install-recommends /pkg/*.deb ca-certificates iputils-ping iproute2 tcpdump; \
# rm -rf /var/lib/apt/lists/*; \
# rm -rf /pkg
RUN VPP_INSTALL_SKIP_SYSCTL=false apt install -f -y --no-install-recommends /vpp/build-root/*.deb ca-certificates iputils-ping iproute2 tcpdump; \

RUN set -eux; \
env VPP_INSTALL_SKIP_SYSCTL=false apt install -f -y --no-install-recommends /vpp/build-root/*.deb ; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /pkg

FROM golang:1.20-alpine3.18 as binapi-generator
FROM golang:1.21-alpine3.19 as binapi-generator

ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOBIN=/bin

ARG GOVPP_VERSION

COPY . /govpp

WORKDIR /govpp

RUN go build -o /bin/binapi-generator ./cmd/binapi-generator

FROM binapi-generator as gen

COPY --from=vppinstall /usr/share/vpp/api/ /usr/share/vpp/api/
COPY --from=vppinstall /vpp/VPP_VERSION /VPP_VERSION

WORKDIR /gen/binapi
CMD VPP_VERSION=$(cat /VPP_VERSION) go generate .

CMD VPP_VERSION=$(cat /VPP_VERSION) go generate .
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif
# Package cloud repo for VPP.
VPP_REPO ?= release
# VPP Docker image to use for api generation (gen-binapi-docker)
VPP_IMG ?= ligato/vpp-base:23.06-release
VPP_IMG ?= ligato/vpp-base:23.10-release
# Local VPP directory used for binary api generation (gen-binapi-from-code)
VPP_DIR ?=
# Target directory for generated go api bindings
Expand Down

0 comments on commit 14610b4

Please sign in to comment.