-
-
Notifications
You must be signed in to change notification settings - Fork 588
feat(nebulagraph): add NebulaGraph module #3266
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4b9458c
feat(nebulagraph): add NebulaGraph module
egasimov a816a18
Resolve comments 1
egasimov cf567ad
Update document
egasimov 1ab1dc4
Remove static container name
egasimov 63e4df0
Resolve comments 2
egasimov b5ccd1a
docs: refine
mdelapenya 0758d24
docs: add nebulagraph to mkdocs nav entry
mdelapenya 508bdf0
chore: fix lint (auto)
mdelapenya f186557
chore: append errors to the same slice
mdelapenya b04544b
chore: handle state error
mdelapenya a86e71d
chore: format errors
mdelapenya 1d80c05
chore: do not hide container package
mdelapenya e2c19c5
chore: handle IPv6
mdelapenya 94ad525
chore: simplify
mdelapenya 12371e9
fix: remove activator on error
mdelapenya 033b5ce
Fix tests 1
egasimov fb1baf5
Fix tests 2
egasimov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # NebulaGraph Module | ||
|
|
||
| Since <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a> | ||
|
|
||
| ## Introduction | ||
|
|
||
| The Testcontainers module for [NebulaGraph](https://nebula-graph.io/), a distributed, scalable, and lightning-fast graph database. This module manages a complete NebulaGraph cluster including Meta Service, Storage Service, and Graph Service components. | ||
|
|
||
| ## Adding this module to your project dependencies | ||
|
|
||
| Add the NebulaGraph module to your Go dependencies: | ||
|
|
||
| ```go | ||
| go get github.com/testcontainers/testcontainers-go/modules/nebulagraph | ||
| ``` | ||
|
|
||
| ## Usage example | ||
|
|
||
| <!--codeinclude--> | ||
| [Creating a NebulaGraph container](../../modules/nebulagraph/nebulagraph_test.go) inside_block:TestNebulaGraphContainer | ||
| <!--/codeinclude--> | ||
|
|
||
| ## Module Reference | ||
|
|
||
| ### RunContainer function | ||
|
|
||
| The NebulaGraph module provides a simple entrypoint function to create a complete NebulaGraph cluster: | ||
|
|
||
| ```golang | ||
| func RunContainer(ctx context.Context) (*NebulaGraphContainer, error) | ||
| ``` | ||
|
|
||
| This function creates a complete NebulaGraph cluster with default settings. It returns a `NebulaGraphContainer` struct that contains references to all three services (Meta, Storage, and Graph). | ||
|
|
||
| ### Run function | ||
|
|
||
| For more advanced configuration, use the `Run` function which accepts customization options for each service: | ||
|
|
||
| ```golang | ||
| func Run(ctx context.Context, | ||
| graphdCustomizers []testcontainers.ContainerCustomizer, | ||
| storagedCustomizers []testcontainers.ContainerCustomizer, | ||
| metadCustomizers []testcontainers.ContainerCustomizer, | ||
| ) (*NebulaGraphContainer, error) | ||
| ``` | ||
|
|
||
| ### Container Options | ||
|
|
||
| The module supports customization for each service container (Meta, Storage, and Graph) through ContainerCustomizer options. Common customizations include: | ||
|
|
||
| - Custom images | ||
| - Environment variables | ||
| - Resource limits | ||
| - Network settings | ||
| - Volume mounts | ||
|
|
||
| ### Container Methods | ||
|
|
||
| The `NebulaGraphContainer` struct provides the following methods: | ||
|
|
||
| #### ConnectionString | ||
|
|
||
| ```golang | ||
| func (c *NebulaGraphContainer) ConnectionString(ctx context.Context) (string, error) | ||
| ``` | ||
|
|
||
| Returns the host:port string for connecting to the NebulaGraph graph service (graphd). | ||
|
|
||
| #### Terminate | ||
|
|
||
| ```golang | ||
| func (c *NebulaGraphContainer) Terminate(ctx context.Context) error | ||
| ``` | ||
|
|
||
| Stops and removes all containers in the NebulaGraph cluster (Meta, Storage, and Graph services). | ||
|
|
||
| ## Default Configuration | ||
|
|
||
| The module uses the following default configurations: | ||
|
|
||
| - Default Images: | ||
| - Graph Service: `vesoft/nebula-graphd:v3.8.0` | ||
| - Meta Service: `vesoft/nebula-metad:v3.8.0` | ||
| - Storage Service: `vesoft/nebula-storaged:v3.8.0` | ||
|
|
||
| - Exposed Ports: | ||
| - Graph Service: 9669 (TCP), 19669 (HTTP) | ||
| - Meta Service: 9559 (TCP), 19559 (HTTP) | ||
| - Storage Service: 9779 (TCP), 19779 (HTTP) | ||
|
|
||
| ## Health Checks | ||
|
|
||
| The module implements health checks for all services: | ||
| - Meta Service and Graph Service: HTTP health check on their respective status endpoints | ||
| - Storage Service: Log-based health check and registration validation | ||
|
|
||
| A container is considered ready when all services are healthy and the storage service is properly registered with the meta service. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| include ../../commons-test.mk | ||
|
|
||
| .PHONY: test | ||
| test: | ||
| $(MAKE) test-nebulagraph |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| module github.com/testcontainers/testcontainers-go/modules/nebulagraph | ||
|
|
||
| go 1.23.6 | ||
|
|
||
| require ( | ||
| dario.cat/mergo v1.0.1 // indirect | ||
| github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect | ||
| github.com/Microsoft/go-winio v0.6.2 // indirect | ||
| github.com/apache/thrift v0.21.0 // indirect | ||
| github.com/cenkalti/backoff/v4 v4.2.1 // indirect | ||
| github.com/containerd/errdefs v1.0.0 // indirect | ||
| github.com/containerd/errdefs/pkg v0.3.0 // indirect | ||
| github.com/containerd/log v0.1.0 // indirect | ||
| github.com/containerd/platforms v0.2.1 // indirect | ||
| github.com/cpuguy83/dockercfg v0.3.2 // indirect | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/distribution/reference v0.6.0 // indirect | ||
| github.com/docker/docker v28.2.2+incompatible // indirect | ||
| github.com/docker/go-connections v0.5.0 // indirect | ||
| github.com/docker/go-units v0.5.0 // indirect | ||
| github.com/ebitengine/purego v0.8.4 // indirect | ||
| github.com/felixge/httpsnoop v1.0.4 // indirect | ||
| github.com/go-logr/logr v1.4.2 // indirect | ||
| github.com/go-logr/stdr v1.2.2 // indirect | ||
| github.com/go-ole/go-ole v1.2.6 // indirect | ||
| github.com/gogo/protobuf v1.3.2 // indirect | ||
| github.com/google/uuid v1.6.0 // indirect | ||
| github.com/jolestar/go-commons-pool v2.0.0+incompatible // indirect | ||
| github.com/klauspost/compress v1.18.0 // indirect | ||
| github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect | ||
| github.com/magiconair/properties v1.8.10 // indirect | ||
| github.com/moby/docker-image-spec v1.3.1 // indirect | ||
| github.com/moby/go-archive v0.1.0 // indirect | ||
| github.com/moby/patternmatcher v0.6.0 // indirect | ||
| github.com/moby/sys/sequential v0.6.0 // indirect | ||
| github.com/moby/sys/user v0.4.0 // indirect | ||
| github.com/moby/sys/userns v0.1.0 // indirect | ||
| github.com/moby/term v0.5.0 // indirect | ||
| github.com/morikuni/aec v1.0.0 // indirect | ||
| github.com/nebula-contrib/nebula-sirius v1.0.0-rc2 // indirect | ||
| github.com/opencontainers/go-digest v1.0.0 // indirect | ||
| github.com/opencontainers/image-spec v1.1.1 // indirect | ||
| github.com/pkg/errors v0.9.1 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect | ||
| github.com/shirou/gopsutil/v4 v4.25.5 // indirect | ||
| github.com/sirupsen/logrus v1.9.3 // indirect | ||
| github.com/stretchr/testify v1.10.0 // indirect | ||
| github.com/testcontainers/testcontainers-go v0.38.0 // indirect | ||
| github.com/tklauser/go-sysconf v0.3.12 // indirect | ||
| github.com/tklauser/numcpus v0.6.1 // indirect | ||
| github.com/yusufpapurcu/wmi v1.2.4 // indirect | ||
| go.opentelemetry.io/auto/sdk v1.1.0 // indirect | ||
| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect | ||
| go.opentelemetry.io/otel v1.35.0 // indirect | ||
| go.opentelemetry.io/otel/metric v1.35.0 // indirect | ||
| go.opentelemetry.io/otel/trace v1.35.0 // indirect | ||
| golang.org/x/crypto v0.37.0 // indirect | ||
| golang.org/x/net v0.34.0 // indirect | ||
| golang.org/x/sys v0.32.0 // indirect | ||
| golang.org/x/text v0.24.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.