Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Remove dependency on docker-compose #1154

Closed
4 tasks
rgraber opened this issue Aug 14, 2023 · 2 comments
Closed
4 tasks

Remove dependency on docker-compose #1154

rgraber opened this issue Aug 14, 2023 · 2 comments
Assignees

Comments

@rgraber
Copy link
Contributor

rgraber commented Aug 14, 2023

A/C:

  • docker-compose is no longer being installed in devstack.
  • Replace use of the docker-compose commands that are the old way of doing things.
  • Document the minimum version required for the Docker engine that handles docker compose.
  • Announcement that we have made this change.

Devstack lists docker-compose as a dependency in its base.in. Docker-compose is no longer being maintained, having been replaced by docker compose in the latest Docker versions. The docker-compose dependency pins pyyaml to <6.0, which breaks make requirements on Silicon machines.
We should remove the dependency on docker-compose and replace all usages of it with docker compose.
Note that the latest version of Docker devstack automatically patches docker-compose to docker compose so docker-compose will still work on most machines even if we remove the dependency. It will break on Linux, however.

@rgraber rgraber added this to Arch-BOM Aug 14, 2023
@dianakhuang dianakhuang moved this to Prioritized in Arch-BOM Aug 15, 2023
@dianakhuang dianakhuang moved this from Prioritized to Groomed in Arch-BOM Aug 29, 2023
@timmc-edx
Copy link
Contributor

I just tried this out on Ubuntu 22.04 LTS and it looks good. Notes for Linux users:

  • I more or less followed the instructions at https://docs.docker.com/engine/install/ubuntu/ to install the newer docker, v24.
  • When I uninstalled the Ubuntu-provided docker.io and docker-compose packages I used apt purge, but that removes all of the volumes. I had backups, so this was fine, but most people will want to use apt remove instead. These were v20 or so, for reference.
  • For anyone who likes using Ansible to manage their development machine:
    # Docker apt keyring fetched 2023-08-29:
    #
    # curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o ../files/docker-apt-ubuntu.gpg
    - name: "Docker apt repo key"
      copy:
        src: "{{ role_path }}/files/docker-apt-ubuntu.gpg"
        dest: "/etc/apt/keyrings/docker.gpg"
      register: devstack__apt_sources_docker_key
    
    - name: "Docker apt repo"
      copy:
        content: |
          deb [arch="amd64" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable
        dest: /etc/apt/sources.list.d/docker.list
      register: devstack__apt_sources_docker_list
    
    - name: "Update apt if docker sources changed"
      apt:
        update_cache: yes
      when: >-
        devstack__apt_sources_docker_key.changed
        or devstack__apt_sources_docker_list.changed
    
    - name: "Install packages"
      apt:
        name:
        - docker-ce
        - docker-compose-plugin
    
  • I changed my Makefile to use the compose subcommand, and everything seems to still work.
  • I also added the following shim so that I can use the newer docker in the meantime without any devstack changes:
    $ cat ~/bin/docker-compose
    #!/bin/bash
    
    docker compose "$@"
    

@rgraber rgraber moved this from Groomed to In Progress in Arch-BOM Aug 31, 2023
@rgraber rgraber self-assigned this Aug 31, 2023
@rgraber
Copy link
Contributor Author

rgraber commented Sep 14, 2023

Completed with #1172

@rgraber rgraber closed this as completed Sep 14, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Arch-BOM Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants