-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat (cli): initialize the CLI of GraphAr and support baseETL functions #616
Merged
Merged
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
25ea334
init cli
jasinliu a8da3ce
fix include
jasinliu c17de46
Merge branch 'main' of https://github.com/apache/incubator-graphar in…
jasinliu 54ad924
add ci
jasinliu 775e559
Merge branch 'main' of https://github.com/apache/incubator-graphar in…
jasinliu 2b07a69
add vertex info
jasinliu dd72ad8
change config
jasinliu 5f7ed3c
finish
jasinliu f60bd49
Merge branch 'main' of https://github.com/apache/incubator-graphar in…
jasinliu 45ab64d
license
jasinliu 3393611
fix license
jasinliu 305cca5
remove conda recipe
jasinliu cda2487
enbale ci
jasinliu 0dc6ff4
fix typo
jasinliu 8e942be
fix dependency
jasinliu fb684fc
update ci
jasinliu 5125d9c
add data
jasinliu 9e35d48
fix ci
jasinliu 63e77ee
fix cmake
jasinliu 3b7758a
add arrow in cmake
jasinliu 4d72237
add dependency
jasinliu 9fc7353
fix review
jasinliu 2bee832
Merge branch 'apache:main' into graphar-cli
jasinliu 77bc97c
fix ci
jasinliu 56aa77b
fix ci
jasinliu 955d609
fix ci
jasinliu 726ea84
fix ci
jasinliu 6c39258
Merge branch 'apache:main' into graphar-cli
jasinliu f0fe5e9
Update cli.yml
jasinliu 18ba462
Update cli.yml
jasinliu 4af9117
fix config type
jasinliu 7b81e42
fix ci with new testing
jasinliu 6ddac61
use enum
jasinliu 9f3258b
use enum
jasinliu 2aa64ad
pin pydantic version
jasinliu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: GraphAr CLI CI | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'cpp/**' | ||
- 'cli/**' | ||
- '.github/workflows/ci.yml' | ||
- '.github/workflows/cli.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'cpp/**' | ||
- 'cli/**' | ||
- '.github/workflows/ci.yml' | ||
- '.github/workflows/cli.yml' | ||
concurrency: | ||
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ubuntu: | ||
name: Ubuntu 22.04 CLI | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.pull_request.title, 'WIP') && !github.event.pull_request.draft }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
||
# install the latest arrow deb to test arrow | ||
wget -c https://apache.jfrog.io/artifactory/arrow/"$(lsb_release --id --short | tr 'A-Z' 'a-z')"/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \ | ||
-P /tmp/ | ||
sudo apt-get install -y /tmp/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb | ||
sudo apt-get update -y | ||
sudo apt install -y libarrow-dev \ | ||
libarrow-dataset-dev \ | ||
libarrow-acero-dev \ | ||
libparquet-dev | ||
sudo apt-get install -y ccache libcurl4-openssl-dev | ||
|
||
- name: Install GraphAr CLI and Run Tests | ||
working-directory: "cli" | ||
run: | | ||
pip install ./ -v | ||
graphar --help | ||
graphar check -p ../testing/neo4j/MovieGraph.graph.yml | ||
graphar show -p ../testing/neo4j/MovieGraph.graph.yml -v Person | ||
graphar show -p ../testing/neo4j/MovieGraph.graph.yml -es Person -e ACTED_IN -ed Movie | ||
graphar import -c import.mini.yml | ||
# TODO: Add unit tests | ||
|
||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# macos: | ||
# name: ${{ matrix.architecture }} macOS ${{ matrix.macos-version }} CLI | ||
# runs-on: macos-${{ matrix.macos-version }} | ||
# if: ${{ !contains(github.event.pull_request.title, 'WIP') && github.event.pull_request.draft == false }} | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# include: | ||
# - architecture: AMD64 | ||
# macos-version: "12" | ||
# - architecture: ARM64 | ||
# macos-version: "14" | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# submodules: true | ||
|
||
# - name: Install dependencies | ||
# run: | | ||
# brew bundle --file=cpp/Brewfile | ||
|
||
|
||
# - name: Build GraphAr And Run Tests | ||
# working-directory: "cli" | ||
# run: | | ||
# pip install ./ | ||
# graphar --help | ||
# graphar check -p ../testing/neo4j/MovieGraph.graph.yml | ||
# graphar show -p ../testing/neo4j/MovieGraph.graph.yml -v Person | ||
# graphar show -p ../testing/neo4j/MovieGraph.graph.yml -es Person -e ACTED_IN -ed Movie | ||
# graphar import -c import.full.yml | ||
|
||
# TODO: Add unit tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
BasedOnStyle: Google | ||
DerivePointerAlignment: false | ||
PointerAlignment: Left | ||
Cpp11BracedListStyle: true | ||
IndentCaseLabels: false | ||
AllowShortBlocksOnASingleLine: true | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortIfStatementsOnASingleLine: false | ||
Standard: 'Cpp11' | ||
SpaceAfterCStyleCast: true | ||
AlignAfterOpenBracket: Align | ||
SortIncludes: true | ||
IncludeBlocks: Preserve | ||
ForEachMacros: | ||
- BOOST_FOREACH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# Using https://github.com/github/gitignore/blob/master/Python.gitignore | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/_generate/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
_skbuild/ | ||
.pyodide-xbuildenv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# Require CMake 3.15+ (matching scikit-build-core) Use new versions of all | ||
# policies up to CMake 3.27 | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# Scikit-build-core sets these values for you, or you can just hard-code the | ||
# name and version. | ||
project( | ||
${SKBUILD_PROJECT_NAME} | ||
VERSION ${SKBUILD_PROJECT_VERSION} | ||
LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../cpp ${CMAKE_BINARY_DIR}/graphar) | ||
|
||
# Find the module development requirements (requires FindPython from 3.17 or | ||
# scikit-build-core's built-in backport) | ||
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) | ||
find_package(pybind11 CONFIG REQUIRED) | ||
find_package(Arrow REQUIRED) | ||
find_package(ArrowDataset REQUIRED) | ||
find_package(ArrowAcero REQUIRED) | ||
find_package(Parquet REQUIRED) | ||
|
||
# Add a library using FindPython's tooling (pybind11 also provides a helper like | ||
# this) | ||
python_add_library(_core MODULE src/main.cc WITH_SOABI) | ||
|
||
target_link_libraries(_core PRIVATE pybind11::headers graphar Arrow::arrow_shared | ||
Parquet::parquet_shared | ||
ArrowDataset::arrow_dataset_shared | ||
ArrowAcero::arrow_acero_shared | ||
) | ||
target_include_directories(_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
target_include_directories(_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/src) | ||
target_include_directories(_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/thirdparty) | ||
|
||
# This is passing in the version as a define just as an example | ||
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION}) | ||
|
||
# The install directory is the output (wheel) directory | ||
set_target_properties(_core PROPERTIES INSTALL_RPATH "$ORIGIN") | ||
install(TARGETS graphar DESTINATION graphar_cli) | ||
install(TARGETS _core DESTINATION graphar_cli) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can disable the job with
if: false
, which is considered better to me, rather than ignore the code.similar to example in this doc:
Ps. there should also be a note to explain with why we skip this job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! Thanks very much!