Hot to run locally and test
-
Start docker compose from this dir
-
Start persistence-service with profile: dev
- this will create the tenant sync exchange
- startup might fail due to tenant-usermanagement not being up. but you need the tenant sync queue first)
-
Start tenant-user-management with profiles: dev, redaction, migration
- this will migrate the master DB and sync KC
- it will also send a message to persistence service to run the migration
- in case the message doesn't arrive - restart persistence and/or this service - the tenant migration in this service is idempotent
-
Persistence service should now queue 1869 files to layout-parser
-
Start layout-parser with profile: dev
-
Start redaction-service with profile: dev
-
Debug issues & repeat
-
UI is available at htpp://localhost:4200/ui -> login with manageradmin/OsloImWinter!23
-
To start clean. docker compose down and up again.
Useful info:
- This docker compose contains a dump from staging from ~2 weeks ago
- KC credentials are: admin / secretPasswordForAdmin1234
- To use different data you need a tenant-manager database dump from an environment of your choice
- this can be obtained via kubectl port forward like so:
kubectl -n <namespace> port-forward services/main-db-postgresql 5432 - followed by a dump:
pg_dumpall -U tenantmanager -h 127.0.0.1 > main.sql
- this can be obtained via kubectl port forward like so:
- And a tenant database:
- this can be obtained via kubectl port forward like so:
kubectl -n <namespace> port-forward services/tenant-db-postgresql 5432 - followed by a dump:
pg_dumpall -U tenantmanager -h 127.0.0.1 > tenant.sql
- this can be obtained via kubectl port forward like so:
- And a KC database:
- this can be obtained via kubectl port forward like so:
kubectl -n <namespace> port-forward services/keycloak-postgresql 5432 - followed by a dump:
pg_dumpall -U tenantmanager -h 127.0.0.1 > tenant.sql
- this can be obtained via kubectl port forward like so:
- You can now use the migration/utils/database Dockerfile to create a fat DB image with the data ( replace data.sql with your dump and tag accordingly)
- For a minio dump you need a similar command ( port fwd sometimes crashes sine clone command uses a lot of connections ):
- open port forward
while true; do kubectl -n redaction-staging port-forward statefulset/redaction-staging-minio 9000 --request-timeout=10m; done - Install mc minio command line utility
- create an alias
mc alias set <mirror_name> http://localhost:9000 minioadminuser minioadminpassword - run:
while true; do mc mirror <mirror_name>/<bucket_name> ./<bucket_name>; done - use migration/utils/minio/Dockerfile to create an image -> you need to copy it to where the export is.
- open port forward
- After you have the images, replace the images in compose with the ones you want