Skip to content
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

refactor: Make gsctl to be more like a database design #3648

Merged
merged 4 commits into from Mar 23, 2024

Conversation

lidongze0629
Copy link
Collaborator

@lidongze0629 lidongze0629 commented Mar 21, 2024

What do these changes do?

gsctl

graphscope@host:/work$ gsctl

    ______                 __   _____
   / ____/________ _____  / /_ / ___/_________  ____  ___
  / / __/ ___/ __ `/ __ \/ __ \\__ \/ ___/ __ \/ __ \/ _ \
 / /_/ / /  / /_/ / /_/ / / / /__/ / /__/ /_/ / /_/ /  __/
 \____/_/   \__,_/ .___/_/ /_/____/\___/\____/ .___/\___/
                /_/                         /_/

Currently, gsctl hasn't connect to any service.

you can use gsctl as an utility script.
Or you can connect to a launched GraphScopoe service by `gsctl connect --coordinator-endpoint <address>`.
See more detailed information at https://graphscope.io/docs/utilities/gs.

Usage: gsctl [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  close         Disconnect from coordinator
  connect       Connect to a launched coordinator
  flexbuild     Build docker image for Interactive, Insight product.
  install-deps  Install dependencies for building GraphScope.
  make          Build executive binaries of COMPONENT.
  make-image    Make docker images from source code for deployment.
  test          Trigger tests on built artifacts.

connect to a coordinator(global scope)

graphscope@host:/work$ gsctl connect --coordinator-endpoint xxxxx && gsctl
Using GLOBAL.
Run `gsctl use GRAPH <graph_identifier>` to switch to a specific graph context.

Usage: gsctl [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  close    Disconnect from coordinator
  connect  Connect to a launched coordinator
  create   Create a new graph in database
  delete   Delete a graph by identifier
  ls       Display graph resources in database
  service  Start, stop, and restart the database service
  use      Switch to GRAPH context, see identifier with `ls` command

change to a specific graph scope (graph scope)

graphscope@host:/work$ gsctl use GRAPH dongze_test_graph
Using GRAPH dongze_test_graph

graphscope@host:/work$ gsctl ls
Using GRAPH dongze_test_graph.
Run `gsctl use GLOBAL` to switch back to GLOBAL context.

schema
├── vertex types
│   ├── person
│   │   ├── Property(name: id, type: DT_SIGNED_INT64, is_primary_key: True)
│   │   ├── Property(name: name, type: DT_STRING, is_primary_key: False)
│   │   └── Property(name: age, type: DT_SIGNED_INT32, is_primary_key: False)
│   └── software
│       ├── Property(name: id, type: DT_SIGNED_INT64, is_primary_key: True)
│       ├── Property(name: name, type: DT_STRING, is_primary_key: False)
│       └── Property(name: lang, type: DT_STRING, is_primary_key: False)
└── edge types
    ├── (person) -[knows]-> (person)
    │   └── Property(name: weight, type: DT_DOUBLE, is_primary_key: False)
    └── (person) -[created]-> (software)
        └── Property(name: weight, type: DT_DOUBLE, is_primary_key: False)

data sources
├── vertex mappings
└── edge mappings

stored procedure

job
├── Job(identifier: job_dongze_test_graph_1709023420190_51285, type: bulk_loading, status: SUCCESS, start time: 2024-02-27 16:43:40, end time: 2024-02-27 16:44:10)

create a procedure

graphscope@host:/work$  gsctl create procedure -f /path/to/your/procedure/file
[SUCCESS] Create stored procedure xxx successfully.

switch back to the global context (global scope)

graphscope@host:/work$ gsctl use GLOBAL
Using GLOBAL

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 192 lines in your changes are missing coverage. Please review.

Project coverage is 26.93%. Comparing base (5938321) to head (cf4df7d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3648      +/-   ##
==========================================
+ Coverage   25.96%   26.93%   +0.96%     
==========================================
  Files         187      185       -2     
  Lines       17379    16757     -622     
==========================================
  Hits         4513     4513              
+ Misses      12866    12244     -622     
Files Coverage Δ
python/graphscope/gsctl/commands/dev.py 0.00% <ø> (ø)
python/graphscope/gsctl/impl/common.py 0.00% <ø> (ø)
python/graphscope/gsctl/impl/__init__.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/impl/job.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/impl/utils.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/commands/common.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/config.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/commands/__init__.py 0.00% <0.00%> (ø)
python/graphscope/gsctl/utils.py 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5938321...cf4df7d. Read the comment docs.

@sighingnow sighingnow merged commit 93ab564 into alibaba:main Mar 23, 2024
57 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants