Skip to content

gitaly: Introduce new `runtime_dir` configuration

Patrick Steinhardt requested to merge pks-gitaly-runtime-dir into master

What does this MR do?

Gitaly has recently introduced support for a new runtime directory: this directory is supposed to hold all files and directories Gitaly needs to create at runtime in order to operate correctly. Most importantly, this includes things like internal sockets, the Git execution environment and the temporary hooks directory. The intent is for there to finally be a unified approach to handle this kind of data in a central place.

As part of this Gitaly has introduced a new runtime_dir configuration that allows the admin to choose where that directory should be located. If left unset, Gitaly simply uses the global temporary directory, which is typicall /tmp. There are systems though where files in there will automatically get pruned in regular intervals if the files are older than a specific grace period and not used. Whether a directory is used or not is based on the atime though, which may not even be updated in case /tmp is mounted with noatime. Consequentially, it could happen that Gitaly's runtime files are pruned even though they're still in use.

Wire up support for this new runtime directory and set up a default value so that we don't fall prey to this issue. Furhermore, this MR also stops setting internal_socket_dir by default, which is superseded by the new runtime directory.

Related issues

gitaly#4113 (closed)

gitaly!4415 (merged)

Closes #6755 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by Patrick Steinhardt

Merge request reports