-
Notifications
You must be signed in to change notification settings - Fork 446
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
Add a local deploy and test ci on MacOS #512
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,143 @@ | ||
name: GraphScope CI on MacOS | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'gnn_engine/**' | ||
- '**.md' | ||
- '**.rst' | ||
- 'docs/**' | ||
- 'research/**' | ||
- 'scripts/**' | ||
- 'tutorials/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'gnn_engine/**' | ||
- '**.md' | ||
- '**.rst' | ||
- 'docs/**' | ||
- 'research/**' | ||
- 'scripts/**' | ||
- 'tutorials/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
env: | ||
JAVA_HOME: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home | ||
OPENSSL_ROOT_DIR: /usr/local/opt/openssl | ||
OPENSSL_LIBRARIES: /usr/local/opt/openssl/lib | ||
OPENSSL_SSL_LIBRARY: /usr/local/opt/openssl/lib/libssl.dylib | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup tmate session | ||
if: false | ||
uses: mxschmitt/action-tmate@v2 | ||
|
||
- name: Install Dependencies for MacOS | ||
run: | | ||
pushd ${GITHUB_WORKSPACE} | ||
brew install llvm@9 | ||
|
||
# write envs to .env | ||
{ | ||
echo "export CC=/usr/local/opt/llvm@9/bin/clang" | ||
echo "export CXX=/usr/local/opt/llvm@9/bin/clang++" | ||
echo "export LDFLAGS=-L/usr/local/opt/llvm@9/lib" | ||
echo "export CPPFLAGS=-I/usr/local/opt/llvm@9/include" | ||
echo "export PATH=/usr/local/opt/llvm@9/bin:${JAVA_HOME}/bin:$PATH" | ||
} >> .env | ||
|
||
# install dependency | ||
source .env | ||
/bin/bash ./scripts/install_dependencies.sh | ||
popd | ||
|
||
- name: Install libgrape-lite | ||
run: | | ||
source ${GITHUB_WORKSPACE}/.env | ||
git clone -b master --single-branch --depth=1 https://github.com/alibaba/libgrape-lite.git | ||
cd libgrape-lite | ||
mkdir build && cd build | ||
cmake .. | ||
make -j$(sysctl -n hw.ncpu) | ||
sudo make install | ||
|
||
- name: Setup tmate session | ||
if: false | ||
uses: mxschmitt/action-tmate@v2 | ||
|
||
- name: Install libvineyard | ||
run: | | ||
source ${GITHUB_WORKSPACE}/.env | ||
git clone -b main-v0.2.5 --single-branch --depth=1 https://github.com/alibaba/libvineyard.git | ||
cd libvineyard | ||
git submodule update --init | ||
mkdir build && pushd build | ||
cmake .. -DBUILD_VINEYARD_PYTHON_BINDINGS=ON -DBUILD_SHARED_LIBS=ON -DBUILD_VINEYARD_IO_OSS=ON -DBUILD_VINEYARD_TESTS=OFF | ||
make -j$(sysctl -n hw.ncpu) | ||
make vineyard_client_python -j$(sysctl -n hw.ncpu) | ||
sudo make install | ||
popd | ||
python3 setup.py bdist_wheel | ||
pip3 install ./dist/*.whl | ||
|
||
- name: Build GraphScope | ||
run: | | ||
source ${GITHUB_WORKSPACE}/.env | ||
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:${PATH}:/usr/local/zookeeper/bin | ||
|
||
# builde and install gae and gie | ||
make gae gie | ||
|
||
pushd python | ||
pip3 install -U setuptools --user | ||
pip3 install -r requirements.txt -r requirements-dev.txt --user | ||
python3 setup.py bdist_wheel | ||
pip3 install -U ./dist/*.whl --user | ||
popd | ||
pushd coordinator | ||
pip3 install -r requirements.txt -r requirements-dev.txt --user | ||
python3 setup.py bdist_wheel | ||
pip3 install -U ./dist/*.whl --user | ||
popd | ||
|
||
- name: DEBUG | ||
if: false | ||
uses: mxschmitt/action-tmate@v2 | ||
|
||
- name: Run Local Test | ||
run: | | ||
source ${GITHUB_WORKSPACE}/.env | ||
# prelaunch the etcd | ||
/usr/local/bin/etcd --data-dir=/tmp/default.etcd& | ||
|
||
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:${JAVA_HOME}/bin:${PATH}:/usr/local/zookeeper/bin | ||
export GRAPHSCOPE_PREFIX=/usr/local | ||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib | ||
|
||
export GS_TEST_DIR=${GITHUB_WORKSPACE}/gstest | ||
git clone -b master --single-branch --depth=1 https://github.com/7br/gstest.git ${GS_TEST_DIR} | ||
python3 -m pytest -s -v ${GITHUB_WORKSPACE}/python/tests/test_run_locally.py | ||
|
||
# delete etcd dir | ||
rm -fr /tmp/default.etcd || true | ||
|
||
- name: Upload GIE Log | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: gie-log | ||
path: /tmp/graphscope/ | ||
|
||
- name: Setup tmate session debug | ||
if: false | ||
uses: mxschmitt/action-tmate@v2 |
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// | ||
//! Copyright 2020 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. | ||
|
@@ -16,23 +16,28 @@ | |
use std::process::Command; | ||
|
||
pub fn get_local_ip() -> String { | ||
let output = match Command::new("hostname").args(&["-I"]).output() { | ||
Ok(ok) => ok, | ||
Err(_) => { | ||
return String::from("127.0.0.1"); | ||
} | ||
}; | ||
if cfg!(target_os = "linux") { | ||
let output = match Command::new("hostname").args(&["-I"]).output() { | ||
Ok(ok) => ok, | ||
Err(_) => { | ||
return String::from("127.0.0.1"); | ||
} | ||
}; | ||
|
||
let stdout = match String::from_utf8(output.stdout) { | ||
Ok(ok) => ok, | ||
Err(_) => { | ||
return String::from("127.0.0.1"); | ||
} | ||
}; | ||
let stdout = match String::from_utf8(output.stdout) { | ||
Ok(ok) => ok, | ||
Err(_) => { | ||
return String::from("127.0.0.1"); | ||
} | ||
}; | ||
|
||
let ips: Vec<&str> = stdout.trim().split(" ").collect::<Vec<&str>>(); | ||
let first = ips.first(); | ||
return first.map(|s| s.to_string()).unwrap_or("127.0.0.1".to_string()); | ||
let ips: Vec<&str> = stdout.trim().split(" ").collect::<Vec<&str>>(); | ||
let first = ips.first(); | ||
return first.map(|s| s.to_string()).unwrap_or("127.0.0.1".to_string()); | ||
} else { | ||
// Mac can only deploy on local. | ||
return String::from("127.0.0.1"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hostname command no option -I in MacOS |
||
} | ||
} | ||
|
||
|
||
|
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
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
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
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 won't enable GLE in this pull request, right?
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.
yes