Skip to content

Update Docker Compose integration to use v2 CLI and get container name#168

Merged
Luladjiev merged 6 commits intomasterfrom
support_compose_v2
Mar 18, 2026
Merged

Update Docker Compose integration to use v2 CLI and get container name#168
Luladjiev merged 6 commits intomasterfrom
support_compose_v2

Conversation

@Luladjiev
Copy link
Copy Markdown
Member

@Luladjiev Luladjiev commented Dec 12, 2025

from labels

This pull request introduces several important updates in preparation for version 14.0.0, including support for Docker Compose v2, removal of Python 3.7 support, and modernization of some dependencies and internal APIs. The changes also update the GitHub Actions test matrix and streamline Docker Compose integration.

Key changes:

Docker Compose v2 support and related improvements:

  • Updated Docker Compose integration to use the docker compose CLI (instead of the Python module or docker-compose), enabling support for Docker Compose v2. This includes changing how compose processes are run and how container service names are extracted, ensuring compatibility across Compose versions. [1] [2] [3]
  • Removed the docker-compose<2 dependency and related comments from setup.py, reflecting the move to Compose v2 and the CLI approach.

Python version and dependency updates:

  • Dropped support for Python 3.7 and updated the GitHub Actions test matrix to test only supported Python versions (3.8+), and updated the tested Ubuntu versions. [1] [2]

Dependency and import modernization:

  • Replaced deprecated pkg_resources usage with importlib.metadata for version retrieval in __init__.py.
  • Switched from pkg_resources.parse_version to packaging.version.parse for version parsing in config.py.

Changelog:

  • Added a new section for v14.0.0 in CHANGELOG.md documenting Docker Compose v2 support and Python 3.7 deprecation.

@Luladjiev Luladjiev marked this pull request as ready for review February 6, 2026 10:25
@Luladjiev Luladjiev requested a review from a team February 6, 2026 10:25
@Luladjiev
Copy link
Copy Markdown
Member Author

@EDITD/platform This PR allows developers using Podman to use Kubetools for development. It was tested by some of the developers already and we didn't stumble upon any issues.

@Luladjiev Luladjiev merged commit 4187aa7 into master Mar 18, 2026
11 checks passed
@Luladjiev Luladjiev deleted the support_compose_v2 branch March 18, 2026 07:52
Comment thread kubetools/config.py
import yaml

from pkg_resources import parse_version
from packaging.version import parse as parse_version
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is packaging coming from? It's not in setup.py so I guess it's a dep of one of our other deps which over time might not be a safe assumption.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread setup.py
'ktd=kubetools.dev.__main__:main',
),
},
python_requires='>=3.6',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're dropping python 3.7 support then shouldn't this be updated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fmcwalters-edited
Copy link
Copy Markdown
Contributor

I started looking into this ages ago and we found problems
#163

@ashirza also has been doing work trying to make this change and has run into similar problems

@fmcwalters-edited
Copy link
Copy Markdown
Contributor

https://edited.atlassian.net/browse/PFM-827

this will break http with ktd for developers. Our docker-registry uses http.

@Luladjiev
Copy link
Copy Markdown
Member Author

@fmcwalters-edited As I mentioned in my previous comment, we’ve been using it for the past couple of months with Podman without any issues. Also if I remember correctly @svedbg tested it on his machine with docker and it worked. Is it possible someone from platform to test with Docker Desktop if it works or not, as we already moved to Podman?

@ashirza
Copy link
Copy Markdown

ashirza commented Mar 18, 2026

moving my comment over from the other branch:

I'm very happy someone else is interested in modernising kubetools 😄 would love to work together on this if we're able to get past the insecure registry blocker/other blockers. I've been using my own custom version locally for a little while now, that I've shared with other members of the team.

I plan to try to test this out with podman - it would be great if we don't run into the same issue that we do with docker/rancher desktop with insecure registries & the underscore/hyphen breaking changes. I do believe that some devs are still using docker desktop, so we should keep this in mind.
I'm not sure what work would need to done in CI (jenkins) here if we find that we're able to proceed as is.

As @fmcwalters-edited mentioned, I've also been doing some work here on this too 😅 most of these were fairly similar (dropping support for 3.6, 3.7), I tried to minimise the changes I made while still modernising kubetools over a few branches (that I haven't pushed yet):

  • the use of python-on-whales, dropping the docker & docker compose python SDKs.
    • As you probably know, the python docker compose SDK won't work with compose v2. The docker SDK hasn't seen a release for 2 years either (although I did see a merge ~4 months ago). Something to consider as a team.
  • Parallel builds, stops etc.
  • the use of compose v2 --compatibility mode, which lets us avoid having to run into the underscore/hyphen issue. although it seems like you've got a change here that accounts for this.
  • bumping pyyaml, so we don't need to pin cython every single time we try to install kubetools
  • flake8 -> ruff
  • py3.13 support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants