From e5e925d7156a0a5d6defd1fb7d9a11f5be2d1631 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 14 Mar 2020 11:05:31 -0500 Subject: [PATCH] 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 --- playbooks/roles/gerrit/tasks/main.yaml | 19 +++++++--------- .../roles/nodepool-builder/tasks/main.yaml | 22 ++++++++++--------- playbooks/service-nodepool.yaml | 5 ++--- playbooks/service-review-dev.yaml | 3 +-- playbooks/service-review.yaml | 3 +-- testinfra/test_nodepool.py | 4 ++-- 6 files changed, 26 insertions(+), 30 deletions(-) diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 1ffdb34177..e33c0da916 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -266,28 +266,25 @@ when: gerrit_redirect_vhost is defined notify: gerrit Reload apache2 -- name: Install podman-compose - pip: - name: podman-compose - state: latest - # NOTE(mordred) Cannot use full path to pip3 here because it is - # different on zuul test nodes and in production. This is, of - # course, not stellar. - executable: pip3 +- name: Install docker-compose + package: + name: + - docker-compose + state: present # TODO(mordred) Make this suck less, like if we could do an init container # or something just generally less gross. - name: Run gerrit init when: gerrit_run_init | bool command: > - podman run -it --rm --net=host -u gerrit + docker run --rm --net=host -u gerrit {% for volume in gerrit_container_volumes %} -v {{ volume }} {% endfor %} {{ 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 -- name: Run podman-compose up +- name: Run docker-compose up shell: - cmd: podman-compose up -d + cmd: docker-compose up -d chdir: /etc/gerrit-compose/ diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml index 185d99f2ba..06829a35d4 100644 --- a/playbooks/roles/nodepool-builder/tasks/main.yaml +++ b/playbooks/roles/nodepool-builder/tasks/main.yaml @@ -25,16 +25,18 @@ dest: /etc/nodepool-builder-compose/docker-compose.yaml mode: 0644 -- name: Install podman-compose - pip: - name: podman-compose - state: latest - # NOTE(mordred) Cannot use full path to pip3 here because it is - # different on zuul test nodes and in production. This is, of - # course, not stellar. - executable: pip3 +- name: Install docker-compose + package: + name: + - docker-compose + state: present -- name: Run podman-compose up +- name: Run docker-compose pull 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/ diff --git a/playbooks/service-nodepool.yaml b/playbooks/service-nodepool.yaml index 35d862462d..af2f5a61e0 100644 --- a/playbooks/service-nodepool.yaml +++ b/playbooks/service-nodepool.yaml @@ -10,8 +10,7 @@ name: "Configure nodepool builders" strategy: free roles: - - pip3 - - install-podman + - install-docker - nodepool-base - configure-openstacksdk - nodepool-builder @@ -19,4 +18,4 @@ # TODO(ianw) 2020-03-03 : watch this space... #- hosts: nodepool-launcher_opendev:!disabled -# name: "Configure nodepool launchers" \ No newline at end of file +# name: "Configure nodepool launchers" diff --git a/playbooks/service-review-dev.yaml b/playbooks/service-review-dev.yaml index 8e21662fbf..1a9f26966e 100644 --- a/playbooks/service-review-dev.yaml +++ b/playbooks/service-review-dev.yaml @@ -1,8 +1,7 @@ - hosts: "review-dev:!disabled" name: "Configure gerrit on review-dev" roles: - - pip3 - - install-podman + - install-docker - role: gerrit gerrit_ssh_rsa_key_contents: "{{ gerrit_dev_ssh_rsa_key_contents }}" gerrit_ssh_rsa_pubkey_contents: "{{ gerrit_dev_ssh_rsa_pubkey_contents }}" diff --git a/playbooks/service-review.yaml b/playbooks/service-review.yaml index 82c5fd6296..6f85d05644 100644 --- a/playbooks/service-review.yaml +++ b/playbooks/service-review.yaml @@ -1,6 +1,5 @@ - hosts: "review:!disabled" name: "Configure gerrit" roles: - - pip3 - - install-podman + - install-docker - gerrit diff --git a/testinfra/test_nodepool.py b/testinfra/test_nodepool.py index d591748ab2..614850f502 100644 --- a/testinfra/test_nodepool.py +++ b/testinfra/test_nodepool.py @@ -36,8 +36,8 @@ def test_builder_container_running(host): if host.backend.get_hostname() != 'nb01-test.opendev.org': pytest.skip() - cmd = host.run("podman ps -a --format '{{ .Names }}'") - assert 'nodepool-builder-compose_nodepool-builder_1' in cmd.stdout + cmd = host.run("docker ps -a --format '{{ .Names }}'") + assert 'nodepoolbuildercompose_nodepool-builder_1' in cmd.stdout def test_builder_webserver_running(host): if host.backend.get_hostname() != 'nb01-test.opendev.org':