Skip to content
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

Allow passing clienthome as environment var #171

Closed
wants to merge 5 commits into from

Conversation

erral
Copy link
Member

@erral erral commented Feb 12, 2025

We use the plone-backend image together with the plone-zeo image in a docker-compose.yml file. We are not confident enought to use Relstorage 😉

We configure the /data folder as a volume and persist it to a given location in disk. We also configure the ZEO client to use the shared blobstorage.

In such scenario, we end up with a lot of folders in the /data directory named with hex characters. A new folder is created each time we deploy a new docker image. See the attached image:

2025-02-12 15-20-51

Those folders only contain the Z4.pid file with the pid of the Zope process.

I have traced this down to these lines, where the CLIENTHOME is defined in docker-entrypoint.sh

If we provide a way to override the CLIENTHOME using an environment var we could define it somewhere out of /data (such as /app/var or wherever) and this way I would get rid of all those files in the mounted /data volume.

Does it make sense to you?

@@ -1,6 +1,9 @@
%define INSTANCE /app
instancehome $INSTANCE

%define CLIENTHOME $(CLIENT_HOME)
clienthome $CLIENTHOME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was CLIENT_HOME from docker-entrypoint.sh just ignored before?

Is it possible to do clienthome $(CLIENT_HOME) without defining CLIENTHOME?

I think we should only merge this for 6.0.x if we make the same change for 6.1.x.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was CLIENT_HOME from docker-entrypoint.sh just ignored before?

it was used in zeo.conf (when ZEO configuration), but not in zope.conf, that's why I bring it also here, it will do no harm having it here too.

Is it possible to do clienthome $(CLIENT_HOME) without defining CLIENTHOME?

That's why in docker-entrypoint.sh I set its value to be the one defined in the env var (if it exists). The only change is that now it is allowed to set its value through an environment var, beforehand it was hardcoded.

I think we should only merge this for 6.0.x if we make the same change for 6.1.x.

Yes, I just did the PR for 6.0.x but I will do it also for 6.1.x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it makes sense to keep it consistent with zeo.conf and relstorage.conf.

@erral
Copy link
Member Author

erral commented Feb 19, 2025

I will open new PRs from this repository itself to avoid errors when running CI.

@erral erral closed this Feb 19, 2025
davisagli added a commit that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants