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

Rebuild Babelfish 1.1 RC2 #4

Open
wants to merge 5 commits into
base: BABEL_1_X_DEV__PG_13_5
Choose a base branch
from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
155 changes: 155 additions & 0 deletions .github/workflows/jdbc_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: JDBC Unit Tests
on:
push:
branches:
- BABEL_1_X_DEV__PG_13_5
pull_request:
branches:
- BABEL_1_X_DEV__PG_13_5

env:
ANTLR4_VERSION: 4.9.3

jobs:
extension-tests:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Requirements
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update && sudo apt install -y --no-install-recommends \
build-essential flex libxml2-dev libxml2-utils \
libxslt-dev libssl-dev \
libreadline-dev zlib1g-dev libldap2-dev libpam0g-dev gettext \
uuid uuid-dev cmake lld apt-utils \
libossp-uuid-dev gnulib bison \
xsltproc icu-devtools libicu66 libicu-dev gawk curl \
openjdk-8-jre openssl g++ \
libssl-dev python-dev libpq-dev \
pkg-config unzip libutfcpp-dev gnupg mssql-tools unixodbc-dev
export PATH=/opt/mssql-tools/bin:$PATH
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
check-latest: true
- name: Copy ANTLR jar file
run: |
cd contrib/babelfishpg_tsql/antlr/thirdparty/antlr/
sudo cp antlr-${ANTLR4_VERSION}-complete.jar /usr/local/lib
- name: Compile ANTLR
run: |
cd ..
wget http://www.antlr.org/download/antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip
unzip -d antlr4 antlr4-cpp-runtime-${ANTLR4_VERSION}-source.zip
cd antlr4
mkdir build && cd build
cmake .. -D ANTLR_JAR_LOCATION=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_DEMO=True
make -j 4
sudo make install
# cp /usr/local/lib/libantlr4-runtime.so.${ANTLR4_VERSION} ~/postgres/lib/
- name: Build, and binary installation
run: |
# CFLAGS="${CFLAGS:--Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}"
./configure CFLAGS="-ggdb" \
--prefix=$HOME/postgres/ \
--enable-debug \
--with-ldap \
--with-libxml \
--with-pam \
--with-uuid=ossp \
--enable-nls \
--with-libxslt \
--with-icu \
--with-extra-version=" Babelfish for PostgreSQL"
# ./configure --prefix=$HOME/postgres/ --with-python PYTHON=/usr/bin/python2.7 --enable-debug CFLAGS="-ggdb" --with-libxml --with-uuid=ossp --with-icu
make clean && make DESTDIR=~/postgres/ -j 4 2>error.txt
# make check
sudo make install
- name: Build antlr
run: |
export ANTLR4_JAVA_BIN=/usr/bin/java
export ANTLR4_RUNTIME_LIBRARIES=/usr/include/antlr4-runtime
export ANTLR_EXECUTABLE=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar
export ANTLR_RUNTIME=../antlr4
#PG_SRC=~/work/postgresql_modified_for_babelfish
export PG_SRC=/home/runner/work/postgresql_modified_for_babelfish/postgresql_modified_for_babelfish/
export PG_CONFIG=~/postgres/bin/pg_config
cmake=$(which cmake)

# Copy runtime in Postgres lib
sudo cp /usr/local/lib/libantlr4-runtime.so.${ANTLR4_VERSION} ~/postgres/lib

cd ${PG_SRC}/contrib/babelfishpg_tsql/antlr
cmake -Wno-dev .
- name: Compile and Install Extensions
run: |
export ANTLR4_JAVA_BIN=/usr/bin/java
export ANTLR4_RUNTIME_LIBRARIES=/usr/include/antlr4-runtime
export ANTLR_EXECUTABLE=/usr/local/lib/antlr-${ANTLR4_VERSION}-complete.jar
export ANTLR_RUNTIME=../antlr4
export PG_SRC=/home/runner/work/postgresql_modified_for_babelfish/postgresql_modified_for_babelfish/
export PG_CONFIG=~/postgres/bin/pg_config
cmake=$(which cmake)

cd $PG_SRC/contrib/ && make && sudo make install
- name: Install extensions
run: |
cd ~
sudo chown -R runner: ~/postgres
~/postgres/bin/initdb -D ~/postgres/data/ -E "UTF8"
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile start
cd postgres/data
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" postgresql.conf
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'babelfishpg_tds'/g" postgresql.conf
ipaddress=$(ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{ print $2}')
sudo echo "host all all $ipaddress/32 trust" >> pg_hba.conf
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile restart
sudo ~/postgres/bin/psql -d postgres -U runner -c "CREATE USER jdbc_user WITH SUPERUSER CREATEDB CREATEROLE PASSWORD '12345678' INHERIT;"
sudo ~/postgres/bin/psql -d postgres -U runner -c "DROP DATABASE IF EXISTS jdbc_testdb;"
sudo ~/postgres/bin/psql -d postgres -U runner -c "CREATE DATABASE jdbc_testdb OWNER jdbc_user;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "set allow_system_table_mods = on;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "CREATE EXTENSION IF NOT EXISTS "babelfishpg_tds" CASCADE;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "GRANT ALL ON SCHEMA sys to jdbc_user;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER USER jdbc_user CREATEDB;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tsql.database_name = 'jdbc_testdb';"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER SYSTEM SET babelfishpg_tds.set_db_session_property = true;"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "SELECT pg_reload_conf();"
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "CALL sys.initialize_babelfish('jdbc_user');"
sqlcmd -S localhost -U jdbc_user -P 12345678 -Q "SELECT @@version GO"
- name: Run JDBC test framework
timeout-minutes: 15
run: |
cd contrib/test/JDBC/
mvn test
- name: Upload log
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: postgres-log
path: ~/postgres/data/logfile
# The test summary files contain paths with ':' characters, which is not allowed with the upload-artifact actions
- name: Rename test summary files
if: ${{ failure() }}
run: |
cd contrib/test/JDBC/Info
timestamp=`ls -Art | tail -n 1`
cd $timestamp
mv $timestamp.diff ../output-diff.diff
mv "$timestamp"_runSummary.log ../run-summary.log
- name: Upload run summary
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: run-summary.log
path: contrib/test/JDBC/Info/run-summary.log
- name: Upload output diff
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: output-diff.diff
path: contrib/test/JDBC/Info/output-diff.diff
34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

Loading