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

Introduce Auto-scaling Based on CPU Load for Triangle Count Operation #241

Merged
merged 144 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
d4713f4
Remove make_pair when inserting to map
thevindu-w Feb 2, 2024
a676125
Make K8sWorkerController singleton
thevindu-w Feb 3, 2024
6c97b1a
Support having multiple partitions on same worker
thevindu-w Feb 3, 2024
cd3eefc
Keep a list of workers in K8sWorkerController
thevindu-w Feb 7, 2024
3373820
Prevent asking for sudo password in test-k8s.sh
thevindu-w Feb 7, 2024
6e46fcc
Use workerList from K8sWorkerController in k8s mode
thevindu-w Feb 7, 2024
dccd46b
Cleanup unused files and properties
thevindu-w Feb 8, 2024
3304012
Fix unit test failure
Ishad-M-I-M Feb 9, 2024
35c042e
Bug fix in TriangleCountExecutor and JasmineGraphServer
thevindu-w Feb 11, 2024
8cb4e0c
Added code in perfUtil for pushing jobs
Ishad-M-I-M Jan 26, 2024
5932fb3
Fixed the ip address in hosts.txt file
ArunaSenanayake Dec 24, 2023
61d0476
Made some code refactoring
Ishad-M-I-M Jan 26, 2024
dac30f6
Changed the NMON run command
ArunaSenanayake Jan 19, 2024
a7a0121
Added more performance metrics
Ishad-M-I-M Jan 26, 2024
72d230a
Improve get swap functions
thevindu-w Jan 21, 2024
8d7c137
Improve get network usage functions
thevindu-w Jan 21, 2024
70d6de6
Improve get thread count function
thevindu-w Jan 21, 2024
d10a1b4
Add get socket count function
thevindu-w Jan 21, 2024
06a0acb
Replace hardcoded urls
Ishad-M-I-M Jan 26, 2024
1227dd5
Move send job function to utils and remove redundant code
Ishad-M-I-M Jan 26, 2024
cb3b8a0
Fix errors after rebase
Ishad-M-I-M Feb 6, 2024
92a8782
Add pushgateway definition file
Ishad-M-I-M Feb 6, 2024
188685b
Add prometheus definition file
Ishad-M-I-M Feb 6, 2024
8de1c7d
start pushgateway and prometheus in start-k8s
Ishad-M-I-M Feb 7, 2024
a52fccc
Fix unit test image build failure
Ishad-M-I-M Feb 9, 2024
5cd2798
Fix style problems
Ishad-M-I-M Feb 9, 2024
c03075e
Fix unit test build failure
thevindu-w Feb 9, 2024
c6a4f4c
Add script option to clear all jasminegraph related objects
Ishad-M-I-M Feb 9, 2024
c93a155
Added performance metric retrieval logic
Ishad-M-I-M Feb 11, 2024
4704c00
Fix style check issues
Ishad-M-I-M Feb 11, 2024
d3f2260
Fix issues
Ishad-M-I-M Feb 11, 2024
e26abdd
Fix getCpuUsage
thevindu-w Feb 12, 2024
7882b65
Get jasminegraph properties from config map in k8s
Ishad-M-I-M Feb 13, 2024
5552c64
Select worker with lowest load and Fix build failure
thevindu-w Feb 13, 2024
05bcefc
Modified the metric retrieval function implementation
ArunaSenanayake Feb 13, 2024
e85d925
Create configs config map
Ishad-M-I-M Feb 14, 2024
43c83ca
Fix style checks
Ishad-M-I-M Feb 14, 2024
ca41c64
Fix unit test build failure
Ishad-M-I-M Feb 14, 2024
6c65a6f
Fix job name in k8s implementation
Ishad-M-I-M Feb 14, 2024
70123a1
Enable/Disable auto-scaling from properties
thevindu-w Feb 23, 2024
8997cc8
Fix unit test build failure
thevindu-w Feb 23, 2024
8861634
Remove unnecessery linking Python
thevindu-w Feb 23, 2024
97cb740
Remove duplicate implementations of sendFileThroughService
thevindu-w Feb 23, 2024
9af82e4
Defer SchedulerService until DDL execution
thevindu-w Feb 23, 2024
550c12f
Use access() in Utils::copyToDirectory() to check if directory exists
thevindu-w Feb 24, 2024
468fbc5
Add option to check file existance in workers
thevindu-w Feb 24, 2024
2befb8a
Add instance service command to push file from worker to worker
thevindu-w Feb 25, 2024
ee9ae11
Create DataPublishers only if needed
thevindu-w Feb 28, 2024
667be44
Remove unused functions and fix busy-waiting loop
thevindu-w Feb 29, 2024
e8e0c3e
Fix: no return statement in getWorkerClients()
thevindu-w Feb 29, 2024
283d122
Remove successful curl logs
Ishad-M-I-M Mar 1, 2024
d629f4b
Get profile from global variable and use worker info from K8sWorkerCo…
thevindu-w Mar 1, 2024
cf6f9e3
Utils::createDirectory to create with parent directories if missing
thevindu-w Mar 1, 2024
58566d8
Create aggregate directory if missing
thevindu-w Mar 1, 2024
715067b
Limit resource usage of containers
Ishad-M-I-M Mar 1, 2024
692158f
Remove node affinity on creating workers
Ishad-M-I-M Mar 2, 2024
02af3ab
Add delay to tests until frontend listens
thevindu-w Mar 2, 2024
32e2817
Decide partition count using edge count
thevindu-w Mar 2, 2024
041e4ee
Get file size before receiving file in file transfer service
thevindu-w Mar 2, 2024
2832ea7
send close command to worker before closing connection
thevindu-w Mar 2, 2024
cd4f8c7
Get last 5 seconds CPU usage
thevindu-w Mar 2, 2024
da8ddbc
prevent memory leaks after loadCentralStore
thevindu-w Mar 4, 2024
9dbee45
Fix memory leaks
thevindu-w Mar 4, 2024
eeff1bb
Convert push file command to push partition
Ishad-M-I-M Mar 6, 2024
93ea47b
Reduce memory leaks
thevindu-w Mar 6, 2024
2d4a62e
Implement function to initiate partition transfer
Ishad-M-I-M Mar 7, 2024
ff84969
Assign partitions for all workers in round robin manner
Ishad-M-I-M Mar 8, 2024
5d5f81b
Implement allocate plan
Ishad-M-I-M Mar 11, 2024
7fb81d6
Implement alloc_net_plan
thevindu-w Mar 11, 2024
8217d76
Implement scale_up function in TriangleCountExecutor
thevindu-w Mar 11, 2024
0d22d53
Use partitionMap in aggregateCentralStoreTriangles to get partitions …
thevindu-w Mar 11, 2024
0f3dc85
retry mkdir if failed
thevindu-w Mar 12, 2024
688f54e
Implement auto-scaling trian with optimal partition allocation
thevindu-w Mar 12, 2024
29b0e6a
Fix bugs in trian auto-scale functions
thevindu-w Mar 12, 2024
315fe9b
Initialize Utils::propertiesMap only once
thevindu-w Mar 12, 2024
d159e17
Wait until propertiesMap is initialized by other thread
thevindu-w Mar 13, 2024
b168214
optimizations
thevindu-w Mar 13, 2024
8f94e46
Implement scale up function
Ishad-M-I-M Mar 13, 2024
34c8105
fix memory leaks
thevindu-w Mar 13, 2024
a78258f
Add script to build minimal docker image
thevindu-w Mar 13, 2024
3b56365
Remove unused method
thevindu-w Mar 13, 2024
78bff54
Return map instead of a vector for the create new workers in scale up
Ishad-M-I-M Mar 13, 2024
c968f81
Keep track of active worker ids
Ishad-M-I-M Mar 13, 2024
9e69a62
Call Utils::transferPartition and update metadb on transfer partitions
thevindu-w Mar 13, 2024
e0fbaa9
Use K8sWorkerController::scaleUp in triangle count scaling function
thevindu-w Mar 13, 2024
411dd75
Bug fix
thevindu-w Mar 13, 2024
eb5bb88
Bug fix
thevindu-w Mar 13, 2024
c11f626
Get rid of spawning workers sequentially at beginning
Ishad-M-I-M Mar 14, 2024
aa02498
Enable scaling property
Ishad-M-I-M Mar 14, 2024
d9577f2
Mount aggregate folder of the master deployment
Ishad-M-I-M Mar 14, 2024
526379b
Implement functions to create volumes per worker
Ishad-M-I-M Mar 14, 2024
8bbfb5e
Integrate worker volume creation
Ishad-M-I-M Mar 14, 2024
4fe0553
Make prometheus a NodePort service
Ishad-M-I-M Mar 14, 2024
c3f73a6
Bug fix
Ishad-M-I-M Mar 14, 2024
b44271b
Use partition combinations instead of worker combinations in triangle…
thevindu-w Mar 14, 2024
6ddb7df
Move global triangleTree to per-job level
thevindu-w Mar 14, 2024
a0a8e54
Prevent duplicate rows from SELECT from metadb in triangle count exec…
thevindu-w Mar 14, 2024
eb22233
Fix partition combination bug
thevindu-w Mar 14, 2024
3256e28
Reduce performance metric sending interval
Ishad-M-I-M Mar 14, 2024
84525e3
transfer partitions in a thread
thevindu-w Mar 14, 2024
c6a2093
Allocate partitions even if load is full
thevindu-w Mar 14, 2024
b349910
Increase timeout period for worker spawning
Ishad-M-I-M Mar 15, 2024
b6c3cd2
Use fork() for instance service session and instance file transfer se…
thevindu-w Mar 15, 2024
5ef930f
Remove unnecessary logs
thevindu-w Mar 15, 2024
e76ec30
Fix returning map for newly spawned workers
Ishad-M-I-M Mar 16, 2024
387ba63
Move auto scaling flag to configMap
Ishad-M-I-M Mar 16, 2024
ff7845c
Create release workflow
Ishad-M-I-M Feb 23, 2024
4fd7916
Change the image name in the properties file upon release
Ishad-M-I-M Feb 24, 2024
4623182
Update release workflow
Ishad-M-I-M Feb 26, 2024
2c2ccdf
Add minimal image build step to release workflow
Ishad-M-I-M Feb 29, 2024
608a6ed
Change resource limits
Ishad-M-I-M Mar 14, 2024
a61fb81
Add new logs
Ishad-M-I-M Mar 20, 2024
6f82979
Fix trian return partial result
thevindu-w Mar 20, 2024
0c4603e
Fix duplicating worker id
thevindu-w Mar 21, 2024
7c78d6c
Add time and pid to log messages
thevindu-w Mar 22, 2024
338843a
Synchronize trian scheduler
thevindu-w Mar 22, 2024
24b58e4
Worker push performance metrics immediately after receiving tria
thevindu-w Mar 22, 2024
309e964
Synchronize worker spawning
thevindu-w Mar 23, 2024
d11c056
Fix getNextWorkerId
thevindu-w Mar 23, 2024
61ac238
Moved scale_on_adgr to k8s config.yml
thevindu-w Mar 23, 2024
5877f1d
Use scaleUp instead of setNumberOfWorkers in JasmineGraphServer
thevindu-w Mar 23, 2024
05718ea
Bugfix
Ishad-M-I-M Mar 23, 2024
1f74672
Load configmap entries from K8s only if missing in cache
thevindu-w Mar 25, 2024
6636db7
Load push gateway address on worker creation
thevindu-w Mar 26, 2024
8b99950
Log request ID
thevindu-w Mar 26, 2024
0ace192
Use absolute time for logs
thevindu-w Mar 26, 2024
a619dfd
Wait for newly allocated job push performace metrics before scheduling
thevindu-w Mar 26, 2024
2658671
Prepare k8s client for multi-thread
thevindu-w Mar 27, 2024
9699da3
Prevent scheduling trian until workers push metrics
thevindu-w Mar 31, 2024
b18dc37
Merge branch 'master' into scale_trian
thevindu-w Apr 3, 2024
27d59c6
removed k8s resource requests
thevindu-w Apr 3, 2024
d34ff57
Fix unit test workflow
Ishad-M-I-M Apr 4, 2024
d4fc66b
Added collecting the load average metric
ArunaSenanayake Apr 5, 2024
d8c4fa1
Fix k8s integration workflow failure
Ishad-M-I-M Apr 6, 2024
508bfad
Update conf/hosts.txt
thevindu-w Apr 10, 2024
639a3ce
Update src/frontend/JasmineGraphFrontEnd.cpp
thevindu-w Apr 10, 2024
9a9f60c
Resolve issues
thevindu-w Apr 10, 2024
8521e58
Fix unit test failure
thevindu-w Apr 10, 2024
084b15e
Update src/backend/JasmineGraphBackend.cpp
thevindu-w Apr 12, 2024
70381e4
Update with changes
thevindu-w Apr 12, 2024
ab02810
Remove redundant logs
thevindu-w Apr 17, 2024
280e3e7
Fix issues
thevindu-w Apr 18, 2024
d32d610
Improve comment in logger
thevindu-w Apr 24, 2024
a0c9222
Define enums to represent command line arguments
Ishad-M-I-M Apr 26, 2024
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
6 changes: 0 additions & 6 deletions .github/actions/jasminegraph-action/action.yml

This file was deleted.

30 changes: 12 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,33 @@ on:
pull_request:
branches: [master]

env:
# Customize the build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
unit-tests:
runs-on: ubuntu-latest
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip unit tests')}}

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Build unit test
run: |
docker build -t jasminegraph .
docker build -f ./tests/unit/Dockerfile -t jasminegraph:unit .

- uses: jupyterhub/action-k3s-helm@v4
with:
docker-enabled: true

- name: Grant permissions for default user
run: kubectl apply -f ./k8s/rbac.yaml

- name: Docker Build
run: docker build -t jasminegraph .

- name: Build unit test
run: docker build -f ./tests/unit/Dockerfile -t jasminegraph:unit .

- name: Run unit test
run: |
mkdir coverage
kubectl apply -f ./.github/workflows/resources/unit-test-conf.yaml
sleep 30
kubectl logs -f jasminegraph-unit-test-pod
chmod +x ./.github/workflows/resources/unit-test.sh
./.github/workflows/resources/unit-test.sh

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -50,16 +44,15 @@ jobs:

docker-integration-tests:
runs-on: ubuntu-latest
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip docker integration')}}

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Docker Build
# Build JasmineGraph docker image
run: docker build -t jasminegraph .

- name: Run Integration Tests
Expand All @@ -69,13 +62,14 @@ jobs:

