Remove symlinked git cache functionality

Prior to zuul v3 there was a cache of all git repositories
on the host, and this functionality used a bind-mount and
symlinks to pull the cache into the repo server as a way
to cut time taken and reduce errors due to git cloning.

The cache is no longer there, so the functionality which
implements the symlink and bind-mount is being removed.

The ability to make use of a git cache is still available
for deployers to use if they want to, but the cache will
be synchronised into the container instead of using bind
mounts and symlinks which was the ionly method intended
for production use anyway.

This cuts down the complexity of the implementation.

Co-Authored-By: Jean-Philippe Evrard <jean-philippe@evrard.me>
Needed-By: I397c67a4b0166ad9f42a186f5c7137571772693a
Change-Id: Id95ad2f01b52222a07cb0775026d941ab86cd9ab
This commit is contained in:
Jesse Pretorius 2017-11-21 07:54:17 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 0749a6c8b3
commit 3e0ef28675
4 changed files with 0 additions and 74 deletions

View File

@ -68,49 +68,6 @@
register: _local_git_cache
when: repo_build_git_cache is defined
- name: Check if deployment host has the bind mount for the master repo container
local_action:
module: stat
path: "{{ repo_build_git_bind_mount }}"
register: _local_repo_bind_mount
when:
- inventory_hostname == groups['repo_all'][0]
- _local_git_cache.stat is defined
- _local_git_cache.stat.exists
- name: Check if the repo container bind mount is empty
local_action: command
ls -1A {{ repo_build_git_bind_mount }}
register: _local_repo_bind_mount_contents
when:
- _local_repo_bind_mount.stat is defined
- _local_repo_bind_mount.stat.exists
- not _local_repo_bind_mount.stat.islnk
- name: Remove the bind mounted git directory so we can symlink the cache folder to replace it
local_action:
module: file
path: "{{ repo_build_git_bind_mount }}"
state: absent
register: _local_repo_bind_mount_dir_remove
when:
- _local_repo_bind_mount.stat is defined
- _local_repo_bind_mount.stat.exists
- not _local_repo_bind_mount.stat.islnk
- _local_repo_bind_mount_contents.stdout_lines | length == 0
- name: Symlink the git cache into the repo container bind mount
local_action:
module: file
src: "{{ repo_build_git_cache }}"
dest: "{{ repo_build_git_bind_mount }}"
state: link
when:
- _local_git_cache.stat is defined
- _local_git_cache.stat.exists
- _local_repo_bind_mount.stat is defined
- _local_repo_bind_mount.stat.exists
- name: Synchronise the contents of the git cache to the repo server
synchronize:
src: "{{ repo_build_git_cache }}"
@ -118,8 +75,6 @@
when:
- _local_git_cache.stat is defined
- _local_git_cache.stat.exists
- _local_repo_bind_mount.stat is defined
- not _local_repo_bind_mount.stat.exists
roles:
- role: "repo_build"

View File

@ -28,24 +28,10 @@
when: repo_build_git_cache is defined
- include: common-tasks/os-lxc-container-setup.yml
static: no
vars:
list_of_bind_mounts:
- mount_path: "/openstack/{{ inventory_hostname }}"
bind_dir_path: "/var/www"
when: repo_build_git_cache is not defined or not _local_git_cache.stat.exists
- include: common-tasks/os-lxc-container-setup.yml
static: no
vars:
list_of_bind_mounts:
- mount_path: "/openstack/{{ inventory_hostname }}"
bind_dir_path: "/var/www"
- mount_path: "{{ repo_build_git_cache }}"
bind_dir_path: "{{ repo_build_git_cache }}"
when:
- repo_build_git_cache is defined
- _local_git_cache.stat.exists
- include: common-tasks/unbound-clients.yml
static: no

View File

@ -119,16 +119,6 @@
repo_build_pip_extra_indexes: "{{ fastest_wheel_mirror.stdout_lines }}"
when: not pip_conf_file.stat.exists
- name: Check whether the host has a git cache
stat:
path: /opt/git/openstack
register: _local_git_cache
- name: Set repo_build_git_cache fact
set_fact:
repo_build_git_cache: /opt/git/openstack
when: _local_git_cache.stat.exists
- name: Set the user_variables
config_template:
src: "{{ bootstrap_user_variables_template }}"

View File

@ -172,11 +172,6 @@ lxc_image_cache_server_mirrors:
cache_timeout: {{ cache_timeout }}
{% endif %}
{% if repo_build_git_cache is defined %}
## Git cache to use for the repo build process
repo_build_git_cache: {{ repo_build_git_cache }}
{% endif %}
# The container backing store is set to 'machinectl' to speed up the
# AIO build time. Options are: [machinectl, overlayfs, btrfs, zfs, dir, lvm]
lxc_container_backing_store: "machinectl"