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

feat: add vearch module #2560

Merged
merged 11 commits into from
Jun 6, 2024
Merged

feat: add vearch module #2560

merged 11 commits into from
Jun 6, 2024

Conversation

zhanghexian
Copy link
Contributor

@zhanghexian zhanghexian commented May 30, 2024

What does this PR do?

add vearch modules to generate dependence!

Why is it important?

To add vearch in langchaingo

@zhanghexian zhanghexian requested a review from a team as a code owner May 30, 2024 08:37
Copy link

netlify bot commented May 30, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 774ebcf
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66602bdafa18030008158325
😎 Deploy Preview https://deploy-preview-2560--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya
Copy link
Member

Hi @zhanghexian thanks for creating this new module. Could you share more context about this technology please?

Also, regarding new module contributions, I recommend you reading https://golang.testcontainers.org/modules/, as it comes with instructions on how to run the module generator tool, which adds the module to multiple files for you: GH actions, mkdocs, sonar, etc

@zhanghexian
Copy link
Contributor Author

Hi, I actually want to submit the vearch vector database to langchaingo, but combined with the existed pr, I need to submit now in the testcontainers-go project to build the vearch test dependency (vearch is not accepted in langchaingo, so the self-calling vearch cannot get, so the Vearch is not accepted. Can't pass the test), please give me some advice, thank you!

docs/modules/vearch.md Outdated Show resolved Hide resolved
@mdelapenya mdelapenya changed the title add vearch test package, to add vearch in langchaingo feat: add vearch module Jun 3, 2024
@mdelapenya
Copy link
Member

@zhanghexian could you fill in the PR template 🙏 ?

@zhanghexian
Copy link
Contributor Author

i am sorry,could you tell me how can i fill the PR template? and where?

@zhanghexian
Copy link
Contributor Author

i am sorry ,i found it ! it can edit
image

@zhanghexian
Copy link
Contributor Author

It has been modified, is there anything else that needs to be modified, thank you!

docs/modules/vearch.md Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Member

@zhanghexian could you please run the generator? The makefile is missing too

@mdelapenya mdelapenya self-assigned this Jun 3, 2024
@zhanghexian
Copy link
Contributor Author

i am sorry,i forget upload Makefile,sorry!

@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Jun 4, 2024
Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
@mdelapenya
Copy link
Member

mdelapenya commented Jun 4, 2024

@zhanghexian I downloaded this PR and the module does not even start. Could you please verify it locally? I had to go to vearch docs to understand how to run the project, reading their compose file: they have a TOML config file, and they need all as CMD. Please see https://github.com/vearch/vearch/blob/master/cloud/docker-compose.yml. I updated the request to:

//go:embed config/config.toml
var configFile string

func RunContainer(...) {
	req := testcontainers.ContainerRequest{
		Image:        "vearch/vearch:3.5.1",
		ExposedPorts: []string{"8817/tcp", "9001/tcp"},
		Cmd:          []string{"all"},
		Files: []testcontainers.ContainerFile{
			{
				Reader:            strings.NewReader(configFile),
				ContainerFilePath: "/vearch/config/config.toml",
			},
		},
		WaitingFor: wait.ForAll(
			wait.ForListeningPort("8817/tcp"),
			wait.ForListeningPort("9001/tcp"),
		).WithDeadline(time.Minute * 1),
	}

and it does not even start in that time. I'm marking this PR as draft until you get it passing locally. Besides that, make sure you run go mod tidy in the module so that the grpc dependency gets removed.

Finally, I'd suggest adding a testable example showcasing how to consume this module using the Go SDK for vearch, which will be very helpful for the users of the module.

Thanks!

@mdelapenya mdelapenya marked this pull request as draft June 4, 2024 08:07
@zhanghexian
Copy link
Contributor Author

Hello, the container has been started and the test has passed. Please check it, thank you!!!
image

@zhanghexian zhanghexian marked this pull request as ready for review June 5, 2024 09:11
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdelapenya mdelapenya merged commit 392b6e5 into testcontainers:main Jun 6, 2024
108 checks passed
@zhanghexian
Copy link
Contributor Author

thanks for your help!

mdelapenya added a commit that referenced this pull request Jun 7, 2024
* main:
  feat: add vearch module (#2560)
mdelapenya added a commit to bearrito/testcontainers-go that referenced this pull request Jun 11, 2024
* main: (48 commits)
  Fix race condition when looking up reaper (ryuk) container (testcontainers#2508)
  chore: bring golangci-lint back (testcontainers#2571)
  docs(compose): Fix typo docker compose docs (testcontainers#2565)
  Handle error properly during port forwarding initialization. (testcontainers#2550)
  chore: pin vearch version (testcontainers#2568)
  feat: add vearch module (testcontainers#2560)
  chore: run tests against latest Docker engine, nightly (testcontainers#2566)
  chore(deps): bump mkdocs-include-markdown-plugin from 6.0.4 to 6.0.7 (testcontainers#2562)
  Fix network accessor for port-forwarding feature (testcontainers#2551)
  --- (testcontainers#2549)
  fix: update search bar eval in mkdocs (testcontainers#2547)
  docs: improve contributing docs for code snippets (testcontainers#2546)
  chore: use a virtualenv for working with the docs site (testcontainers#2545)
  docs: document test session semantics (testcontainers#2544)
  feat(ryuk): allow to configure ryuk timeouts using env variables (testcontainers#2541)
  docs: fix CircleCI docs (testcontainers#2539)
  fix: add import to module generation (testcontainers#2537)
  chore: prepare for next minor development cycle (0.32.0)
  chore: use new version (v0.31.0) in modules and examples
  feat(mongodb): add replica set support via opts (testcontainers#2469)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants