Skip to content

Commit

Permalink
Merge branch 'main' into ir_get_meta
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei1949 authored Jun 12, 2024
2 parents dc6ba31 + 591b092 commit 906766f
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/flex-interactive-dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
paths:
- '**'
- '!flex/**'
- '!coordinator/gscoordinator/flex/**'
- '!python/graphscope/gsctl/**'
- '!.github/workflows/flex-interactive.yml'

concurrency:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/flex-interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ on:
- main
paths:
- 'flex/**'
- 'coordinator/gscoordinator/flex/**'
- 'python/graphscope/gsctl/**'
- '.github/workflows/flex-interactive.yml'
pull_request:
branches:
- main
paths:
- 'flex/**'
- 'coordinator/gscoordinator/flex/**'
- 'python/graphscope/gsctl/**'
- '.github/workflows/flex-interactive.yml'

concurrency:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,69 @@ on:
env:
DOCKER_URL: registry.cn-hongkong.aliyuncs.com
GSS_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-store
INTERACTIVE_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/interactive
HELM_CHARTS_URL: https://graphscope.oss-cn-beijing.aliyuncs.com/charts/
OSS_REGION: oss-cn-beijing
OSS_ENDPOINT: oss-cn-beijing.aliyuncs.com

jobs:
build-gsctl-wheel-package:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Build Wheel Package
run: |
cd ${GITHUB_WORKSPACE}/python
python3 setup_gsctl.py bdist_wheel
# move wheels into one folder to upload to PyPI
mkdir ${GITHUB_WORKSPACE}/upload_pypi
mv ${GITHUB_WORKSPACE}/python/dist/wheelhouse/*.whl ${GITHUB_WORKSPACE}/upload_pypi/
- name: Publish distribution to PyPI
uses: pypa/[email protected]
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: upload_pypi/

build-interactive-image-x86-64:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build Interactive Image
run: |
cd ${GITHUB_WORKSPACE}/python
python3 -m pip install --upgrade pip && python3 -m pip install -r requirements.txt && python3 setup.py build_proto
cd ${GITHUB_WORKSPACE}
python3 ./gsctl.py flexbuild interactive --app docker
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
sudo docker tag ${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA}-x86_64 ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}
sudo docker push ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}
build-gss-image-x86-64:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion coordinator/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prometheus-client>=0.14.1
packaging
tqdm
connexion == 2.14.2
werkzeug == 2.3.8; python_version=="3.5" or python_version=="3.4"
werkzeug == 3.0.3; python_version=="3.5" or python_version=="3.4"
swagger-ui-bundle >= 0.0.2
python_dateutil >= 2.6.0
Flask == 2.2.5
Expand Down
4 changes: 4 additions & 0 deletions flex/storages/rt_mutable_graph/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,10 @@ static Status parse_edge_schema(YAML::Node node, Schema& schema) {
}

static Status parse_edges_schema(YAML::Node node, Schema& schema) {
if (node.IsNull()){
LOG(INFO) << "No edge is set";
return Status::OK();
}
if (!node.IsSequence()) {
LOG(ERROR) << "edge is not set properly";
return Status(StatusCode::InvalidSchema, "edge is not set properly");
Expand Down
8 changes: 7 additions & 1 deletion python/graphscope/deploy/kubernetes/resource_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ def get_image_pull_secrets(image_pull_secrets):

@staticmethod
def get_node_selector(node_selector):
return node_selector
import base64
import json

decoded_node_selector = base64.b64decode(node_selector).decode(
"utf-8", errors="ignore"
)
return json.loads(decoded_node_selector)

@staticmethod
def get_user_defined_volumes(udf_volumes):
Expand Down
18 changes: 16 additions & 2 deletions python/graphscope/gsctl/gsctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,25 @@
0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")
)

from graphscope.gsctl.commands import get_command_collection
from graphscope.gsctl.config import get_current_context
try:
import graphscope
from graphscope.gsctl.commands import get_command_collection
from graphscope.gsctl.config import get_current_context
except ModuleNotFoundError:
# if graphscope is not installed, only basic functions or utilities
# can be used, e.g. install dependencies
graphscope = None


def cli():
if graphscope is None:
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "commands")
)
from dev import cli as dev_cli

dev_cli()

context = get_current_context()
# get the specified commands under the FLEX architecture
commands = get_command_collection(context)
Expand Down
38 changes: 38 additions & 0 deletions python/graphscope/gsctl/tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,34 @@
},
}

modern_graph_vertex_only = {
"name": "modern_graph",
"description": "This is a test graph, only contains vertex",
"schema": {
"vertex_types": [
{
"type_name": "person",
"properties": [
{
"property_name": "id",
"property_type": {"primitive_type": "DT_SIGNED_INT64"},
},
{
"property_name": "name",
"property_type": {"string": {"long_text": ""}},
},
{
"property_name": "age",
"property_type": {"primitive_type": "DT_SIGNED_INT32"},
},
],
"primary_keys": ["id"],
}
],
"edge_types": [],
},
}


modern_graph_datasource = {
"vertex_mappings": [
Expand Down Expand Up @@ -355,5 +383,15 @@ def test_suit_case(self):
assert stored_procedure_id == "procedure_name"
delete_graph_by_id(graph_id_2)

def test_start_service_on_vertex_only_graph(self):
graph_id = create_graph(modern_graph_vertex_only)
start_service(graph_id)
status = list_service_status()
for s in status:
if s.graph_id == graph_id:
assert s.status == "Running"
else:
assert s.status == "Stopped"

def teardown_class(self):
disconnect_coordinator()

0 comments on commit 906766f

Please sign in to comment.