Skip to content

Commit

Permalink
Created installUdfClientDeps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Oct 15, 2024
1 parent c6ca998 commit 53c9606
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 23 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/check_bazel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
USE_BAZEL_VERSION: 7.2.1
UDF_CLIENT_ENV_FILE: /tmp/.udf_client_env
jobs:
build:
runs-on: ubuntu-22.04
Expand All @@ -16,26 +17,14 @@ jobs:
- name: Search for duplicated error codes
run: bash find_duplicate_error_codes.sh

- name: Install bazel
run: |
curl -L -o bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
chmod +x bazel
- name: Install JDK and ZMQ
- name: Install UDF Client Dependencies
run: |
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk libzmq3-dev python3 protobuf-compiler
bash scripts/installUdfClientDeps.sh "$UDF_CLIENT_ENV_FILE"
- name: Build
run: |
bazel build --lockfile_mode=off --config no-tty -c dbg --config python --config fast-binary --verbose_failures
source "$UDF_CLIENT_ENV_FILE"
bazel build --lockfile_mode=off --config no-tty -c dbg --config python --config java --config fast-binary --verbose_failures
working-directory: ./exaudfclient/
env:
PYTHON3_PREFIX: /usr
PYTHON3_VERSION: python3.10
ZMQ_LIBRARY_PREFIX: /usr/lib/x86_64-linux-gnu/
ZMQ_INCLUDE_PREFIX: /usr/include
PROTOBUF_LIBRARY_PREFIX: /usr/lib/x86_64-linux-gnu
PROTOBUF_INCLUDE_PREFIX: /usr/include/
PROTOBUF_BIN: /usr/bin/protoc

tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,16 +64,12 @@ jobs:
name: "script_options_parser_legacy_with_asan"
steps:
- uses: actions/checkout@v4
- name: Install bazel
run: |
curl -L -o bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
chmod +x bazel
- name: Install JDK and ZMQ
- name: Install UDF Client Dependencies
run: |
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk libzmq3-dev valgrind
bash scripts/installUdfClientDeps.sh "$UDF_CLIENT_ENV_FILE"
- name: Run tests
run: |
source "$UDF_CLIENT_ENV_FILE"
bazel test ${{ matrix.additional_args }} ${{ matrix.test }}
working-directory: ./exaudfclient/

Expand Down
56 changes: 56 additions & 0 deletions scripts/installUdfClientDeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -euo pipefail

source /etc/os-release

if [ "$VERSION_CODENAME" != "jammy" ]; then
echo "Script can only work correctly under Ubuntu 22.04"
exit 1
fi

if [ $# -ne 1 ];
then
me=$(basename "$0")
echo "Usage: '$me <out_env_file>'. For example: '$me .env'. <out_env_file> will contain necessary environment variables to run 'bazel build'."
exit 1
fi

OUT_ENV_FILE="$1"

export DEBIAN_FRONTEND=noninteractive

apt update
apt install -y curl openjdk-11-jdk libzmq3-dev python3 protobuf-compiler build-essential python3-pip libpcre3-dev chrpath tar locales coreutils libssl-dev

BAZEL_PACKAGE_VERSION="7.2.1"
BAZEL_PACKAGE_FILE="bazel_$BAZEL_PACKAGE_VERSION-linux-x86_64.deb"
BAZEL_PACKAGE_URL="https://github.com/bazelbuild/bazel/releases/download/$BAZEL_PACKAGE_VERSION/$BAZEL_PACKAGE_FILE"


curl -L --output "$BAZEL_PACKAGE_FILE" "$BAZEL_PACKAGE_URL" && \
apt install -y "./$BAZEL_PACKAGE_FILE" && \
rm "$BAZEL_PACKAGE_FILE" && \

apt -y clean
apt -y autoremove


curl -L -o swig-2.0.4.tar.gz https://exasol-script-languages-dependencies.s3.eu-central-1.amazonaws.com/swig-2.0.4.tar.gz && \
tar zxf swig-2.0.4.tar.gz && \
(cd swig-2.0.4 && ./configure --prefix=/usr && make && make install) && \
rm -rf swig-2.0.4 swig-2.0.4.tar.gz


pip install numpy


cat >"$OUT_ENV_FILE" <<EOL
export PYTHON3_PREFIX=/usr
export PYTHON3_VERSION=python3.10
export ZMQ_LIBRARY_PREFIX=/usr/lib/x86_64-linux-gnu/
export ZMQ_INCLUDE_PREFIX=/usr/include
export PROTOBUF_LIBRARY_PREFIX=/usr/lib/x86_64-linux-gnu
export PROTOBUF_INCLUDE_PREFIX=/usr/include/
export PROTOBUF_BIN=/usr/bin/protoc
EOL

0 comments on commit 53c9606

Please sign in to comment.