Skip to content

Commit

Permalink
ci: add io_uring pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Xie Zhihao <zhihao.xie@intel.com>
  • Loading branch information
zhxie committed Jul 24, 2023
1 parent 22d047e commit a998995
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .azure-pipelines/stage/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,48 @@ jobs:
timeoutInMinutes: 10
condition: and(failed(), eq(variables['CI_TARGET'], 'bazel.clang_tidy'))

# Exempt job will continue on error and will be regarded as a warning instead
# of an error on failed.
- job: exempt
displayName: "Linux x64"
dependsOn: []
condition: |
and(not(canceled()),
eq(${{ parameters.runChecks }}, 'true'))
continueOnError: true
variables:
REPO_FETCH_DEPTH: 1
REPO_FETCH_TAGS: false
PUBLISH_TEST_RESULTS: true
PUBLISH_ENVOY: true
strategy:
maxParallel: ${{ parameters.concurrencyChecks }}
matrix:
io_uring:
CI_TARGET: "bazel.io_uring"
timeoutInMinutes: 180
pool:
vmImage: $(agentUbuntu)
steps:
- template: ../bazel.yml
parameters:
ciTarget: $(CI_TARGET)
envoyBuildFilterExample: $(ENVOY_FILTER_EXAMPLE)
cacheTestResults: ${{ parameters.cacheTestResults }}
repoFetchDepth: $(REPO_FETCH_DEPTH)
repoFetchTags: $(REPO_FETCH_TAGS)
publishTestResults: variables.PUBLISH_TEST_RESULTS
publishEnvoy: variables.PUBLISH_ENVOY
stepsPost:

# TODO(phlax): consolidate "fix" paths/jobs
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/tmp/lint-fixes"
artifactName: "$(CI_TARGET).fixes"
timeoutInMinutes: 10
condition: and(failed(), eq(variables['CI_TARGET'], 'bazel.clang_tidy'))

- job: coverage
displayName: "Linux x64"
dependsOn: []
Expand Down
8 changes: 8 additions & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,14 @@ config_setting(
values = {"define": "uhv=enabled"},
)

# This config setting enables using io_uring socket handle in tests and works
# in bazel.io_uring CI target. io_uring socket handle is in its early stage,
# and a separate warning-only CI target is responsilbe for check its status.
config_setting(
name = "enable_test_io_uring",
values = {"define": "test_io_uring=enabled"},
)

# Alias pointing to the selected version of BoringSSL:
# - BoringSSL FIPS from @boringssl_fips//:ssl,
# - non-FIPS BoringSSL from @boringssl//:ssl.
Expand Down
3 changes: 3 additions & 0 deletions bazel/envoy_internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ def envoy_copts(repository, test = False):
}) + select({
repository + "//bazel:uhv_enabled": ["-DENVOY_ENABLE_UHV"],
"//conditions:default": [],
}) + select({
repository + "//bazel:enable_test_io_uring": ["-DENVOY_TEST_IO_URING"],
"//conditions:default": [],
}) + envoy_select_hot_restart(["-DENVOY_HOT_RESTART"], repository) + \
envoy_select_disable_exceptions(["-fno-unwind-tables", "-fno-exceptions"], repository) + \
envoy_select_admin_html(["-DENVOY_ADMIN_HTML"], repository) + \
Expand Down
2 changes: 2 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ The `./ci/run_envoy_docker.sh './ci/do_ci.sh <TARGET>'` targets are:
* `bazel.fuzz <test>` &mdash; build and run a specified fuzz test or test dir under `-c dbg --config=asan-fuzzer` with clang. If specifying a single fuzz test, must use the full target name with "_with_libfuzzer" for `<test>`.
* `bazel.compile_time_options` &mdash; build Envoy and run tests with various compile-time options toggled to their non-default state, to ensure they still build.
* `bazel.compile_time_options <test>` &mdash; build Envoy and run a specified test or test dir with various compile-time options toggled to their non-default state, to ensure they still build.
* `bazel.io_uring` &mdash; build and run tests with io_uring enabled.
* `bazel.io_uring <test>` &mdash; build and run a specified test or test dir with io_uring enabled.
* `bazel.clang_tidy <files>` &mdash; build and run clang-tidy specified source files, if no files specified, runs against the diff with the last GitHub commit.
* `check_proto_format`&mdash; check configuration, formatting and build issues in API proto files.
* `fix_proto_format`&mdash; fix configuration, formatting and build issues in API proto files.
Expand Down
11 changes: 11 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,17 @@ case $CI_TARGET in
--test_arg="-runs=10"
;;

io_uring)
setup_clang_toolchain
echo "bazel build with tests and io_uring enabled"
echo "Building and testing envoy tests ${TEST_TARGETS[*]}"
bazel_with_collection \
test "${BAZEL_BUILD_OPTIONS[@]}" \
--define test_io_uring=enabled \
--remote_download_minimal \
"${TEST_TARGETS[@]}"
;;

gcc)
BAZEL_BUILD_OPTIONS+=("--test_env=HEAPCHECK=")
setup_gcc_toolchain
Expand Down
13 changes: 13 additions & 0 deletions test/integration/base_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "envoy/buffer/buffer.h"
#include "envoy/config/bootstrap/v3/bootstrap.pb.h"
#include "envoy/config/endpoint/v3/endpoint_components.pb.h"
#include "envoy/extensions/network/socket_interface/v3/default_socket_interface.pb.h"
#include "envoy/extensions/transport_sockets/quic/v3/quic_transport.pb.h"
#include "envoy/extensions/transport_sockets/tls/v3/cert.pb.h"
#include "envoy/service/discovery/v3/discovery.pb.h"
Expand Down Expand Up @@ -79,6 +80,18 @@ BaseIntegrationTest::BaseIntegrationTest(const InstanceConstSharedPtrFn& upstrea
config_helper_.addConfigModifier(
[&](envoy::config::bootstrap::v3::Bootstrap& bootstrap) -> void { bootstrap.clear_admin(); });
#endif

#ifdef ENVOY_TEST_IO_URING
config_helper_.addConfigModifier([&](envoy::config::bootstrap::v3::Bootstrap& bootstrap) {
bootstrap.set_default_socket_interface(
"envoy.extensions.network.socket_interface.default_socket_interface");
auto extension = bootstrap.add_bootstrap_extensions();
extension->set_name("envoy.extensions.network.socket_interface.default_socket_interface");
envoy::extensions::network::socket_interface::v3::DefaultSocketInterface interface;
interface.set_enable_io_uring(true);
extension->mutable_typed_config()->PackFrom(interface);
});
#endif
}

BaseIntegrationTest::BaseIntegrationTest(const InstanceConstSharedPtrFn& upstream_address_fn,
Expand Down

0 comments on commit a998995

Please sign in to comment.