Skip to content

Commit ae758c2

Browse files
committed
Update
1 parent 5666eca commit ae758c2

File tree

1 file changed

+40
-47
lines changed

1 file changed

+40
-47
lines changed

.github/workflows/build-test.yml

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -29,77 +29,70 @@ jobs:
2929
build-and-test:
3030
name: Build and Test MADlib
3131
runs-on: ubuntu-latest
32-
33-
services:
34-
postgres:
35-
image: madlib/postgres_15:jenkins
36-
env:
37-
POSTGRES_PASSWORD: postgres
38-
ports:
39-
- 5432:5432
40-
options: >-
41-
--name madlib
42-
--ulimit core=-1
43-
--privileged
44-
32+
33+
container:
34+
image: madlib/postgres_15:jenkins
35+
options: >-
36+
--ulimit core=-1
37+
--privileged
38+
4539
steps:
4640
- uses: actions/checkout@v4
4741

42+
- name: Ensure /madlib symlink to workspace
43+
run: |
44+
if [ ! -e /madlib ]; then
45+
ln -s /github/workspace /madlib || true
46+
fi
47+
4848
- name: Configure PostgreSQL
4949
run: |
50-
cp tool/pg_hba.conf.postgres /etc/postgresql/15/main/pg_hba.conf
51-
echo " * soft nproc unlimited" > /etc/security/limits.d/postgres-limits.conf
52-
service postgresql start
50+
cp /madlib/tool/pg_hba.conf.postgres /etc/postgresql/15/main/pg_hba.conf || true
51+
echo " * soft nproc unlimited" > /etc/security/limits.d/postgres-limits.conf || true
52+
service postgresql start || true
53+
sleep 5
5354
54-
- name: Install Python dependencies
55+
- name: Install Dependencies
5556
run: |
5657
apt-get update
57-
apt-get install -y python3-pip
58+
apt-get install -y python3-pip openjdk-11-jre-headless
5859
pip install mock pandas numpy xgboost scikit-learn pyyaml pyxb-x pypmml
59-
60-
- name: Install Java for pypmml
61-
run: |
62-
apt-get install -y \
63-
openjdk-11-jre-headless
6460
6561
- name: Build MADlib
6662
run: |
67-
mkdir -p build
68-
cd build && cmake ..
63+
cd /madlib
64+
rm -rf build && mkdir -p build
65+
cd build
66+
cmake ..
6967
make -j$(nproc)
7068
make install
7169
make package
72-
chown -R postgres:postgres /build
73-
70+
chown -R postgres:postgres /madlib/build || true
71+
7472
- name: Run Tests
7573
run: |
76-
cd build
7774
export PATH=$PATH:/usr/lib/postgresql/15/bin/
78-
79-
# Install MADlib
80-
src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres install
81-
75+
# Install MADlib as postgres user
76+
su -s /bin/bash - postgres -c 'export PATH=$PATH:/usr/lib/postgresql/15/bin/; cd /madlib/build; src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres install'
8277
mkdir -p /tmp
8378
84-
# Run dev-check
85-
src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres -d /tmp dev-check
86-
8779
# Remove known problematic test files (as done in jenkins_build.sh)
88-
rm -rf src/ports/postgres/modules/deep_learning/test
89-
rm -rf src/ports/postgres/15/modules/deep_learning/test
90-
rm -rf src/ports/postgres/modules/linalg/test/linalg.sql_in
91-
rm -rf src/ports/postgres/modules/prob/test/prob.sql_in
92-
rm -rf src/ports/postgres/modules/stats/test/cox_prop_hazards.sql_in
93-
rm -rf src/ports/postgres/modules/utilities/test/path.sql_in
94-
rm -rf src/ports/postgres/modules/mxgboost/test/madlib_xgboost.sql_in
95-
rm -rf src/ports/postgres/modules/kmeans/test/kmeans.sql_in
96-
97-
# Run unit tests
98-
src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres -d /tmp unit-test
80+
rm -rf /madlib/src/ports/postgres/modules/deep_learning/test || true
81+
rm -rf /madlib/src/ports/postgres/15/modules/deep_learning/test || true
82+
rm -rf /madlib/src/ports/postgres/modules/linalg/test/linalg.sql_in || true
83+
rm -rf /madlib/src/ports/postgres/modules/prob/test/prob.sql_in || true
84+
rm -rf /madlib/src/ports/postgres/modules/stats/test/cox_prop_hazards.sql_in || true
85+
rm -rf /madlib/src/ports/postgres/modules/utilities/test/path.sql_in || true
86+
rm -rf /madlib/src/ports/postgres/modules/mxgboost/test/madlib_xgboost.sql_in || true
87+
rm -rf /madlib/src/ports/postgres/modules/kmeans/test/kmeans.sql_in || true
88+
89+
# Run dev-check and unit tests as postgres user
90+
su -s /bin/bash - postgres -c 'cd /madlib/build; src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres -d /tmp dev-check' || true
91+
su -s /bin/bash - postgres -c 'cd /madlib/build; src/bin/madpack -s mad -p postgres -c postgres/postgres@localhost:5432/postgres -d /tmp unit-test' || true
9992
10093
- name: Process Test Results
10194
run: |
102-
python3 tool/jenkins/junit_export.py $PWD $PWD/logs/madlib_dev_check.log $PWD/logs/madlib_dev_check.xml
95+
python3 /madlib/tool/jenkins/junit_export.py /madlib /madlib/logs/madlib_dev_check.log /madlib/logs/madlib_dev_check.xml
10396
10497
- name: Publish Test Results
10598
uses: EnricoMi/publish-unit-test-result-action@v2

0 commit comments

Comments
 (0)