Prisma1: Unify docker images `prisma` and `prisma-prod`

Created on 3 Aug 2018  路  5Comments  路  Source: prisma/prisma1

Is your feature request related to a problem? Please describe.
We have 2 different images for local prisma and actual production deployments. The difference between those are:

  • the prod image can disable the Management API by setting managementApiEnabled: false in the server config
  • the prod image always tries to connect to a RabbitMQ specified by the rabbitUri property.

Describe the solution you'd like
We should only have one Prisma image that:

  • respects the managementApiEnabled setting
  • decides whether to use RabbitMQ or not depending on the presence of the rabbitUri property.

Describe alternatives you've considered
None

Additional context
I stumbled upon this issue while i advised people on a production setup for Prisma in this issue. They were trying to disable the Management API for the local image which was not possible.

kinfeature areserver

Most helpful comment

@jhalborg:

  1. The differences i described are the only ones.
  2. If you want to setup a horizontally scalable setup you should not use prisma but the prisma-prod image. The reason is that only one management API must be active in a cluster of servers. Therefore we you must run exactly one instance of Prisma with the management API enabled and an arbitrary number of instances with the management API disabled. We call those primary and secondary instances.

All 5 comments

@mavilein - This would indeed be easier to understand.

I have two followup questions:

  1. Are there any other differences between the two?
  2. Do you not recommend using prisma in production (when protected by a management API secret)? If not, how come?

@jhalborg:

  1. The differences i described are the only ones.
  2. If you want to setup a horizontally scalable setup you should not use prisma but the prisma-prod image. The reason is that only one management API must be active in a cluster of servers. Therefore we you must run exactly one instance of Prisma with the management API enabled and an arbitrary number of instances with the management API disabled. We call those primary and secondary instances.

@mavilein Do we still need to use prisma-prod?

decides whether to use RabbitMQ or not depending on the presence of the rabbitUri property

If we have 1 "primary service" for deployments (managementApiEnabled: true) and 1 "secondary service" for actual requests (managementApiEnabled: false), do we need RabbitMQ? Will the secondary server notice schema changes without it?

@frandiox : Yes you need it. The RabbitMQ is used to propagate datamodel changes from the management server to secondary ones.

That aside we are currently working on removing the need for RabbitMQ with Prisma 2.

@mavilein I'm creating an Helm chart for Prisma-Prod.
I was looking for the Dockefile that generates the -heroku suffix.

Due to secrets handlinkg in kubernets I would need a pruduction like docker image with the -heroku suffix:
https://github.com/helm/charts/issues/13530#issuecomment-570154690

Unfortunatly I didn't find anything on this repo, I would create my own production like image with the heroku env handling.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akoenig picture akoenig  路  3Comments

sorenbs picture sorenbs  路  3Comments

MitkoTschimev picture MitkoTschimev  路  3Comments

AlessandroAnnini picture AlessandroAnnini  路  3Comments

schickling picture schickling  路  3Comments