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

Generate test application with pgvector and spring-ai if pgvector is selected #1420

Closed
wants to merge 11 commits into from

Conversation

eddumelendez
Copy link
Contributor

@eddumelendez eddumelendez commented Feb 28, 2024

pgvector/pgvector image is based on postgres image but doesn't provide latest tag.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 28, 2024
@eddumelendez eddumelendez marked this pull request as draft February 28, 2024 21:20
@eddumelendez
Copy link
Contributor Author

eddumelendez commented Feb 28, 2024

@eddumelendez eddumelendez changed the title Generate test application with pgvector when compose and spring-ai pgvector are selected Generate test application with pgvector and spring-ai pgvector is selected Feb 28, 2024
@mhalbritter
Copy link
Contributor

spring-io/initializr#1512 is merged :)

@eddumelendez eddumelendez marked this pull request as ready for review March 1, 2024 02:29
@eddumelendez
Copy link
Contributor Author

eddumelendez commented Mar 1, 2024

looks like it depends on initializr release to compile. I wonder if once it compiles this can be available, it will be safe because the testcontainers support is under a condition and compose will just work. Both PRs mentioned here were merged. Otherwise, those are the steps to make this available:

  • Release initializr and bump the dependency in start.spring.io
  • Release Testcontainers 1.19.7
  • Bump Testcontainers dependency in Spring Boot
  • Release Spring Boot 3.2.4
  • Merge this PR

@mhalbritter
Copy link
Contributor

We don't need to release initialzr, as start.spring.io uses the snapshot dependency of it.

So, this PR adds code which starts a PGvector testcontainer / docker compose service. But there's nothing in Spring AI which reacts to those services, right? So while this is nice for users, they still need to provide some application properties to get this running out of the box.

@markpollack What do you think of adding service connection support to Spring AI for such cases?

@eddumelendez
Copy link
Contributor Author

eddumelendez commented Mar 1, 2024

@mhalbritter PGVector support in spring-ai depends on JdbcTemplateAutoconfiguration. So, I think it should be already covered with this PR.

We are discussing support for other vector databases in spring-projects/spring-ai#151

@mhalbritter
Copy link
Contributor

Ah, i missed that. You're using the label to specify the container to be a postgres container, that's why it works.

@eddumelendez
Copy link
Contributor Author

Testcontainers 1.19.7 has been released and now pgvector can be used as simple as PostgreSQLContainer("pgvector/pgvector:pg16")

@eddumelendez
Copy link
Contributor Author

Hi @mhalbritter, tasks listed in this comment are done. Looking forward to see this merged :)

@mhalbritter mhalbritter changed the title Generate test application with pgvector and spring-ai pgvector is selected Generate test application with pgvector and spring-ai if pgvector is selected Mar 25, 2024
mhalbritter added a commit that referenced this pull request Mar 25, 2024
@mhalbritter
Copy link
Contributor

Thanks a lot Eddú!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants