部署¶
使用Docker部署¶
Interactive被打包为Docker镜像,可以轻松部署在已安装docker、python3 >=3.8和pip >=19.3的系统上。您将使用名为gsctl的命令行工具来安装、启动和管理Interactive服务。
pip3 install gsctl
# Deploy the interactive service in local mode
gsctl instance deploy --type interactive
自定义端口¶
默认情况下,Interactive会在以下端口启动各项服务:协调器服务在8080,交互式元数据服务在7777,交互式Cypher查询服务在7687,存储过程服务在10000。这些端口均可自定义配置。
gsctl instance deploy --type interactive --coordinator-port 8081 --admin-port 7778 \
--cypher-port 7688 --storedproc-port 10001
有关自定义端口和连接到交互式服务的更多详细信息,请参阅安装和入门指南。
默认情况下,gsctl工具和Interactive使用相同版本。如需自定义部署,请按照从源代码部署中的说明操作。
使用Helm部署¶
待办事项
从源代码部署¶
本节介绍如何从源代码打包和部署自定义版本的Interactive。
从源码打包交互式组件¶
Interactive 被打包为一个 Docker 镜像。请确保您已安装 Docker,然后克隆代码仓库并构建 Interactive 运行时镜像。
git clone https://github.com/alibaba/GraphScope.git # Or clone your fork
cd GraphScope/k8s
python3 ./gsctl.py flexbuild interactive --app docker
构建过程将需要一些时间。完成后,镜像将被标记为graphscope/interactive:latest。
注意
Docker镜像是平台特定的,这意味着在x86_64(amd64)架构上构建的镜像可能无法在arm64机器上运行。虽然通过QEMU支持可以在其他平台上运行,但性能会较慢。要创建多平台镜像,请使用Buildx或Docker-Manifest。
部署自定义构建的交互式¶
gsctl 支持使用自定义镜像部署 Interactive 实例。
python3 gsctl.py instance deploy --type interactive --image-registry graphscope --image-tag latest
推送至您自己的注册表¶
您可以将镜像推送到自己的注册表,以便从其他机器访问。
docker tag graphscope/interactive:latest {YOUR_IMAGE_REGISTRY}/interactive:{TAG}
docker push {YOUR_IMAGE_REGISTRY}/interactive:latest
python3 gsctl.py instance deploy --type interactive --image-registry {YOUR_IMAGE_REGISTRY} --image-tag {TAG}
连接与使用¶
关于如何使用交互式功能,请参考入门指南。如需详细了解使用方法,请查阅Java SDK文档和Python SDK文档。