k8s-integration-tests:
runs-on: ubuntu-latest
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip k8s integration')}}

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- uses: jupyterhub/action-k3s-helm@v4
with:
docker-enabled: true
Expand Down
62 changes: 32 additions & 30 deletions .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
name: Style Check

on:
push:
branches: [master]
pull_request:
branches: [master]
push:
branches: [master]
pull_request:
branches: [master]

jobs:
style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install tools
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends cpplint shfmt
sudo wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 -O /bin/hadolint && sudo chmod +x /bin/hadolint
pip install pylint

- name: hadolint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip hadolint Check')}}
run: find . -type f -name '*Dockerfile*' -print0 | xargs -0 hadolint --ignore DL3008 --ignore DL3013 -t warning

- name: shfmt check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip shfmt Check')}}
run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d -s -i 4 -ci

- name: cpplint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip cpplint Check')}}
run: cpplint --linelength=120 --filter=-build,-runtime,-readability/todo,-whitespace/todo,-readability/casting,-readability/braces,-readability/fn_size,-legal/copyright --recursive .

- name: pylint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip pylint Check')}}
run: pylint -d C0103,E0401,R0801,R0902,R0913,R0914,R0915,W0603,W0621,W0718 --recursive=y .
style-check:
runs-on: ubuntu-latest
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip style check')}}

steps:
- uses: actions/checkout@v3

- name: Install tools
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends cpplint shfmt
sudo wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 -O /bin/hadolint && sudo chmod +x /bin/hadolint
pip install pylint

- name: hadolint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip hadolint Check')}}
run: find . -type f -name '*Dockerfile*' -print0 | xargs -0 hadolint --ignore DL3008 --ignore DL3013 -t warning

- name: shfmt check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip shfmt Check')}}
run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d -s -i 4 -ci

- name: cpplint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip cpplint Check')}}
run: cpplint --linelength=120 --filter=-build,-runtime,-readability/todo,-whitespace/todo,-readability/casting,-readability/braces,-readability/fn_size,-legal/copyright --recursive .

- name: pylint check
if: ${{!contains(github.event.pull_request.labels.*.name, 'Skip pylint Check')}}
run: pylint -d C0103,E0401,R0801,R0902,R0913,R0914,R0915,W0603,W0621,W0718 --recursive=y .
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
tags:
- 'v*'

env:
IMAGE: "${{ secrets.DOCKER_USER }}/jasminegraph:${{ github.ref_name }}"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.ref}}
repository: ${{ github.repository }}

- name: Docker Build
run: |
sed -i "s#org.jasminegraph.k8s.image=.*#org.jasminegraph.k8s.image=${IMAGE}#" ./conf/jasminegraph-server.properties
docker build -t "jasminegraph:temp" .
CONTAINER_ID=$(docker create "jasminegraph:temp")
docker export "${CONTAINER_ID}" | docker import - "jasminegraph:pre-build"
docker build -t "${IMAGE}" -f .github/workflows/resources/Dockerfile .

- name: Docker Minimal Image Build
run: |
sed -i "s#org.jasminegraph.k8s.image=.*#org.jasminegraph.k8s.image=${IMAGE}-minimal#" ./conf/jasminegraph-server.properties
chmod +x ./minimal/build.sh
./minimal/build.sh
docker tag "jasminegraph:minimal" "${IMAGE}-minimal"

- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}

- name: Docker Push
run: |
docker push "${IMAGE}"
docker push "${IMAGE}-minimal"
9 changes: 9 additions & 0 deletions .github/workflows/resources/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM jasminegraph:pre-build

ENV HOME="/home/ubuntu"
ENV JASMINEGRAPH_HOME="${HOME}/software/jasminegraph"

WORKDIR "${JASMINEGRAPH_HOME}"

ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"]
CMD ["bash"]
44 changes: 44 additions & 0 deletions .github/workflows/resources/unit-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Function to check if pod is in Pending/Running state
pod_status=""
check_pod_status() {
pod_status=$(kubectl get pod jasminegraph-unit-test-pod --no-headers -o custom-columns=":status.phase")

if [[ $pod_status == "Pending" || $pod_status == "ContainerCreating" ]]; then
echo 0
else
echo 1
fi
}

mkdir coverage
kubectl apply -f ./k8s/configs.yaml
kubectl apply -f ./.github/workflows/resources/unit-test-conf.yaml

timeout=300 # Set the timeout in seconds (adjust as needed)
start_time=$(date +%s)

while [[ $(check_pod_status) == "0" ]]; do
sleep 10

current_time=$(date +%s)
elapsed_time=$((current_time - start_time))

if [[ $elapsed_time -ge $timeout ]]; then
echo "Timeout reached. Exiting loop."
break
fi
done

echo "----------------------------- logs -----------------------------"
kubectl logs -f jasminegraph-unit-test-pod

check_pod_status
if [[ $pod_status != "Running" && $pod_status != "Completed" ]]; then
echo "Pod jasminegraph-unit-test-pod is in $pod_status state"
echo "Unit tests failed"
echo "----------------------------- details --------------------------"
kubectl describe pod jasminegraph-unit-test-pod
exit 1
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ __pycache__
*.db
*.db-*

coverage.xml
coverage.xml
*.tmp
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set(CMAKE_CXX_STANDARD 11)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

set(HEADERS src/backend/JasmineGraphBackend.h
set(HEADERS globals.h
src/backend/JasmineGraphBackend.h
src/backend/JasmineGraphBackendProtocol.h
src/centralstore/JasmineGraphHashMapCentralStore.h
src/centralstore/JasmineGraphHashMapDuplicateCentralStore.h
Expand Down Expand Up @@ -45,7 +46,6 @@ set(HEADERS src/backend/JasmineGraphBackend.h
src/server/JasmineGraphInstanceService.h
src/server/JasmineGraphServer.h
src/util/Conts.h
src/util/PlacesToNodeMapper.h
src/util/Utils.h
src/util/dbutil/attributestore_generated.h
src/util/dbutil/edgestore_generated.h
Expand Down Expand Up @@ -113,7 +113,6 @@ set(SOURCES src/backend/JasmineGraphBackend.cpp
src/server/JasmineGraphInstanceService.cpp
src/server/JasmineGraphServer.cpp
src/util/Conts.cpp
src/util/PlacesToNodeMapper.cpp
src/util/Utils.cpp
src/util/kafka/KafkaCC.cpp
src/util/kafka/StreamHandler.cpp
Expand All @@ -134,6 +133,10 @@ set(SOURCES src/backend/JasmineGraphBackend.cpp
src/util/dbinterface/DBInterface.cpp
)

if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
add_compile_options(-DUNIT_TEST)
endif ()

add_library(JasmineGraphLib ${HEADERS} ${SOURCES})
add_executable(JasmineGraph main.h main.cpp)

Expand All @@ -144,6 +147,8 @@ if (CMAKE_ENABLE_DEBUG)
target_compile_options(JasmineGraph PRIVATE -g)
endif ()

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s,--gc-sections")

#TODO: Need to install the library separately
target_link_libraries(JasmineGraphLib PRIVATE sqlite3)
target_link_libraries(JasmineGraphLib PRIVATE pthread)
Expand All @@ -155,19 +160,13 @@ target_link_libraries(JasmineGraphLib PRIVATE /usr/lib/x86_64-linux-gnu/libflatb
target_link_libraries(JasmineGraphLib PRIVATE /usr/lib/x86_64-linux-gnu/libjsoncpp.so)
target_link_libraries(JasmineGraphLib PRIVATE /usr/local/lib/libcppkafka.so)
target_link_libraries(JasmineGraph JasmineGraphLib)
target_include_directories(JasmineGraph PRIVATE /usr/include/python3)

set(PYTHON_EXECUTABLE "/usr/bin/python3")
set(PYTHON_INCLUDE_DIR "/usr/include/python3")
set(PYTHON_LIBRARIES "/usr/lib/x86_64-linux-gnu/libpython3.so")
target_link_libraries(JasmineGraph curl)

include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${PYTHON_DIRECTORIES})
include_directories(/usr/local/include/yaml-cpp)
target_link_libraries(JasmineGraphLib PRIVATE ${PYTHON_LIBRARIES})
target_link_libraries(JasmineGraphLib PRIVATE m)
target_link_libraries(JasmineGraphLib PRIVATE /usr/local/lib/libkubernetes.so)
target_link_libraries(JasmineGraphLib PRIVATE yaml-cpp)
target_link_libraries(JasmineGraphLib PRIVATE curl)

if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
# Include google test
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM miyurud/jasminegraph-prerequisites:20240101T095619

RUN apt-get update && apt-get install -y libcurl4-openssl-dev sysstat nmon
RUN rm -r /usr/lib/python3.8/distutils
RUN apt-get purge -y libpython3.8-dev python3.8-dev python3.8-distutils libpython3.8 python3.8

ENV HOME="/home/ubuntu"
ENV JASMINEGRAPH_HOME="${HOME}/software/jasminegraph"

RUN ln -sf /usr/bin/python3.8 /usr/bin/python3
RUN ln -sf /usr/include/python3.8 /usr/include/python3
RUN ln -sf /usr/lib/x86_64-linux-gnu/libpython3.8.so /usr/lib/x86_64-linux-gnu/libpython3.so

WORKDIR "${JASMINEGRAPH_HOME}"

Expand All @@ -17,6 +20,7 @@ COPY ./build.sh ./build.sh
COPY ./CMakeLists.txt ./CMakeLists.txt
COPY ./main.h ./main.h
COPY ./main.cpp ./main.cpp
COPY ./globals.h ./globals.h
COPY ./src ./src

RUN if [ "$DEBUG" = "true" ]; then echo "building in DEBUG mode" && sh build.sh --debug; else sh build.sh; fi
Expand All @@ -25,6 +29,7 @@ COPY ./run-docker.sh ./run-docker.sh
COPY ./src_python ./src_python
COPY ./conf ./conf
COPY ./k8s ./k8s
COPY ./ddl ./ddl

ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"]
CMD ["bash"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@ Run JasmineGraph in Kubernetes environment by providing appropriate parameters:
--PERFORMANCE_DB_PATH "$(pwd)/performancedb" \
--DATA_PATH "$(pwd)/data" \
--LOG_PATH "$(pwd)/logs" \
--AGGREGATE_PATH "$(pwd)/aggregate" \
--NO_OF_WORKERS 2 \
--ENABLE_NMON false
--ENABLE_NMON false \
--MAX_COUNT 4

>Note: `NO_OF_WORKERS` and `ENABLE_NMON` are optional arguments, and it defaults to `2` and `false` respectively.
>Note: `NO_OF_WORKERS`, `MAX_COUNT`, and `ENABLE_NMON` are optional arguments, and it defaults to `2`, `4` and `false` respectively.


Remove all resources created by JasmineGraph in Kubernetes environment:

./start-k8s.sh clean


## 3. Contact Information
Expand Down
8 changes: 0 additions & 8 deletions conf/hosts.txt

This file was deleted.

Loading
Loading