cancel
Showing results for 
Search instead for 
Did you mean: 

Any concern to share generated folder across containers?

SOLVED

Any concern to share generated folder across containers?

We are running Magento on Kubernetes, so every time we have some more traffic new pods/containers scale up and down multiple times a day.

 

We are seeing some weird things happening and it seems like the `generated` folder should be shared across containers.


We build the image used to bring the containers up, but it only contains the `generated/metadata` folder as we run `di:compile` as part of the docker image build.

We run the `setup:upgrade` on a separate container that we call `post-deploy`.

 

We are thinking about sharing the `generated` folder on EFS, is there any concern with this?
Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Any concern to share generated folder across containers?

It seems like there wouldn't have any issue sharing the generated folder across containers, but for now we have decided to NOT share the generated folder.
We already run `setup:di:compile` when creating the docker image and that does the job to generated all files.

 

During our post-deploy we run `setup:upgrade --keep-generated`. When running `--keep-generated` it will maintain the generated files, but it will update the database schema.

 

The error we were seeing was due to permission issues with the generated folder.
The group didn't have write permission to the folder, we fix the permission before running `setup:di:compile` and then fix it again to lock it up after the command is complete.

View solution in original post

1 REPLY 1

Re: Any concern to share generated folder across containers?

It seems like there wouldn't have any issue sharing the generated folder across containers, but for now we have decided to NOT share the generated folder.
We already run `setup:di:compile` when creating the docker image and that does the job to generated all files.

 

During our post-deploy we run `setup:upgrade --keep-generated`. When running `--keep-generated` it will maintain the generated files, but it will update the database schema.

 

The error we were seeing was due to permission issues with the generated folder.
The group didn't have write permission to the folder, we fix the permission before running `setup:di:compile` and then fix it again to lock it up after the command is complete.