-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Scripts from docker-entrypoint-initdb.d
are not executed when using --store=type=mem,size=0.25
for start-single-node
#80005
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. It looks like you have not filled out the issue in the format of any of our templates. To best assist you, we advise you to use one of these templates. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Thanks for making this issue! We definitely missed the case where memory is used for storage. The key issue is that currently the datasets created in the init process are stored on disk, and they are inaccessible if the "real" server is started with storage in memory. For the container initialization, the current logic is:
The possible workaround is to start and keep running the init server with the given parameters, and eliminate the "stop and restart" step. However, this can be a bit tricky, because without a foreground process, the container would automatically exit after executing all logic in I'm still investigating more solutions. Will reply under this thread once I find a solid one. |
Ah, I see - thanks for the acknowledgement and explanation. Prisma will keep using the non memory option then for now. |
Currently the datasets created in the init process are stored on disk, and they are inaccessible if the “real” server is started with storage in memory. This is because for the container initialization, the current logic is: 1. start_init_server: start the single-node server in the background, with default on-disk storage setting; 2. run_init_queries: create default db and user, and run the init scripts saved in docker-entrypoint-initdb.d; 3. *stop the init server and restart the server* with given parameters in foreground. In this commit we start and keep running the init server with the given parameters, and eliminate the “stop and restart” step. Also, bring the server process from background to foreground with fg once all init queries are finished. Fixes cockroachdb#80005. Release note (docker): refactor the initialization process of the docker image to accomodate the use case with memory storage.
Currently the datasets created in the init process are stored on disk, and they are inaccessible if the “real” server is started with storage in memory. This is because for the container initialization, the current logic is: 1. start_init_server: start the single-node server in the background, with default on-disk storage setting; 2. run_init_queries: create default db and user, and run the init scripts saved in docker-entrypoint-initdb.d; 3. *stop the init server and restart the server* with given parameters in foreground. In this commit we start and keep running the init server with the given parameters, and eliminate the “stop and restart” step. Also, bring the server process from background to foreground with fg once all init queries are finished. Fixes cockroachdb#80005. Release note (docker): refactor the initialization process of the docker image to accomodate the use case with memory storage.
Currently the datasets created in the init process are stored on disk, and they are inaccessible if the “real” server is started with storage in memory. This is because for the container initialization, the current logic is: 1. start_init_server: start the single-node server in the background, with default on-disk storage setting; 2. run_init_queries: create default db and user, and run the init scripts saved in docker-entrypoint-initdb.d; 3. *stop the init server and restart the server* with given parameters in foreground. In this commit we start and keep running the init server with the given parameters, and eliminate the “stop and restart” step. Also, bring the server process from background to foreground with fg once all init queries are finished. Fixes #80005. Release note (docker): refactor the initialization process of the docker image to accomodate the use case with memory storage.
Currently the datasets created in the init process are stored on disk, and they are inaccessible if the “real” server is started with storage in memory. This is because for the container initialization, the current logic is: 1. start_init_server: start the single-node server in the background, with default on-disk storage setting; 2. run_init_queries: create default db and user, and run the init scripts saved in docker-entrypoint-initdb.d; 3. *stop the init server and restart the server* with given parameters in foreground. In this commit we start and keep running the init server with the given parameters, and eliminate the “stop and restart” step. Also, bring the server process from background to foreground with fg once all init queries are finished. Fixes cockroachdb#80005. Release note (docker): refactor the initialization process of the docker image to accomodate the use case with memory storage.
We have successfully been using an adapted Docker image with a file in
/docker-entrypoint-initdb.d
to create a user and apply the suggested testing configuration: https://github.com/prisma/engine-images/blob/7695bfcc990b5f91cf5d86b15ec95fc3b129f709/cockroach/cockroach.DockerfileNow we were also recommended to use
--store=type=mem,size=0.25
as an additional argument tostart-single-node --insecure
and noticed that a) the user is not present any more and b) all the configuration is default - so I think our.sql
file from our image is not run correctly.Reproduction is possible via this docker-compose:
The
prismagraphql/build:cockroach-custom
is our customized image that adds the.sql
file tocockroachdb/cockroach-unstable:v22.1.0-alpha.1
, it is built via https://github.com/prisma/engine-images/blob/7695bfcc990b5f91cf5d86b15ec95fc3b129f709/cockroach/cockroach.Dockerfile linked above.Jira issue: CRDB-15693
The text was updated successfully, but these errors were encountered: