Skip to content
Open
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
34 changes: 17 additions & 17 deletions .github/workflows/check_bazel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,52 @@ jobs:
fail-fast: false
matrix:
include:
- test: "//base/javacontainer/test:ExaStackTraceCleanerTest"
- test: "//javacontainer/test:ExaStackTraceCleanerTest"
name: "ExaStackTraceCleanerTest"
java_version: "openjdk-11-jdk"
- test: "//base/javacontainer/test:ExaStackTraceCleanerTest"
- test: "//javacontainer/test:ExaStackTraceCleanerTest"
name: "ExaStackTraceCleanerTest"
java_version: "openjdk-17-jdk"
- test: "//base/javacontainer/test:javacontainer-test-extractor-legacy"
- test: "//javacontainer/test:javacontainer-test-extractor-legacy"
name: "javacontainer-test-extractor-legacy"
java_version: "openjdk-11-jdk"
- test: "//base/javacontainer/test:javacontainer-test-extractor-v2"
- test: "//javacontainer/test:javacontainer-test-extractor-v2"
name: "javacontainer-test-extractor-v2"
java_version: "openjdk-11-jdk"
- test: "//base/javacontainer/script_options/..."
- test: "//javacontainer/script_options/..."
name: "javacontainer-script_options"
java_version: ""
- test: "//base/exaudflib/test/..."
- test: "//exaudflib/test/..."
name: "exaudflib"
java_version: ""
- test: "//base/script_options_parser/ctpg/..."
- test: "//script_options_parser/ctpg/..."
name: "script_options_parser_ctpg"
java_version: ""
- test: "//base/script_options_parser/legacy/..."
- test: "//script_options_parser/legacy/..."
name: "script_options_parser_legacy"
java_version: ""
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //base/javacontainer/test:javacontainer-test-extractor-legacy"
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //javacontainer/test:javacontainer-test-extractor-legacy"
name: "javacontainer-test-extractor-legacy-with-valgrind"
java_version: "openjdk-11-jdk"
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //base/javacontainer/test:javacontainer-test-extractor-v2"
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //javacontainer/test:javacontainer-test-extractor-v2"
name: "javacontainer-test-extractor-v2-with-valgrind"
java_version: "openjdk-11-jdk"
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //base/script_options_parser/ctpg/..."
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //script_options_parser/ctpg/..."
name: "script_options_parser_ctpg_with_valgrind"
java_version: ""
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //base/script_options_parser/legacy/..."
- test: "--run_under='valgrind --leak-check=yes' --config=valgrind //script_options_parser/legacy/..."
name: "script_options_parser_legacy_with_valgrind"
java_version: ""
- test: "--config=asan //base/javacontainer/test:javacontainer-test-extractor-legacy"
- test: "--config=asan //javacontainer/test:javacontainer-test-extractor-legacy"
name: "javacontainer-test-extractor-legacy-with-asan"
java_version: "openjdk-11-jdk"
- test: "--config=asan //base/javacontainer/test:javacontainer-test-extractor-v2"
- test: "--config=asan //javacontainer/test:javacontainer-test-extractor-v2"
name: "javacontainer-test-extractor-v2-with-asan"
java_version: "openjdk-11-jdk"
- test: "--config=asan //base/script_options_parser/ctpg/..."
- test: "--config=asan //script_options_parser/ctpg/..."
name: "script_options_parser_ctpg_with_asan"
java_version: ""
- test: "--config=asan //base/script_options_parser/legacy/..."
- test: "--config=asan //script_options_parser/legacy/..."
name: "script_options_parser_legacy_with_asan"
java_version: ""
steps:
Expand All @@ -98,7 +98,7 @@ jobs:
- name: Run tests
run: |
bazel test ${{ matrix.additional_args }} ${{ matrix.test }}
working-directory: ./exaudfclient/
working-directory: ./exaudfclient/base
env:
OPENSSL_LIBRARY_PREFIX: "/usr/lib/x86_64-linux-gnu"
OPENSSL_INCLUDE_PREFIX: "/usr/include/openssl"
Expand Down
2 changes: 1 addition & 1 deletion exaudfclient/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build --lockfile_mode=off --copt='-std=c++17' --force_pic --action_env=PROTOBUF_
build:benchmark --define benchmark=true
build:java --define java=true --action_env=JAVA_PREFIX
build:python --define python=true --action_env=NUMPY_PREFIX --action_env=PYTHON3_SYSPATH --action_env=PYTHON3_PREFIX --action_env=PYTHON3_VERSION
build:fast-binary --copt='-DCUSTOM_LIBEXAUDFLIB_PATH="/exaudf/base/libexaudflib_complete.so"' --define binary_type=fast_binary //:exaudfclient
build:fast-binary --define binary_type=fast_binary //:exaudfclient
build:slow-wrapper --define binary_type=slow_wrapper //:exaudfclient
build:static-binary //:exaudfclient_static
build:test-binaries --config=static-binary --config=slow-wrapper
Expand Down
112 changes: 34 additions & 78 deletions exaudfclient/BUILD
Original file line number Diff line number Diff line change
@@ -1,86 +1,42 @@

load("//:variables.bzl", "VM_ENABLED_DEFINES")

config_setting(
name = "benchmark",
define_values = {"benchmark": "true"},
)

config_setting(
name = "python",
define_values = {"python": "true"},
)

config_setting(
name = "java",
define_values = {"java": "true"},
)

config_setting(
name = "bash",
define_values = {"bash": "true"},
)

config_setting(
name = "fast_binary",
define_values = {
"binary_type": "fast_binary",
},
)

config_setting(
name = "slow_wrapper",
define_values = {
"binary_type": "slow_wrapper",
},
)

config_setting(
name = "valgrind_wrapper",
define_values = {
"wrapper_type": "valgrind_wrapper",
},
)

config_setting(
name = "valgrind_massif_wrapper",
define_values = {
"wrapper_type": "valgrind_massif_wrapper",
},
)

config_setting(
name = "stdout_to_bucketfs",
define_values = {
"wrapper_type": "stdout_to_bucketfs",
},
)


VM_ENABLED_DEPS=select({
"//:benchmark": ["//base/benchmark_container:benchmark_container"],
"@exaudfclient_base//:benchmark": ["@exaudfclient_base//benchmark_container:benchmark_container"],
"//conditions:default": []
}) + select({
"//:java": ["//base/javacontainer:javacontainer"],
"@exaudfclient_base//:java": ["@exaudfclient_base//javacontainer:javacontainer"],
"//conditions:default": []
}) + select({
"//:bash": ["//base/streaming_container:streamingcontainer"],
"@exaudfclient_base//:bash": ["@exaudfclient_base//streaming_container:streamingcontainer"],
"//conditions:default": []
})

VM_PYTHON3_DEPS=select({
"//:python": ["//base/python/python3:pythoncontainer"],
"@exaudfclient_base//:python": ["@exaudfclient_base//python/python3:pythoncontainer"],
"//conditions:default": []
})


genrule(
name = "exaudflib_output_path_header",
srcs = ["@exaudfclient_base//:libexaudflib_complete.so"],
outs = ["exaudf_lib_output_path.h"],
cmd = '''
echo "#define CUSTOM_LIBEXAUDFLIB_PATH \\"/exaudf/external/$(rlocationpath @exaudfclient_base//:libexaudflib_complete.so)\\"" > $@
''',
)

cc_binary(
name = "exaudfclient_bin",
srcs = ["exaudfclient.cc", "//base:load_dynamic"],
srcs = ["exaudfclient.cc", "@exaudfclient_base//:load_dynamic", "//:exaudflib_output_path_header"],
linkopts = ["-ldl"], # needed for dynamicly loading libexaudflib_complete.so into another linker namespace
deps = ["//base/exaudflib:header", "//base/utils:utils"]+VM_ENABLED_DEPS+VM_PYTHON3_DEPS+
["//base/exaudflib:exaudflib-deps"],
deps = ["@exaudfclient_base//exaudflib:header", "@exaudfclient_base//utils:utils"]+VM_ENABLED_DEPS+VM_PYTHON3_DEPS+
["@exaudfclient_base//exaudflib:exaudflib-deps"],
defines = VM_ENABLED_DEFINES,
data = ["//base:libexaudflib_complete.so"]
data = ["@exaudfclient_base//:libexaudflib_complete.so"]
)

