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

Toolchain Upgrade: CMake, Conan, GitHub Actions, and more #138

Open
wants to merge 65 commits into
base: 1.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
97e9a9a
refactor(cleanup): restructure folders
hrz6976 Dec 20, 2023
3fa3fb4
build: switching to cmake
hrz6976 Dec 20, 2023
083a259
build: add meson build profile
hrz6976 Dec 23, 2023
99d9cbd
fix: regressions (data->fixtures) in auto refactoring
hrz6976 Dec 25, 2023
fc89d7a
build: migrate toolchain to CMake and Conan
hrz6976 Dec 29, 2023
9f9df49
fix: compile issues
hrz6976 Dec 29, 2023
37f4b8a
build: add uninstall, add flags
hrz6976 Dec 29, 2023
fa861f9
chore: move artifacts to a standalone folder
hrz6976 Dec 31, 2023
e3ee78a
chore: restructure and cleanup
hrz6976 Jan 2, 2024
d3c01ee
chore(cleanup): fix gitignore, remove unused
hrz6976 Jan 2, 2024
f543ba8
fix(build): rapidjson can't be found
hrz6976 Jan 2, 2024
784fe67
build: dockerfile for cmake
hrz6976 Jan 2, 2024
93b9727
fix(docker): init script won't build db
hrz6976 Jan 2, 2024
b922a70
Accelerate TempResult::dofilter by replacing tostring method from str…
fyulingi Dec 1, 2023
446e195
update(ghttp&grpc): add param disk to monitor api
Jeevan620 Dec 5, 2023
6244c37
Add limit_num (optional parameter) for do_filter.
fyulingi Dec 8, 2023
a84bf87
Pass limit num into doFilter in GeneralEvaluation
SoftlySpoken Dec 8, 2023
c5d5bc0
Opt(Query): filter multiple conditions early termination
Dec 11, 2023
3e759e7
Improve bgp plan (from dfs_strategy to bfs_strategy).
fyulingi Dec 11, 2023
229b8ae
Remove one line debug_output in PlanGenerator.cpp.
fyulingi Dec 11, 2023
7913499
update(ghttp&grpc): update userPrivilegeManage api
Jeevan620 Dec 18, 2023
62b7ddb
update(APIUtil): add rwlock for system db
Jeevan620 Dec 18, 2023
5b2900f
Add gzip:add json query default is gzip
Dec 20, 2023
28f141b
update(APIUtil): refactor some methods
Jeevan620 Dec 20, 2023
36da1dd
update(ghttp): refactor build api
Jeevan620 Dec 20, 2023
090e8f7
update(grpc): refactor build api
Jeevan620 Dec 20, 2023
a978f40
replace rm(ghttp.cpp):add remove_path as system rm
Dec 20, 2023
81fae69
replace system(grpc.cpp):add remove_path replace system rm
Dec 20, 2023
77caffc
replace rm(gdrop,gexport,ginit,shutdown):remove_path replace system rm
Dec 20, 2023
094e296
update parser_test script
Jeevan620 Dec 21, 2023
7b7e861
update parser_test script
Jeevan620 Dec 21, 2023
94cdfb0
update basic_test script
Jeevan620 Dec 22, 2023
b4b9f7f
Update compression of http api response data
Jeevan620 Dec 27, 2023
72304d3
Fix a bug in Optimizer.cpp (DFS execution table init).
fyulingi Dec 27, 2023
a2efd9a
fix(chore): unresolved merge conflict
hrz6976 Jan 6, 2024
b1c8420
feat: add support for loongarch64
hrz6976 Jan 8, 2024
0e91e87
feat: + backward for stacktraces, cmake cleanup
hrz6976 Jan 8, 2024
5a5f1a5
fix: test cases
hrz6976 Jan 8, 2024
85b5846
test: + ctest
hrz6976 Jan 9, 2024
7a96be8
feat: add binary packaging
hrz6976 Jan 9, 2024
7b7120b
ci: add github actions
hrz6976 Jan 9, 2024
d09a4d8
ci: move locv commands to cmakelists
hrz6976 Jan 9, 2024
579b63b
ci: fix ci build issues
hrz6976 Jan 9, 2024
5c28246
fix(test): fix binary tests in CI
hrz6976 Jan 9, 2024
45e093e
ci(docker): don't install the toolchain for a tar
hrz6976 Jan 9, 2024
74894f8
fix(ci): failed to hash file
hrz6976 Jan 9, 2024
4015bb6
ci: add release pipeline
hrz6976 Jan 9, 2024
0a6d213
ci: parallelize docker build
hrz6976 Jan 9, 2024
d3a8c4b
fix(ci): test can't be triggered
hrz6976 Jan 9, 2024
edde887
fix(ci): docker x64 won't build
hrz6976 Jan 9, 2024
9eb26f2
fix(ci): missing prepare
hrz6976 Jan 9, 2024
2af7539
fix(ci): manually triggered releases
hrz6976 Jan 9, 2024
12bc1e5
ci(docker): use gh cache backend
hrz6976 Jan 9, 2024
7755df8
fix(ci): don't skip if release exists
hrz6976 Jan 9, 2024
e83a8be
docs: add badges to README
hrz6976 Jan 9, 2024
99c38f4
revert(ci): merge docker pipeline
hrz6976 Jan 9, 2024
3753e8b
feat(build): unify setup scripts
hrz6976 Jan 9, 2024
249510c
chore: remove unused assets
hrz6976 Jan 9, 2024
e24edff
docs: fix README rendering issues
hrz6976 Jan 9, 2024
6ba17b4
fix(test): fix test run_transaction
hrz6976 Jan 10, 2024
fa7977a
ci(docs): deploy cloudflare pages on push
hrz6976 Jan 10, 2024
be42cd1
fix(ci): build and release
hrz6976 Jan 13, 2024
f4dd9e0
ci: add help/*.pdf to cf assets
hrz6976 Jan 14, 2024
1592352
fix: cf pages
hrz6976 Jan 14, 2024
a043515
Update cfpages.yml
hrz6976 Jan 14, 2024
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
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .debug/.gitignore

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/cfpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow uploads documentation to Cloudflare Pages.
# @authors: Runzhi He <[email protected]>
# @date: 2024-01-10

name: Publish Cloudflare Pages

on:
push:
branches: [ online-docs ]
workflow_dispatch: # Manually run workflow

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: online-docs
fetch-depth: 0

- name: Copy Assets
run: |
mkdir -p temp
cp -rv $(find ./docs -maxdepth 1 -type f) temp
cp -rv ./docs/zh-cn ./docs/help temp

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ vars.CF_PROJECT_NAME }}
directory: temp
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow runs the test suite, measure coverage, and upload the coverage report to Codecov.
# @authors: Runzhi He <[email protected]>
# @date: 2024-01-08

name: Build and Test

on:
push:
# branches: [ master ] # TODO: have a stable default branch
pull_request:
workflow_dispatch: # Manually run workflow

jobs:
build-and-test:
# Only trigger this workflow on the default branch
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: ${{ always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
# This CI gonna fail if can't build and test on latest Ubuntu LTS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# Test the setup script
- name: Install system dependencies
run: sudo bash scripts/setup-dev.sh

- name: Setup Conan
run: pip install conan && conan profile detect

- name: Cache Conan dependencies
uses: actions/cache@v3
with:
path: |
~/.conan2/p/
key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.py') }}
restore-keys: |
${{ runner.os }}-conan-

- name: Install conan dependencies
run: conan install . -s "&:build_type=Debug" -s "build_type=Release" --build=missing

- name: Build
run: |
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON
ninja prepare
ninja install -v
working-directory: cmake-build-debug

- name: Sanity Check
run: |
bash scripts/init.sh
(timeout 10s bin/ghttp &) && sleep 3 && bin/gquery -db small -q data/small/small_q0.sql && killall ghttp

- name: Test
run: ctest -C Debug --output-on-failure --rerun-failed
working-directory: cmake-build-debug
continue-on-error: ${{ vars.CHEAT_IN_CI == 'true' }}

- name: Generate coverage report
run: ninja coverage
working-directory: cmake-build-debug

- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage.tar.gz
path: coverage.tar.gz

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: coverage.info
verbose: true
59 changes: 59 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will build a new Docker image and push it to Docker Hub whenever a new tag is created.
# @authors: Runzhi He <[email protected]>
# @date: 2024-01-08

name: Publish Docker

on:
push:
tags:
- 'v*'
# This line enables manual triggering
workflow_dispatch:

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPOSITORY }}

- name: Creating source tarball
run: |
tar -czvf gstore-src.tar.gz "src" "api" "defaults" "tests" "3rdparty" "data" "scripts" "conanfile.py" "CMakeLists.txt" "README.md" "LICENSE"

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
# if triggered by workflow_dispatch, don't push to Docker Hub
push: ${{ github.event_name != 'workflow_dispatch' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
75 changes: 75 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow will build and draft a new release whenever a new tag is pushed to the repository.
# @authors: Runzhi He <[email protected]>
# @date: 2024-01-08

name: Publish Release

on:
push:
tags:
- 'v*'
# This line enables manual triggering
workflow_dispatch:

jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# Test the setup script
- name: Install system dependencies
run: sudo bash scripts/setup-dev.sh

- name: Setup Conan
run: pip install conan && conan profile detect

- name: Install conan dependencies
run: conan install . -s "build_type=Release" --build=missing

- name: Build
run: |
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
ninja prepare
ninja install -v
working-directory: cmake-build-release

- name: Create Tarball
run: |
ninja -C cmake-build-release tarball
ninja -C cmake-build-release package

- name: Sanity Check
run: |
bash scripts/init.sh
(timeout 10s bin/ghttp &) && sleep 3 && bin/gquery -db small -q data/small/small_q0.sql && killall ghttp

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Generate Changelog
run: |
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s

- name: Create a new Release
uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# https://github.com/ncipollo/release-action for the full list of arguments
artifacts: gstore-*.tar.gz
draft: true # generate a draft release
generateReleaseNotes: false
bodyFile: CHANGELOG.md
# generate a pre-release if 'pre', 'rc', or 'beta' is in the tag name, or triggered manually
prerelease: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'pre') }}
# use the tag name if it's a tag, otherwise use the commit hash
continue-on-error: true
45 changes: 41 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# Artifacts and Cache
build/
include/
lib/
bin/
bin_tests/
dist/
cmake-build-*/
.cmake/
gstore-*.tar.gz
CMakeUserPresets.json
/Testing/

# Runtime directories
.tmp/
.debug/
.obj/
backup/
logs/
upload/
temp/
fun/

# config files
# TODO: add a separate config file folder
/backup.json
/conf.ini
/init.conf
/ipAllow.config
/ipDeny.config
/README.txt
/slog.properties
/slog.stdout.properties
/*.log

# Executables
*.pyc
*.exe
Expand All @@ -7,19 +42,20 @@
*.x86_64
*.hex
bin/g*
scripts/update_test
scripts/dataset_test
tests/update_test
tests/dataset_test
api/cpp/example/example

Parser/Sparql*
src/Parser/Sparql*

#result logs
*.txt
*.log
logs
!CMakeLists.txt

#backup files
backup.json
defaults/backup.json

#download files
*.torrent
Expand Down Expand Up @@ -90,6 +126,7 @@ tags
.vs
*.iml
.idea
.vscode

# latex files
*.aux
Expand Down
3 changes: 0 additions & 3 deletions .objs/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .tmp/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .tmp/web/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions .vscode/c_cpp_properties.json

This file was deleted.

6 changes: 6 additions & 0 deletions 3rdparty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*
!.gitignore
!*.tar*
!*.t[bgx]z
!*.zip
!*.sh
19 changes: 19 additions & 0 deletions 3rdparty/antlr4-cpp-runtime-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

mkdir -p ../include/
rm -rf antlr4-cpp-runtime-4
tar -xzvf antlr4-cpp-runtime-4.tar.gz;
cd antlr4-cpp-runtime-4 || echo "./antlr4-cpp-runtime-4 not found"
cmake .

# if GSTORE_USE_DYNAMIC_LIB is defined, then we need to copy the dynamic library to the lib directory
# otherwise, we need to copy the static library to the lib directory
if [ -n "$GSTORE_USE_DYNAMIC_LIB" ]; then
make -j2 antlr4_shared
cp dist/libantlr4-runtime.so* ../../lib/libantlr4-runtime.so
cd ../../lib/ || echo "./lib not found"
else
make -j$(nproc) antlr4_static
cp dist/libantlr4-runtime.a ../../lib/
fi
cp -r runtime/src/* ../../include/
File renamed without changes.
Loading