Bind mount Gerrit's review_site/data dir

The replication, manage-plugins, and delete-project plugins all seem to
want to write content out to /var/gerrit/data within the Gerrit
container. At /home/gerrit2/review_site/data we've got an old carried
over dir from previous installations but this does not appear to be bind
mounted.

Best I can tell the replication plugin may use this disk location to
keep track of tasks that are queued,running,etc and this may work around
the issues with autoreloading gerrit replication configs. However, we
don't get those benefits when we delete the container (as with
docker-compose down/up-d) as the content is ephemeral within the
container. Address this by bind mounting the location along with the
other bind mounts.

Note I have excluded this from backups as I think we don't need backups
of things like replication queues. That said depending on what the other
plugins use this for we may need to refine our backup rules in the
future.

Change-Id: If3a91aeb1bd86c8514179b8ecfde17e98c29af6a
This commit is contained in:
Clark Boylan 2023-02-27 13:14:34 -08:00
parent 982763cc1e
commit 25de34e908
4 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,7 @@ ADD --chown=gerrit:gerrit https://repo1.maven.org/maven2/org/mariadb/jdbc/mariad
# OpenDev Gerrit listens on 8081 not default of 8080
EXPOSE 29418 8081
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp /var/gerrit/data
RUN ln -s /var/log/gerrit /var/gerrit/logs

View File

@ -18,6 +18,7 @@ letsencrypt_gid: 3003
borg_backup_excludes_extra:
- /home/gerrit2/.launchpadlib/cache/*
- /home/gerrit2/review_site/cache/*
- /home/gerrit2/review_site/data/*
- /home/gerrit2/review_site/tmp/*
- /home/gerrit2/review_site/index/*
# scratch location for admins

View File

@ -12,6 +12,7 @@ gerrit_container_volumes:
- /home/gerrit2/.launchpadlib:/var/gerrit/.launchpadlib
- /home/gerrit2/.ssh:/var/gerrit/.ssh
- /home/gerrit2/review_site/cache:/var/gerrit/cache
- /home/gerrit2/review_site/data:/var/gerrit/data
- /home/gerrit2/review_site/db:/var/gerrit/db
- /home/gerrit2/review_site/etc:/var/gerrit/etc
- /home/gerrit2/review_site/git:/var/gerrit/git

View File

@ -53,6 +53,7 @@
mode: 0755
loop:
- cache
- data
- db
- etc
- etc/its