Skip to content

Commit

Permalink
[GIE] Reorganize executor package by incorporating GAIA into GIE (#1883)
Browse files Browse the repository at this point in the history
* Remove dependency of maxgraph_runtime from v6d_ffi and gaia_runtime

* [GlobalQuery] depend on the new global_query crate in related crates, and remove executor/runtime

* [GlobalQuery] move v6d_ffi into global_query, and update related dependency

* update related pom.xml, gaia.yml etc.

* move benchmark into GIE

* add exp_store as members of store; format exp_store

* add ci for DynType and exp_store in gaia.yml

* remove build bir on vineyard/groot in gaia.yml, as it already be done in gss.yml(on groot) and ci.yml(on vineyard)

Co-authored-by: Tao He <sighingnow@gmail.com>
  • Loading branch information
BingqingLyu and sighingnow committed Aug 1, 2022
1 parent 2899903 commit eb45c58
Show file tree
Hide file tree
Showing 880 changed files with 1,626 additions and 4,032 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
- '!learning_engine/**'
- '!proto/**'
- '!python/**'
- '!research/**'
- '**.md'
- '**.rst'

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:
- 'learning_engine/**'
- 'proto/**'
- 'python/**'
- 'research/**'
- '!**.md'
- '!**.rst'

Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/gaia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ on:
branches:
- main
paths:
- 'research/**'
- 'interactive_engine/**'
- '.github/workflows/gaia.yml'
- '!research/**.md'
pull_request:
branches:
- main
paths:
- 'research/**'
- 'interactive_engine/**'
- '.github/workflows/gaia.yml'
- '!research/**.md'

jobs:
gaia-test:
Expand All @@ -44,6 +40,11 @@ jobs:
~/.cache/sccache
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Rust Format Check
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE}/interactive_engine/executor && ./check_format.sh
- name: Install Dependencies
run: |
# install rdkafka
Expand All @@ -64,31 +65,32 @@ jobs:
- name: Build Ir on Experimental Store
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE}/research/query_service/ir/compiler
cd ${GITHUB_WORKSPACE}/interactive_engine/executor/ir/compiler
make build
- name: Build Ir on Vineyard Store
- name: Ir Unit Test
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE} && make install
cd ${GITHUB_WORKSPACE}/interactive_engine/executor
cargo fmt -- --check
cd ${GITHUB_WORKSPACE}/interactive_engine/executor/ir/compiler && make test
- name: Build Ir on Groot Store
- name: CommonType Unit Test
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE}/interactive_engine
mvn clean install -DskipTests -Pv2 -Drust.compile.mode=debug --quiet
cd ${GITHUB_WORKSPACE}/interactive_engine/executor/common/dyn_type && cargo test
- name: Ir Unit Test
- name: Store Unit Test
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE}/research/query_service/ir/compiler && make test
cd ${GITHUB_WORKSPACE}/interactive_engine/executor/store/exp_store && cargo test
# TODO: fix ut in groot
# cd ${GITHUB_WORKSPACE}/interactive_engine/executor/store/groot && cargo test
# TODO: add ut in global_query
# cd ${GITHUB_WORKSPACE}/interactive_engine/executor/store/global_query && cargo test
- name: Ir Integration Test on Experimental Store
run: |
source ${HOME}/.bashrc
cd ${GITHUB_WORKSPACE}/research/query_service/ir/compiler && ./ir_exprimental_ci.sh
cd ${GITHUB_WORKSPACE}/interactive_engine/executor/ir/compiler && ./ir_exprimental_ci.sh
- name: Upload GIE log
if: always()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/gss-dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- '!interactive_engine/**'
- '!python/graphscope/client/**'
- '!charts/graphscope-store/**'
- '!research/**'
- '!.github/workflows/gss.yml'
- 'interactive_engine/**.md'
- 'charts/graphscope-store/**.md'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ on:
- 'interactive_engine/**'
- 'python/graphscope/client/**'
- 'charts/graphscope-store/**'
- 'research/**'
- '.github/workflows/gss.yml'
- '!interactive_engine/**.md'
- '!charts/graphscope-store/**.md'
Expand Down Expand Up @@ -88,8 +87,9 @@ jobs:
- name: Gremlin Test
run: |
cd interactive_engine/groot-server
mvn test -Pgremlin-test
cd interactive_engine/groot-server
# TODO: add gremlin-test back when fixed. issue #1898
# mvn test -Pgremlin-test
- name: Upload tools for helm test to Artifact
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ interactive_engine/executor/store/src/db/proto/*
interactive_engine/data_load_tools/dependency-reduced-pom.xml
interactive_engine/gaia-adaptor/dependency-reduced-pom.xml
interactive_engine/executor/Cargo.lock
research/engine/pegasus/benchmark/src/graph/storage/clickhouse/pb_gen/*
research/query_service/ir/Cargo.lock
interactive_engine/executor/engine/pegasus/benchmark/src/graph/storage/clickhouse/pb_gen/*
interactive_engine/executor/ir/Cargo.lock

# java sdk
java/**/dependency-reduced-pom.xml
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ gie:
cd $(WORKING_DIR)/interactive_engine && \
mvn clean package -DskipTests -Pjava-release --quiet
# executor
cd $(WORKING_DIR)/interactive_engine/executor && \
cd $(WORKING_DIR)/interactive_engine/executor/assembly/v6d && \
rustup component add rustfmt && \
if [ x"release" = x"${BUILD_TYPE}" ]; then \
cargo build --workspace --release; \
cargo build --release; \
else \
cargo build --workspace; \
cargo build; \
fi
# install
mkdir -p $(WORKING_DIR)/.install_prefix && \
tar -xf $(WORKING_DIR)/interactive_engine/assembly/target/maxgraph-assembly-0.0.1-SNAPSHOT.tar.gz --strip-components 1 -C $(WORKING_DIR)/.install_prefix && \
cp $(WORKING_DIR)/interactive_engine/executor/target/$(BUILD_TYPE)/gaia_executor $(WORKING_DIR)/.install_prefix/bin/gaia_executor && \
cp $(WORKING_DIR)/interactive_engine/executor/assembly/target/$(BUILD_TYPE)/gaia_executor $(WORKING_DIR)/.install_prefix/bin/gaia_executor && \
sudo cp -r $(WORKING_DIR)/.install_prefix/* $(INSTALL_PREFIX) && \
rm -fr $(WORKING_DIR)/.install_prefix

Expand Down
2 changes: 1 addition & 1 deletion interactive_engine/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../research/query_service/ir/target/release</directory>
<directory>${project.basedir}/../executor/ir/target/release</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>libir_core*</include>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions interactive_engine/distribution/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</formats>
<fileSets>
<fileSet>
<directory>${project.parent.basedir}/executor/target</directory>
<directory>${project.parent.basedir}/executor/assembly/target</directory>
<includes>
<include>libmaxgraph_ffi*</include>
</includes>
<outputDirectory>native</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.parent.basedir}/../research/query_service/ir/target/release</directory>
<directory>${project.parent.basedir}/executor/ir/target/release</directory>
<includes>
<include>libir_core*</include>
</includes>
Expand Down
18 changes: 9 additions & 9 deletions interactive_engine/executor/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# MaxGraph Rust Project
# GIE Rust Project

This project contains all `rust` modules of MaxGraph, including:
This project contains all `rust` modules of GIE, including:
- Common
- Assembly
- IR
- Engine
- Store
- Runtime
- Id Service

This crate act as the parent of all the sub-crates.

To format all sub-crates, run:
To format the crates, cd each crate and run:

```bash
cargo +nightly fmt
```

To compile all sub-crates, run:
To compile the crates, cd each crate and run:

```bash
cargo build --workspace
```

To test all sub-crates, run:
To test the crates, cd each crate and run:

```bash
cargo test --workspace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[workspace]

members = [
"runtime",
"store",
"ffi",
"gaia_runtime"
"groot",
"v6d"
]

[profile.release]
Expand Down
19 changes: 19 additions & 0 deletions interactive_engine/executor/assembly/groot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "maxgraph-ffi"
version = "0.1.0"
authors = ["graphscope@alibaba-inc.com"]
edition = "2018"

[lib]
crate-type = ["rlib", "cdylib"]

[dependencies]
global_query = { path = "../../store/global_query" }
maxgraph-store = { path = "../../store/groot" }
gaia_pegasus = { path = "../../engine/pegasus/pegasus", package = "pegasus" }
pegasus_network = { path = "../../engine/pegasus/network" }
pegasus_server = { path = "../../engine/pegasus/server" }
runtime_integration = { path = "../../ir/integrated" }
log = "0.3"
log4rs = "0.8.0"
tokio = { version = "1.0", features = ["macros", "sync"] }
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::thread;
use std::time::Duration;

use gaia_pegasus::Configuration as GaiaConfig;
use maxgraph_runtime::store::global_graph::GlobalGraph;
use global_query::GlobalGraph;
use maxgraph_store::api::PartitionId;
use maxgraph_store::db::api::{GraphConfig, GraphResult};
use maxgraph_store::db::graph::store::GraphStore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate gaia_pegasus;
extern crate maxgraph_runtime;
extern crate global_query;
extern crate maxgraph_store;
#[macro_use]
extern crate log;
Expand Down
9 changes: 9 additions & 0 deletions interactive_engine/executor/assembly/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Stable
edition = "2018"
unstable_features = true
chain_width = 48
max_width = 108
use_small_heuristics = "Max"
fn_args_layout = "Compressed"
group_imports = "StdExternalCrate"
24 changes: 24 additions & 0 deletions interactive_engine/executor/assembly/v6d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "gaia_runtime"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
log = "0.4"
log4rs = "0.8.0"
serde = "1.0.72"
serde_derive = "1.0.72"
serde_json = "1.0.3"
structopt = "0.2"
lru_time_cache = "0.8.0"
dotproperties = "0.1.0"
tokio = { version = "1.0", features = ["macros", "sync"] }

global_query = { path = "../../store/global_query" , features = ["with_v6d"] }
pegasus = { path = "../../engine/pegasus/pegasus", package = "pegasus" }
pegasus_network = { path = "../../engine/pegasus/network" }
pegasus_server = { path = "../../engine/pegasus/server" }
runtime_integration = { path = "../../ir/integrated", features = ["with_v6d"] }

Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ use std::net::SocketAddr;
use std::sync::Arc;

use gaia_runtime::error::{StartServerError, StartServerResult};
use global_query::{FFIGraphStore, GraphPartitionManager};
use log::info;
use maxgraph_store::api::graph_partition::GraphPartitionManager;
use pegasus::api::{Fold, Sink};
use pegasus::{Configuration, JobConf, ServerConf};
use pegasus_network::config::NetworkConfig;
use pegasus_network::config::ServerAddr;
use pegasus_server::rpc::{start_rpc_server, RPCServerConfig, ServiceStartListener};
use runtime_integration::{InitializeJobAssembly, QueryVineyard};
use v6d_ffi::read_ffi::FFIGraphStore;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub mod error;
#[macro_use]
extern crate log;
extern crate dotproperties;
extern crate global_query;
extern crate log4rs;
extern crate maxgraph_store;
extern crate pegasus;
extern crate pegasus_network;
extern crate pegasus_server;
19 changes: 10 additions & 9 deletions interactive_engine/executor/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ if [ "$SKIP" = "true" ]; then
exit 0
fi

if [ "$MODE" = "debug" ]; then
./exec.sh cargo build --workspace
elif [ "$MODE" = "release" ]; then
./exec.sh cargo build --workspace --release
else
exit 1
fi


if [ "$(uname -s)" = "Darwin" ]; then
SUFFIX="dylib"
else
SUFFIX="so"
fi

cd assembly;
if [ "$MODE" = "debug" ]; then
../exec.sh cargo build --workspace
elif [ "$MODE" = "release" ]; then
../exec.sh cargo build --workspace --release
else
exit 1
fi

rm -rf $(pwd)/target/${MODE}/build
rm -rf $(pwd)/target/${MODE}/deps

strip $(pwd)/target/${MODE}/libmaxgraph_ffi.${SUFFIX}
ln -sf $(pwd)/target/${MODE}/libmaxgraph_ffi.${SUFFIX} ./target/libmaxgraph_ffi.${SUFFIX}
31 changes: 31 additions & 0 deletions interactive_engine/executor/check_format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
# Copyright 2022 Alibaba Group Holding Limited.
#
# Licensed 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.

CURRENT=$(pwd)
if ! rustup toolchain list | grep -q nightly; then
echo 'Installing nightly toolchain...'
rustup toolchain install nightly
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
fi
cd ${CURRENT}/assembly/
cargo +nightly fmt -- --check
cd ${CURRENT}/common/dyn_type/
cargo +nightly fmt -- --check
cd ${CURRENT}/engine/pegasus/
cargo +nightly fmt -- --check
cd ${CURRENT}/ir/
cargo +nightly fmt -- --check
cd ${CURRENT}/store/
cargo +nightly fmt -- --check
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2018"
dyn-clonable = "0.9.0"
itertools = "0.9"
lazy_static = "1.3.0"
pegasus_common = { path = "../engine/pegasus/common" }
pegasus_common = { path = "../../engine/pegasus/common" }

0 comments on commit eb45c58

Please sign in to comment.