Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BQXBQX authored Oct 9, 2024
2 parents f5fdc57 + e8b1066 commit cab66b9
Show file tree
Hide file tree
Showing 269 changed files with 3,835 additions and 101,340 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
95 changes: 95 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Publish Docker Container

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
with:
cosign-release: 'v2.2.4'

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
30 changes: 30 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish npm packages
on:
pull_request:
types: [closed]

jobs:
publish:
runs-on: ubuntu-latest
# 当具有 release 标签的 PR 被合并时,自动发布包版本
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.merged == true

steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm and dependencies
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} & pnpm run publish
32 changes: 32 additions & 0 deletions .github/workflows/prepare-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Prepare Publish npm packages
on:
push:
branches:
- '**' # 匹配所有分支
pull_request_target:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
publish:
runs-on: ubuntu-latest
# 当具有 release 标签的 PR 被合并时,自动发布包版本

steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm and dependencies
uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} & pnpm run check:publish
27 changes: 14 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ FROM node:18-alpine AS builder
# 设置工作目录
WORKDIR /app

# 安装 Git 和 pnpm
RUN apk add --no-cache git && \
npm install -g pnpm
# 安装 pnpm
RUN npm install -g pnpm

# 复制当前目录的内容到容器中
COPY . .

# 从 Git 仓库中克隆项目
RUN git clone --depth=1 https://github.com/GraphScope/portal.git . && \
pnpm install && \
RUN pnpm install && \
npm run ci

# 清理不必要的文件
Expand All @@ -32,15 +33,15 @@ WORKDIR /app/server
# 安装proxy的依赖
RUN npm install

# # # 设置环境变量
# ENV PORT=8888
# # ENV COORDINATOR=http://127.0.0.1:8080
# # ENV CYPHER_ENDPOINT=neo4j://127.0.0.1:7687
# # ENV GREMLIN_ENDPOINT=ws://127.0.0.1:12312/gremlin
# 设置环境变量
ENV PORT=8888
ENV COORDINATOR=http://host.docker.internal:8080
ENV CYPHER_ENDPOINT=neo4j://127.0.0.1:7687
ENV GREMLIN_ENDPOINT=ws://127.0.0.1:12312/gremlin

# # 暴露端口
# EXPOSE $PORT
# 暴露端口
EXPOSE $PORT

# 在容器启动时运行的命令
# CMD ["sh", "-c", "npm run dev -- --port=${PORT} --coordinator=${COORDINATOR} --cypher_endpoint=${CYPHER_ENDPOINT} --gremlin_endpoint=${GREMLIN_ENDPOINT}"]
CMD ["sh", "-c", "npm run dev -- --port=${PORT} --coordinator=${COORDINATOR} --cypher_endpoint=${CYPHER_ENDPOINT} --gremlin_endpoint=${GREMLIN_ENDPOINT}"]

8 changes: 8 additions & 0 deletions PUBLISH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This project uses Changesets to manage version releases. The release process is as follows:

1. Complete the relevant development work.
2. Create a branch from `main` (name it as you like).
3. Run `pnpm changeset` and follow the prompts to provide the required information.
4. Run `pnpm run version` to generate the version number.
5. Open a pull request on GitHub to merge your branch into `main`, and add the `publish` tag.
6. Once the branch is merged, GitHub Actions will automatically trigger and publish the package to npm.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,38 @@ There are two ways to start graphscope portal

```bash
# Pull the image
docker pull registry.cn-hongkong.aliyuncs.com/graphscope/portal:latest
docker pull ghcr.io/graphscope/portal:latest
```

```bash
# Run the container
docker run -it -p 8888:8888 --name my-portal registry.cn-hongkong.aliyuncs.com/graphscope/portal:latest
# Enter the container and start the service
npm run dev -- --port=8888 --coordinator=<graphscope_coordinator_endpoint> --cypher_endpoint=<graphscope_cypher_endpoint>
docker run -it \
--name my-portal \
-p 8888:8888 \
-e COORDINATOR=http://host.docker.internal:8080 \
ghcr.io/graphscope/portal:latest
```

> Description of Startup Parameters
- `coordinator` is the address of the GraphScope engine
- `port` is the frontend service port number 8888.
- `cypher_endpoint` is the query address for the GraphScope Interactive engine, default is neo4j://<graphscope_cypher_endpoint>:7687
- `COORDINATOR` refers to the GraphScope engine address. If you have also started the GraphScope engine locally using Docker, you can directly use `host.docker.internal:8080` as the `COORDINATOR` parameter.
- `PORT` is the port number for the frontend service, defaulting to 8888.

### Using GraphScope Engine ()

```bash
# Pull Graphscope Interactive engine, Apple M2 clip
docker pull registry.cn-beijing.aliyuncs.com/graphscope/interactive:0.28.0-arm64
```

```bash
# Run the container
docker run -d \
--name gs-interactive \
--label flex=interactive \
-p 8080:8080 -p 7777:7777 -p 10000:10000 -p 7687:7687 \
registry.cn-beijing.aliyuncs.com/graphscope/interactive:v0.24.2-arm64 --enable-coordinator
```

### Building from the source code

Expand Down
18 changes: 11 additions & 7 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ GraphScope Portal 是一款专为 GraphScope 设计的,基于 Web 的用户交

```bash
# 拉取镜像
docker pull registry.cn-hongkong.aliyuncs.com/graphscope/portal:latest
docker pull ghcr.io/graphscope/portal:latest
```

# 运行容器
docker run -it -p 8888:8888 --name my-portal registry.cn-hongkong.aliyuncs.com/graphscope/portal:latest
# 进入容器,启动服务
npm run dev -- --port=8888 --coordinator=<graphscope_coordinator_endpoint> --cypher_endpoint=<graphscope_cypher_endpoint>

```bash
docker run -it \
--name my-portal \
-p 8888:8888 \
-e COORDINATOR=http://host.docker.internal:8080 \
ghcr.io/graphscope/portal:latest
```

> 启动参数说明
- `coordinator` 是 GraphScope 引擎地址(Interactice 和 Groot)
- `port` 是前端服务端口号 `8888`.
- `cypher_endpoint` 是 GraphScope Interactive 引擎的查询地址
- `COORDINATOR` 是 GraphScope 引擎地址,如果你也在本地用 docker 启动了 GraphScope 引擎,可以直接使用 `host.docker.internal:8080` 作为 `COORDINATOR` 参数。
- `PORT` 是前端服务端口号,默认为 `8888`.

### 方式二:使用源码编译(本机或者云主机都可)

Expand Down
3 changes: 0 additions & 3 deletions examples/Integration-with-jupyter/web_demo.py

This file was deleted.

4 changes: 4 additions & 0 deletions examples/graph-apps/.fatherrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
esm: { output: 'es' },
cjs: { output: 'lib' },
};
37 changes: 37 additions & 0 deletions examples/graph-apps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# @graphscope/graph-apps

## 0.1.4

### Patch Changes

- update
- Updated dependencies
- @graphscope/studio-components@0.1.4
- @graphscope/studio-importor@0.1.4
- @graphscope/studio-driver@0.1.4
- @graphscope/studio-graph@0.1.4
- @graphscope/studio-query@0.1.4

## 0.1.3

### Patch Changes

- update version
- Updated dependencies
- @graphscope/studio-components@0.1.3
- @graphscope/studio-driver@0.1.3
- @graphscope/studio-graph@0.1.3
- @graphscope/studio-importor@0.1.3
- @graphscope/studio-query@0.1.3

## 0.1.2

### Patch Changes

- update graph
- Updated dependencies
- @graphscope/studio-components@0.1.2
- @graphscope/studio-importor@0.1.2
- @graphscope/studio-driver@0.1.2
- @graphscope/studio-graph@0.1.2
- @graphscope/studio-query@0.1.2
1 change: 1 addition & 0 deletions examples/graph-apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Graph Apps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LLM workflow example</title>
<title>Graph Apps</title>
<style>
* {
margin: 0;
Expand Down
Loading

0 comments on commit cab66b9

Please sign in to comment.