## The purpose of the static binaries is to verify if the linker namespace test work correctly.
Expand All @@ -92,19 +48,19 @@ cc_binary(
## Besides this the test under test/python3/all/linker_namespace.py checks the normal build, which expects
## not to find any occurence of the dependencies (protobuf/zmq) in the primary linker namespace.
##
## We need to explicitly declare the dependency of protobuf/zmq here, as the exaudflib is a static lib (//base/exaudflib:exaudflib)
## We need to explicitly declare the dependency of protobuf/zmq here, as the exaudflib is a static lib (//exaudflib:exaudflib)
## and hence does not contain dependency information. We cannot declare the shared lib (:exaudflib_complete.so)
## as dependency as it is a binary for bazel.

cc_binary(
name = "exaudfclient_static_bin",
srcs = ["exaudfclient.cc", "//base:load_dynamic"],
srcs = ["exaudfclient.cc", "@exaudfclient_base//:load_dynamic", "//:exaudflib_output_path_header"],
linkopts = ["-ldl"], # needed for dynamicly loading libexaudflib_complete.so into another linker namespace
deps = ["//base/exaudflib:header", "//base/utils:utils"]+VM_ENABLED_DEPS+VM_PYTHON3_DEPS+
["//base/exaudflib:exaudflib-deps"] +
deps = ["@exaudfclient_base//exaudflib:header", "@exaudfclient_base//utils:utils"]+VM_ENABLED_DEPS+VM_PYTHON3_DEPS+
["@exaudfclient_base//exaudflib:exaudflib-deps"] +
[ "@zmq//:zmq", "@protobuf//:protobuf"],
defines = VM_ENABLED_DEFINES,
data = ["//base:libexaudflib_complete.so"],
data = ["@exaudfclient_base//:libexaudflib_complete.so"],
)

# Workarround for the hardcoded paths in exaudfclient for libexaudflib_complete.so and python_ext_dataframe.cc
Expand All @@ -118,40 +74,40 @@ cc_binary(
sh_library(
name = "wrapper_generator_bin",
srcs=select({
"//:valgrind_wrapper": ["//base:create_binary_wrapper_valgrind.sh"],
"//:valgrind_massif_wrapper": ["//base:create_binary_wrapper_valgrind_massif.sh"],
"//:stdout_to_bucketfs": ["//base:create_binary_wrapper_stdout_to_bucketfs.sh"],
"@exaudfclient_base//:valgrind_wrapper": ["@exaudfclient_base//:create_binary_wrapper_valgrind.sh"],
"@exaudfclient_base//:valgrind_massif_wrapper": ["@exaudfclient_base//:create_binary_wrapper_valgrind_massif.sh"],
"@exaudfclient_base//:stdout_to_bucketfs": ["@exaudfclient_base//:create_binary_wrapper_stdout_to_bucketfs.sh"],
"//conditions:default": ["//base:create_binary_wrapper.sh"]
})
)

SLOW_WRAPPER_BINARY="""$(location //:wrapper_generator_bin) "$(location exaudfclient_bin)" "$(location exaudfclient)" "$(location //base:exaudfclient.template.sh)" """
SLOW_WRAPPER_BINARY="""$(location //:wrapper_generator_bin) "$(location exaudfclient_bin)" "$(location exaudfclient)" "$(location @exaudfclient_base//:exaudfclient.template.sh)" """
FAST_BINARY="""cp "$(location exaudfclient_bin)" "$(location exaudfclient)" """
CREATE_BINARY_SCRIPT=select({
"//:fast_binary": FAST_BINARY,
"//:slow_wrapper": SLOW_WRAPPER_BINARY,
"@exaudfclient_base//:fast_binary": FAST_BINARY,
"@exaudfclient_base//:slow_wrapper": SLOW_WRAPPER_BINARY,
"//conditions:default": FAST_BINARY
})
genrule(
name = "exaudfclient",
cmd = CREATE_BINARY_SCRIPT,
outs = ["exaudfclient"],
srcs = [":exaudfclient_bin", "//base:libexaudflib_complete.so", "//base:exaudfclient.template.sh", "//:wrapper_generator_bin"],
srcs = [":exaudfclient_bin", "@exaudfclient_base//:libexaudflib_complete.so", "@exaudfclient_base//:exaudfclient.template.sh", "//:wrapper_generator_bin"],
output_to_bindir = True
)

SLOW_WRAPPER_STATIC_BINARY="""$(location //:wrapper_generator_bin) "$(location exaudfclient_static_bin)" "$(location exaudfclient_static)" "$(location //base:exaudfclient.template.sh)" """
SLOW_WRAPPER_STATIC_BINARY="""$(location //:wrapper_generator_bin) "$(location exaudfclient_static_bin)" "$(location exaudfclient_static)" "$(location @exaudfclient_base//:exaudfclient.template.sh)" """
FAST_BINARY_STATIC="""cp "$(location exaudfclient_static_bin)" "$(location exaudfclient_static)" """
CREATE_STATIC_BINARY_SCRIPT=select({
"//:fast_binary": FAST_BINARY_STATIC,
"//:slow_wrapper": SLOW_WRAPPER_STATIC_BINARY,
"@exaudfclient_base//:fast_binary": FAST_BINARY_STATIC,
"@exaudfclient_base//:slow_wrapper": SLOW_WRAPPER_STATIC_BINARY,
"//conditions:default": FAST_BINARY_STATIC
})

genrule(
name = "exaudfclient_static",
cmd = CREATE_STATIC_BINARY_SCRIPT,
outs = ["exaudfclient_static"],
srcs = [":exaudfclient_static_bin", "//base:libexaudflib_complete.so", "//base:exaudfclient.template.sh", "//:wrapper_generator_bin"],
srcs = [":exaudfclient_static_bin", "@exaudfclient_base//:libexaudflib_complete.so", "@exaudfclient_base//:exaudfclient.template.sh", "//:wrapper_generator_bin"],
output_to_bindir = True
)
31 changes: 30 additions & 1 deletion exaudfclient/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
module(name="exaudfclient", version = "1.0")

include("//base:base.MODULE.bazel")
bazel_dep(name = "exaudfclient_base", version = "1.0.0")
local_path_override(module_name="exaudfclient_base", path="base")
bazel_dep(name = "rules_jvm_external", version = "6.2")

numpy_local_repository = use_repo_rule("@exaudfclient_base//:python_repository.bzl", "numpy_local_repository")
numpy_local_repository(name = "numpy")

python_local_repository = use_repo_rule("@exaudfclient_base//:python_repository.bzl", "python_local_repository")
python_local_repository(name = "python3", python_version="python3")

zmq_local_repository = use_repo_rule("@exaudfclient_base//:zmq_repository.bzl", "zmq_local_repository")
zmq_local_repository(name = "zmq")

protobuf_local_repository = use_repo_rule("@exaudfclient_base//:protobuf_repository.bzl", "protobuf_local_repository")
protobuf_local_repository(name = "protobuf")

java_local_repository = use_repo_rule("@exaudfclient_base//:java_repository.bzl", "java_local_repository")
java_local_repository(name = "java")


maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"com.exasol:udf-api-java:1.0.5",
],
repositories = [
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven")
19 changes: 19 additions & 0 deletions exaudfclient/base/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build --lockfile_mode=off --copt='-std=c++17' --force_pic --action_env=PROTOBUF_BIN --action_env=PROTOBUF_LIBRARY_PREFIX --action_env=PROTOBUF_INCLUDE_PREFIX
build:benchmark --define benchmark=true
build:java --define java=true --action_env=JAVA_PREFIX
build:python --define python=true --action_env=NUMPY_PREFIX --action_env=PYTHON3_SYSPATH --action_env=PYTHON3_PREFIX --action_env=PYTHON3_VERSION
build:debug-build --sandbox_debug --config=verbose
build:no-symlinks --symlink_prefix=/
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -O1
build:asan --copt -g
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
build:asan -c dbg
build:valgrind --copt -O1
build:valgrind -c dbg
build:valgrind --copt -g
build:valgrind --strip=never
build:valgrind --copt -DVALGRIND_ACTIVE
Loading
Loading