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

Build Router Check Tool #2

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build
on:
push: {} # TODO: fix before merge
pull_request: {}
concurrency: ${{ github.ref }}
permissions:
contents: read
id-token: write

jobs:
build:
runs-on: [gyg-gha-runner-32x128]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
pull: true
file: tools/router-check-tool/Dockerfile
context: .
platforms: linux/amd64
push: true
# push: ${{ github.ref_name == github.event.repository.default_branch && github.event_name == 'push'}}
tags: getyourguide/router-check-tool:release-1.22
16 changes: 16 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_cc_binary",
"envoy_cc_test_binary",
)

# Copyright 2016 Istio Authors. All Rights Reserved.
Expand Down Expand Up @@ -54,3 +55,18 @@ pkg_tar(
package_dir = "/usr/local/bin/",
tags = ["manual"],
)

envoy_cc_test_binary(
name = "router_check_tool",
repository = "@envoy",
srcs = [
"@envoy//test/tools/router_check:router_check.cc",
],
deps = ISTIO_EXTENSIONS + [
"@envoy//test/tools/router_check:router_check_main_lib",
"@envoy//source/extensions/retry/host/previous_hosts:config",
"@envoy//source/extensions/retry/host/omit_canary_hosts:config",
"@envoy//source/extensions/retry/host/omit_host_metadata:config",
"@envoy//source/extensions/filters/http/fault:config",
],
)
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ http_archive(
sha256 = ENVOY_SHA256,
strip_prefix = ENVOY_REPO + "-" + ENVOY_SHA,
url = "https://github.com/" + ENVOY_ORG + "/" + ENVOY_REPO + "/archive/" + ENVOY_SHA + ".tar.gz",
patches = ["router_check.patch"],
patch_args = ["-p1"],
)

load("@envoy//bazel:api_binding.bzl", "envoy_api_binding")
Expand Down
14 changes: 14 additions & 0 deletions external/router_check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/test/tools/router_check/router.cc b/test/tools/router_check/router.cc
index 410caf6cc0..84c9670d77 100644
--- a/test/tools/router_check/router.cc
+++ b/test/tools/router_check/router.cc
@@ -137,6 +137,9 @@ RouterCheckTool RouterCheckTool::create(const std::string& router_config_file,
assignRuntimeFraction(route_config);
auto factory_context =
std::make_unique<NiceMock<Server::Configuration::MockServerFactoryContext>>();
+
+ Runtime::maybeSetDeprecatedInts("re2.max_program_size.error_level", 32768); // istio-proxy default
+
auto config = *Router::ConfigImpl::create(route_config, *factory_context,
ProtobufMessage::getNullValidationVisitor(), false);
if (!disable_deprecation_check) {
15 changes: 15 additions & 0 deletions tools/router-check-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM gcr.io/istio-testing/build-tools-proxy:master-latest as builder

WORKDIR /work/

COPY . /work/

RUN bazel build //:router_check_tool

FROM ubuntu

COPY --from=builder /work/bazel-bin/router_check_tool /usr/local/bin/

USER nobody:nogroup

ENTRYPOINT [ "/usr/local/bin/router_check_tool"]
7 changes: 7 additions & 0 deletions tools/router-check-tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Envoy Router Check Tool

Istio compatible [Route Table Check Tool](https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/tools/router_check).

- [Patches](../../external/router_check.patch) needed to work with Istio.
- [BUILD](../../BUILD) with configuration to build `router_check_tool` using Istio's filters.
- [Dockerfile](./Dockerfile) to build the image.
Loading