diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37df12c3e..e6c98729b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,17 @@ jobs: api-module-test: timeout-minutes: 10 runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + envoy_version: + - 1.29 + - 1.31 + env: + ENVOY_API_VERSION: ${{ matrix.envoy_version }} + # patch version should not contain API breaking changes, so we just pick the first one + FULL_ENVOY_VERSION: ${{ matrix.envoy_version }}.0 + PROXY_IMAGE: envoyproxy/envoy:contrib-v${{ matrix.envoy_version }}.0 defaults: run: working-directory: ./api @@ -37,22 +48,22 @@ jobs: - name: Choose the Envoy API run: | pushd .. - ./patch/switch-envoy-go-version.sh 1.29.5 + ./patch/switch-envoy-go-version.sh ${FULL_ENVOY_VERSION} popd - name: Unit test - run: ENVOY_API_VERSION=1.29 make unit-test + run: make unit-test - name: Build run: make build-test-so - name: Integration test - run: ENVOY_API_VERSION=1.29 PROXY_IMAGE=envoyproxy/envoy:contrib-v1.29.5 make integration-test + run: make integration-test - name: Upload logs uses: actions/upload-artifact@v4 if: failure() with: # upload artifact can be found in https://github.com/mosn/htnn/actions/runs/$id - name: api-module-test-logs + name: api-module-test-logs-${{ matrix.envoy_version }} path: ./test-envoy - name: Generate coverage @@ -63,7 +74,7 @@ jobs: if: always() # always upload coverage, so the coverage percents won't affect by the failed tests uses: actions/upload-artifact@v4 with: - name: api-module-test-cover + name: api-module-test-cover-${{ matrix.envoy_version }} path: | ./api/cover.out ./api/cover_integration.out @@ -218,8 +229,10 @@ jobs: with: fail_ci_if_error: true files: | - ./api-module-test-cover/cover.out, - ./api-module-test-cover/cover_integration.out, + ./api-module-test-cover-1.29/cover.out, + ./api-module-test-cover-1.29/cover_integration.out, + ./api-module-test-cover-1.31/cover.out, + ./api-module-test-cover-1.31/cover_integration.out, ./types-module-test-cover/cover.out, ./plugins-unit-test-cover/cover.out, ./plugins-integration-test-cover/cover.out, diff --git a/api/Makefile b/api/Makefile index b4c054916..3552c4fe0 100644 --- a/api/Makefile +++ b/api/Makefile @@ -39,6 +39,7 @@ build-test-so: -v $(PWD)/..:/go/src/${PROJECT_NAME} \ -w /go/src/${PROJECT_NAME}/api \ -e GOPROXY \ + -e ENVOY_API_VERSION \ ${BUILD_IMAGE} \ bash -c "git config --global --add safe.directory '*' && make build-test-so-local" diff --git a/manifests/Makefile b/manifests/Makefile index 7729f0069..d7fcc1972 100644 --- a/manifests/Makefile +++ b/manifests/Makefile @@ -25,12 +25,8 @@ PROXY_BASE_IMAGE ?= istio/proxyv2:$(ISTIO_VERSION) CONTROLLER_IMAGE ?= htnn/controller:latest CONTROLLER_BASE_IMAGE ?= docker.io/istio/pilot:$(ISTIO_VERSION) -.PHONY: build-so -build-so: - cd ../plugins/ && ENVOY_API_VERSION=1.29 make build-so - .PHONY: build-proxy-image -build-proxy-image: build-so +build-proxy-image: cd .. && $(CONTAINER_TOOL) build -t ${PROXY_IMAGE} --build-arg GOPROXY=${GOPROXY} --build-arg PROXY_BASE_IMAGE=${PROXY_BASE_IMAGE} \ -f manifests/images/dp/Dockerfile . diff --git a/manifests/images/dp/Dockerfile b/manifests/images/dp/Dockerfile index 7cfe3fb62..eb2a98869 100644 --- a/manifests/images/dp/Dockerfile +++ b/manifests/images/dp/Dockerfile @@ -31,10 +31,16 @@ COPY api/ api/ COPY types/ types/ COPY plugins/ plugins/ COPY controller/ controller/ -COPY patch/switch-envoy-go-version.sh patch/switch-envoy-go-version.sh -RUN ./patch/switch-envoy-go-version.sh 1.29.5 # Remember to run `make prebuild` before building the image COPY external/istio/ external/istio/ + +COPY patch/switch-envoy-go-version.sh patch/switch-envoy-go-version.sh +COPY common.mk common.mk +# hadolint ignore=DL3003 +RUN ./patch/switch-envoy-go-version.sh 1.29.5 && \ + cd plugins/ && \ + ENVOY_API_VERSION=1.29 make build-so-local + WORKDIR /workspace/external/istio RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -C pilot/cmd/pilot-agent -a -o /workspace/pilot-agent @@ -48,5 +54,5 @@ LABEL org.opencontainers.image.description="This is image used in the HTNN data LABEL org.opencontainers.image.licenses="Apache-2.0" COPY --from=builder /workspace/pilot-agent /usr/local/bin/ -COPY plugins/libgolang.so /etc/libgolang.so +COPY --from=builder /workspace/plugins/libgolang.so /etc/libgolang.so CMD ["envoy"] diff --git a/plugins/Makefile b/plugins/Makefile index 8398c191c..ed54b0018 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -39,6 +39,7 @@ build-test-so-local: build-test-so: docker run --rm ${MOUNT_GOMOD_CACHE} -v ${PROJECT_ROOT}:/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME}/plugins \ -e GOPROXY \ + -e ENVOY_API_VERSION \ ${BUILD_IMAGE} \ bash -c "git config --global --add safe.directory '*' && make build-test-so-local" @@ -70,6 +71,7 @@ build-so-local: build-so: docker run --rm ${MOUNT_GOMOD_CACHE} -v ${PROJECT_ROOT}:/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME}/plugins \ -e GOPROXY \ + -e ENVOY_API_VERSION \ ${BUILD_IMAGE} \ bash -c "git config --global --add safe.directory '*' && make build-so-local" diff --git a/types/registries/nacos/config.pb.go b/types/registries/nacos/config.pb.go index 67eac5fbf..a6ea60920 100644 --- a/types/registries/nacos/config.pb.go +++ b/types/registries/nacos/config.pb.go @@ -42,6 +42,7 @@ type Config struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // the version is used to choose the Nacos version between v1 and v2 Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` ServerUrl string `protobuf:"bytes,2,opt,name=server_url,json=serverUrl,proto3" json:"server_url,omitempty"` Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"`