Skip to content

Commit f0abbbf

Browse files
authored
add tutorials. (#117)
* add tutorials. * Add links of tutorial ipynbs to docs.
1 parent 33b7e97 commit f0abbbf

27 files changed

+6718
-9
lines changed

.github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '**.rst'
1212
- 'docs/**'
1313
- 'scripts/**'
14+
- 'tutorials/**'
1415
pull_request:
1516
branches:
1617
- main
@@ -20,6 +21,7 @@ on:
2021
- '**.rst'
2122
- 'docs/**'
2223
- 'scripts/**'
24+
- 'tutorials/**'
2325

2426
jobs:
2527
build-gae:

README-zh.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
[![Docs-en](https://shields.io/badge/Docs-English-blue?logo=Read%20The%20Docs)](https://graphscope.io/docs)
99
[![Docs-zh](https://shields.io/badge/Docs-%E4%B8%AD%E6%96%87-blue?logo=Read%20The%20Docs)](https://graphscope.io/docs/zh/)
1010
[![Translation](https://shields.io/badge/README-English-blue)](https://github.com/alibaba/GraphScope)
11+
[![Playground](https://shields.io/badge/JupyterLab-Try%20GraphScope%20Now!-F37626?logo=jupyter)](https://try.graphscope.app)
1112

1213
GraphScope 是阿里巴巴达摩院智能计算实验室研发并开源的一站式图计算平台。依托于阿里海量数据和丰富场景,与达摩院的高水平研究,GraphScope 致力于针对实际生产场景中图计算的挑战,提供一站式高效的解决方案。
1314

1415
GraphScope 提供了 Python 客户端,能十分方便的对接上下游工作流,具有一站式、开发便捷、性能极致等特点。它整合了智能计算实验室多个重要的创新性技术,包括 [GRAPE](https://github.com/alibaba/libgrape-lite)[MaxGraph](interactive_engine/)[Graph-Learn](https://github.com/alibaba/graph-learn),支持了图分析、图的交互式查询和图学习。其中核心优势包括在业界首次支持了 Gremlin 分布式编译优化,支持了算法的自动并行化、提供了企业级场景下的极致性能等。在阿里巴巴内外部应用中,GraphScope 已经证明在多个关键互联网领域(如风控,电商推荐,广告,网络安全,知识图谱等)实现了重要的业务新价值。
1516

1617
GraphScope 整合了达摩院的多项学术研究成果,其中的核心技术曾获得数据库领域顶级学术会议 SIGMOD2017 最佳论文奖、VLDB2017 最佳演示奖、VLDB2020 最佳论文奖亚军、世界人工智能创新大赛SAIL奖等。GraphScope 的交互查询引擎的论文已被 NSDI 2021录用。还有其它围绕 GraphScope 的十多项研究成果发表在领域顶级的学术会议或期刊上,如 TODS、SIGMOD、VLDB、KDD等。
1718

18-
欢迎阅读[白皮书](https://github.com/alibaba/GraphScope/blob/main/docs/GraphScope_whitepaper.pdf)了解更多信息。
19+
欢迎访问我们的网站 [graphscope.io](https://graphscope.io) 了解更多信息。
1920

2021
## 快速开始
2122

23+
我们提供了一个基于 JupyterLab 的 [Playground](https://try.graphscope.app),您可以从浏览器中在线试用 GraphScope。
24+
2225
GraphScope 设计在 [Kubernetes (k8s)](https://kubernetes.io/) 管理的群集上运行。为了快速上手,我们可以按照本文档的以下步骤部署一个本地 Kubernetes 集群,并加载预编译好的镜像。。
2326

2427
### 环境准备

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
[![Docs-en](https://shields.io/badge/Docs-English-blue?logo=Read%20The%20Docs)](https://graphscope.io/docs)
1111
[![Docs-zh](https://shields.io/badge/Docs-%E4%B8%AD%E6%96%87-blue?logo=Read%20The%20Docs)](https://graphscope.io/docs/zh/)
1212
[![README-zh](https://shields.io/badge/README-%E4%B8%AD%E6%96%87-blue)](README-zh.md)
13+
[![Playground](https://shields.io/badge/JupyterLab-Try%20GraphScope%20Now!-F37626?logo=jupyter)](https://try.graphscope.app)
1314

1415
GraphScope is a unified distributed graph computing platform that provides a one-stop environment for performing diverse graph operations on a cluster of computers through a user-friendly Python interface. GraphScope makes multi-staged processing of large-scale graph data on compute clusters simple by combining several important pieces of Alibaba technology: including [GRAPE](https://github.com/alibaba/libgrape-lite), [MaxGraph](interactive_engine/), and [Graph-Learn](https://github.com/alibaba/graph-learn) (GL) for analytics, interactive, and graph neural networks (GNN) computation, respectively, and the [vineyard](https://github.com/alibaba/libvineyard) store that offers efficient in-memory data transfers.
1516

16-
Read more in the [whitepaper](https://github.com/alibaba/GraphScope/blob/main/docs/GraphScope_whitepaper.pdf).
17-
17+
Visit our website at [graphscope.io](https://graphscope.io) to learn more.
1818

1919
## Getting Started
2020

21+
We provide a [Playground](https://try.graphscope.app) with a managed JupyterLab. [Try GraphScope](https://try.graphscope.app) straight away in your browser!
22+
2123
GraphScope can run on clusters managed by [Kubernetes](https://kubernetes.io/) within containers. For quickly getting started, we can set up a *local* Kubernetes cluster and take advantage of pre-built Docker images as follows.
2224

2325
### Prerequisites

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and the vineyard store that offers efficient in-memory data transfers.
2222

2323
installation
2424
getting_started
25+
tutorials
2526
deployment
2627
loading_graph
2728
interactive_engine

docs/tutorials.rst

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Tutorials
2+
=========
3+
4+
We provide a set of comprehensive tutorials for users to get started with GraphScope. In the tutorials you could learn
5+
how to launch a session, to load graphs, and to run analytical analysis, interactive queries as well as graph neural
6+
network trainings using GAE, GIE and GLE in GraphScope.
7+
8+
The tutorials are organized as jupyter notebooks. Users can try them in any jupyter notebook servers. You could play
9+
with those tutorials using our well-prepared jupyterlab environment in `GraphScope Playground <https://try.graphscope.app>`_.
10+
11+
All tutorials are listed as follows:
12+
13+
.. toctree::
14+
:numbered:
15+
:maxdepth: 2
16+
:caption: Contents
17+
18+
How to Create a Session <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/1_how_to_launch_a_session.ipynb>
19+
Loading Graphs <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/2_loading_graphs.ipynb>
20+
Built-in Analytical Algorithms <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/3_builtin_analytical_algorithms.ipynb>
21+
Writing Your Own Algorithms <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/4_writing_your_own_algorithms.ipynb>
22+
Interactive Query with Gremlin <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/5_interactive_query_with_gremlin.ipynb>
23+
Unsupervised Learning with GraphSage <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/6_unsupervised_learning_with_graphsage.ipynb>
24+
Supervised Learning with GCN <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/7_supervised_learning_with_gcn.ipynb>
25+
A Complex Workflow: Node Classification on Citation Network <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/8_node_classification_on_citation_network.ipynb>

docs/zh/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GraphScope 的交互查询引擎的论文已被 NSDI 2021录用。
3333
installation
3434
getting_started
3535
deployment
36+
tutorials
3637
loading_graph
3738
interactive_engine
3839
analytics_engine

docs/zh/tutorials.rst

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
入门教程
2+
=========
3+
4+
我们为GraphScope的用户准备了一系列详尽的入门教程。从这些入门教程中你可以了解到如何启动一个GraphScope会话,如何载图,以及如何分别
5+
使用GraphScope中的GAE、GIE、GLE引擎来完成图分析任务、交互式查询和图神经网络模型的训练。
6+
7+
我们用jupyter notebook来组织这些教程,用户可以在任何一个jupyter notebook服务中尝试执行。我们还提供了已经准备好的Jupyter Lab
8+
环境 `GraphScope Playground <https://try.graphscope.app>`_ 以便于用户更快地上手GraphScope。
9+
10+
入门教程包括如下这些内容:
11+
12+
.. toctree::
13+
:numbered:
14+
:maxdepth: 2
15+
:caption: 目录
16+
17+
如何创建会话 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/1_how_to_launch_a_session.ipynb>
18+
载图 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/2_loading_graphs.ipynb>
19+
内置图分析算法 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/3_builtin_analytical_algorithms.ipynb>
20+
编写自定义图分析算法 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/4_writing_your_own_algorithms.ipynb>
21+
基于Gremlin的交互式查询 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/5_interactive_query_with_gremlin.ipynb>
22+
基于GraphSage的无监督学习 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/6_unsupervised_learning_with_graphsage.ipynb>
23+
基于GCN的有监督学习 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/7_supervised_learning_with_gcn.ipynb>
24+
论文引用网络中的节点分类任务 <https://nbviewer.jupyter.org/github/alibaba/GraphScope/blob/main/tutorials/zh/8_node_classification_on_citation_network.ipynb>

python/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ __pycache__/
33
*.pyc
44
.ipynb_checkpoints
55
*.egg-info/
6+
*.egg/
67
build/
78
dist/
89

python/graphscope/client/session.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
os.path.join(__file__, "..", "..", "..", "..", "coordinator")
7272
)
7373

74-
DEFAULT_CONFIG_FILE = os.environ.get("GS_CONFIG_PATH", "")
74+
DEFAULT_CONFIG_FILE = os.environ.get(
75+
"GS_CONFIG_PATH", os.path.expanduser("~/.graphscope/session.json")
76+
)
7577

7678
_session_dict = {}
7779

@@ -330,7 +332,7 @@ def __init__(
330332
if isinstance(config, dict):
331333
self._config_params.update(config)
332334
elif isinstance(config, str):
333-
self._load_config(config)
335+
self._load_config(config, False)
334336
elif DEFAULT_CONFIG_FILE:
335337
self._load_config(DEFAULT_CONFIG_FILE)
336338

@@ -432,11 +434,15 @@ def __str__(self):
432434
def session_id(self):
433435
return self._session_id
434436

435-
def _load_config(self, path):
437+
def _load_config(self, path, slient=True):
436438
config_path = os.path.expandvars(os.path.expanduser(path))
437-
with open(config_path, "r") as f:
438-
data = json.load(f)
439-
self._config_params.update(data)
439+
try:
440+
with open(config_path, "r") as f:
441+
data = json.load(f)
442+
self._config_params.update(data)
443+
except Exception as exp: # noqa
444+
if not slient:
445+
raise exp
440446

441447
@property
442448
def info(self):

0 commit comments

Comments
 (0)