Comments (8)
See pull request. Once merged different agents can share the same database by setting -Doagent.pg.schema=second-agent, default is public. Schemas are separated from each other and can support different agent versions.
from business-partner-agent.
Switching to another container-internal in-memory (H2) database is not possible because JSONB datatype is only supported in postgres.
from business-partner-agent.
Yes we specifically use porstgres. Supporting multiple databases would require changing the stack to something like liquibase and hibernate.
Back to original issue, creating databases on the fly is not possible with flyway. The workaround is sharing the same database by using schemas meaning each table has a separate namespace. This can be achieved by exposing a new property. Thats the easy part, the hard part is that our init scripts have the public schema in it, which means we have to reset everything.
from business-partner-agent.
I think docker compose might no be the right tool to handle launching of a larger infrastructure with e.g. several agents being launched. what about switching to a cloud native approach?
Something like: A BPA could be a helm chart which can be configured to launch a database or to use and externally provided one ( ...e.g with another helm chart). For each BPA you need, another helm chart is instantiated....
For postgres clusters there are OSS variants available for K8s: e.g. https://stackgres.io/
from business-partner-agent.
The workaround is sharing the same database by using schemas meaning each table has a separate namespace
Why would you see this more like a workaround , @etschelp ?
If we work with different schemas instead of dbs, would it be possible to launch agents next to each other with different versions?
from business-partner-agent.
@etschelp Thanks for the quick reaction!
Unfortunately, I can't get it working. I deleted all postgres volumes I could find and added the option -Doagent.pg.schema=...
On the first start, I get the following error:
Anything else to change?
15:59:52.803 [main] INFO Schema - Creating schema """0fef2b1df326""" ...
15:59:52.815 [main] INFO JdbcTableSchemaHistory - Creating Schema History table """0fef2b1df326"""."flyway_schema_history" ...
15:59:52.890 [main] INFO DbMigrate - Current version of schema """0fef2b1df326""": null
15:59:52.946 [main] INFO DbMigrate - Migrating schema """0fef2b1df326""" to version 1 - create-initial-schema
15:59:52.970 [main] ERROR DbMigrate - Migration of schema """0fef2b1df326""" to version 1 - create-initial-schema failed! Changes successfully rolled back.
15:59:52.973 [main] ERROR Micronaut - Error starting Micronaut server: Bean definition [javax.sql.DataSource] could not be loaded:
Migration V1__create-initial-schema.sql failed
----------------------------------------------
SQL State : 3F000
Error Code : 0
Message : ERROR: no schema has been selected to create in
Position: 14
Location : databasemigrations/V1__create-initial-schema.sql (/file:/organizational-agent.jar!/databasemigrations/V1__create-initial-schema.sql)
Line : 1
Statement : CREATE TABLE did_doc_web (
id uuid PRIMARY KEY,
created_at timestamp without time zone,
updated_at timestamp without time zone,
did_doc jsonb,
profile_json jsonb
)
from business-partner-agent.
Please pull and try again, there was another property missing.
from business-partner-agent.
Issue resolved. Thank you!
12:49:13.980 [main] INFO VersionPrinter - Flyway Community Edition 6.5.5 by Redgate
12:49:14.278 [main] INFO DatabaseFactory - Database: jdbc:postgresql://postgres/bpa (PostgreSQL 12.4)
12:49:14.369 [main] INFO Schema - Creating schema "8a7acead8d62" ...
12:49:14.379 [main] INFO JdbcTableSchemaHistory - Creating Schema History table "8a7acead8d62"."flyway_schema_history" ...
12:49:15.318 [main] INFO DbMigrate - Current version of schema "8a7acead8d62": null
12:49:15.353 [main] INFO DbMigrate - Migrating schema "8a7acead8d62" to version 1 - create-initial-schema
12:49:16.765 [main] INFO DbMigrate - Successfully applied 1 migration to schema "8a7acead8d62" (execution time 00:01.453s)
12:49:17.161 [pool-2-thread-1] INFO DBOperations - Running startup database operations.
from business-partner-agent.
Related Issues (20)
- clean up bpa maintainer roles HOT 4
- Create Proof Request button in Proof Template not working/implemented HOT 1
- Sever Side Paging in required areas HOT 3
- Add remaining search functionality to paginated lists/tables in backend and frontend
- Improve json-ld schema import HOT 1
- Create a MAINTAINERS.md file HOT 1
- Support for OOB invitations with attachments
- Support transaction author role
- Allow selective disclosure when answering a presentation request HOT 2
- Allow self attested attributes when answering a presentation request HOT 3
- Decouple presentation of all dif exchanges from schema config
- Server-side paging eliminates the need for store dispatches
- Deleting a partner blows up the memory/BPA HOT 1
- Add possibility to add images/files as attributes in credentials HOT 2
- Fix ledger explorer client
- DiDs in the organization profile of partners are displayed incorrectly
- Getting this message when running the script register-dids.sh HOT 2
- Error Message when running register-dids.sh script HOT 76
- .gitpod.Dockerfile contains a forbidden license and must be removed. HOT 3
- Unable to start bpa HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from business-partner-agent.