Switch back to docker for gerrit and nodepool-builder

We rolled out review-dev with podman and it worked fine for us. It
worked less fine for nodepool-builder, although we still might be
able to solve it. Maybe right now isn't the time to do this switch.
Gitea, gitea-lb and zuul-registry all use docker instead of podman.

The only thing running with podman right now is review-dev. We can
do a manual cleanup of podman there before runnign this to keep
things simple:

  - stop gerrit service
  - uninstall podman and podman-compose
  - uninstall podman ppa config
  - uninstall pip3

Then let ansible install docker and docker compose up.

Story: #2007407
Task: #39062
Change-Id: I9bf99b18559d49d11ba99a96f02a4a45a4f65a86
This commit is contained in:
Monty Taylor 2020-03-14 11:05:31 -05:00 committed by Ian Wienand
parent 44335ab2be
commit e5e925d715
6 changed files with 26 additions and 30 deletions

View File

@ -266,28 +266,25 @@
when: gerrit_redirect_vhost is defined when: gerrit_redirect_vhost is defined
notify: gerrit Reload apache2 notify: gerrit Reload apache2
- name: Install podman-compose - name: Install docker-compose
pip: package:
name: podman-compose name:
state: latest - docker-compose
# NOTE(mordred) Cannot use full path to pip3 here because it is state: present
# different on zuul test nodes and in production. This is, of
# course, not stellar.
executable: pip3
# TODO(mordred) Make this suck less, like if we could do an init container # TODO(mordred) Make this suck less, like if we could do an init container
# or something just generally less gross. # or something just generally less gross.
- name: Run gerrit init - name: Run gerrit init
when: gerrit_run_init | bool when: gerrit_run_init | bool
command: > command: >
podman run -it --rm --net=host -u gerrit docker run --rm --net=host -u gerrit
{% for volume in gerrit_container_volumes %} {% for volume in gerrit_container_volumes %}
-v {{ volume }} -v {{ volume }}
{% endfor %} {% endfor %}
{{ gerrit_container_image }} {{ gerrit_container_image }}
/usr/local/openjdk-8/bin/java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit -b --no-auto-start --install-all-plugins /usr/local/openjdk-8/bin/java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit -b --no-auto-start --install-all-plugins
- name: Run podman-compose up - name: Run docker-compose up
shell: shell:
cmd: podman-compose up -d cmd: docker-compose up -d
chdir: /etc/gerrit-compose/ chdir: /etc/gerrit-compose/

View File

@ -25,16 +25,18 @@
dest: /etc/nodepool-builder-compose/docker-compose.yaml dest: /etc/nodepool-builder-compose/docker-compose.yaml
mode: 0644 mode: 0644
- name: Install podman-compose - name: Install docker-compose
pip: package:
name: podman-compose name:
state: latest - docker-compose
# NOTE(mordred) Cannot use full path to pip3 here because it is state: present
# different on zuul test nodes and in production. This is, of
# course, not stellar.
executable: pip3
- name: Run podman-compose up - name: Run docker-compose pull
shell: shell:
cmd: podman-compose up -d cmd: docker-compose pull
chdir: /etc/nodepool-builder-compose/
- name: Run docker-compose up
shell:
cmd: docker-compose up -d
chdir: /etc/nodepool-builder-compose/ chdir: /etc/nodepool-builder-compose/

View File

@ -10,8 +10,7 @@
name: "Configure nodepool builders" name: "Configure nodepool builders"
strategy: free strategy: free
roles: roles:
- pip3 - install-docker
- install-podman
- nodepool-base - nodepool-base
- configure-openstacksdk - configure-openstacksdk
- nodepool-builder - nodepool-builder

View File

@ -1,8 +1,7 @@
- hosts: "review-dev:!disabled" - hosts: "review-dev:!disabled"
name: "Configure gerrit on review-dev" name: "Configure gerrit on review-dev"
roles: roles:
- pip3 - install-docker
- install-podman
- role: gerrit - role: gerrit
gerrit_ssh_rsa_key_contents: "{{ gerrit_dev_ssh_rsa_key_contents }}" gerrit_ssh_rsa_key_contents: "{{ gerrit_dev_ssh_rsa_key_contents }}"
gerrit_ssh_rsa_pubkey_contents: "{{ gerrit_dev_ssh_rsa_pubkey_contents }}" gerrit_ssh_rsa_pubkey_contents: "{{ gerrit_dev_ssh_rsa_pubkey_contents }}"

View File

@ -1,6 +1,5 @@
- hosts: "review:!disabled" - hosts: "review:!disabled"
name: "Configure gerrit" name: "Configure gerrit"
roles: roles:
- pip3 - install-docker
- install-podman
- gerrit - gerrit

View File

@ -36,8 +36,8 @@ def test_builder_container_running(host):
if host.backend.get_hostname() != 'nb01-test.opendev.org': if host.backend.get_hostname() != 'nb01-test.opendev.org':
pytest.skip() pytest.skip()
cmd = host.run("podman ps -a --format '{{ .Names }}'") cmd = host.run("docker ps -a --format '{{ .Names }}'")
assert 'nodepool-builder-compose_nodepool-builder_1' in cmd.stdout assert 'nodepoolbuildercompose_nodepool-builder_1' in cmd.stdout
def test_builder_webserver_running(host): def test_builder_webserver_running(host):
if host.backend.get_hostname() != 'nb01-test.opendev.org': if host.backend.get_hostname() != 'nb01-test.opendev.org':