Skip to content

Comments

Replace docker-compose with official Docker SDK#214

Merged
Abhishek Krishna (abh1sh5k) merged 13 commits intomasterfrom
replace-docker-compose-with-sdk
Feb 19, 2026
Merged

Replace docker-compose with official Docker SDK#214
Abhishek Krishna (abh1sh5k) merged 13 commits intomasterfrom
replace-docker-compose-with-sdk

Conversation

@abh1sh5k
Copy link
Member

@abh1sh5k Abhishek Krishna (abh1sh5k) commented Feb 4, 2026

Summary

Migrates from the deprecated docker-compose Python library to the official Docker SDK for Python.

Changes

  • Removed: docker-compose==1.29.2 dependency (deprecated, last release 2021)
  • Added: PyYAML for compose file parsing, boto3 for ECR support
  • New: compose.py module providing Docker SDK-based compose functionality
  • Updated: tox.ini for Python 3.14

Testing

All existing tests pass with the new implementation.
Integration tests are passing on ksql-images here

@abh1sh5k Abhishek Krishna (abh1sh5k) requested a review from a team as a code owner February 4, 2026 10:03
Copilot AI review requested due to automatic review settings February 4, 2026 10:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates away from the deprecated docker-compose Python library by introducing a lightweight “compose-like” layer backed by the official Docker SDK, while updating CI/runtime dependencies to support the new implementation.

Changes:

  • Replace docker-compose usage with a new ComposeProject/ComposeService/ComposeContainer implementation using docker SDK.
  • Update dependencies (remove docker-compose, add PyYAML/boto3) and loosen version pins.
  • Update local/CI Python tooling configuration to target Python 3.14.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tox.ini Switch tox env from generic py3 to explicit py314.
requirements.txt Drop docker-compose; add PyYAML/boto3; loosen dependency pins.
confluent/docker_utils/compose.py New compose replacement module built on Docker SDK.
confluent/docker_utils/init.py Refactor utilities to use Docker SDK + new compose module; update ECR login/build/run helpers.
.semaphore/semaphore.yml Update CI Python version selection to 3.14.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@airlock-confluentinc airlock-confluentinc bot force-pushed the replace-docker-compose-with-sdk branch 2 times, most recently from f4c907e to dafd607 Compare February 4, 2026 10:12
@airlock-confluentinc airlock-confluentinc bot force-pushed the replace-docker-compose-with-sdk branch from dafd607 to 27ed162 Compare February 10, 2026 12:19
requirements.txt Outdated
docker-compose==1.29.2
Jinja2==3.1.6
requests==2.32.5
boto3>=1.36.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe adding this back here will bring in the urllib3 CVE ref: https://confluent.slack.com/archives/C055SK92MD1/p1768830959037109?thread_ts=1768826828.012589&cid=C055SK92MD1 . Can you please confirm the same once?

Copy link
Member Author

Choose a reason for hiding this comment

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

urllib is latest version in the common-docker image. Since we updated the python version, this will fetch latest version of boto3 hence picking the latest version of dependencies.
Tested with dev image of common-docker
image

Copy link
Contributor

@KrishVora01 Krish Vora (KrishVora01) left a comment

Choose a reason for hiding this comment

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

Our tox report has a few warnings: https://semaphore.ci.confluent.io/jobs/5629abf4-2ec9-446e-9ebc-e016d89698d3#L379-L406 . Could you please take a look at the same, and make any changes if needed?

@abh1sh5k
Copy link
Member Author

Our tox report has a few warnings: https://semaphore.ci.confluent.io/jobs/5629abf4-2ec9-446e-9ebc-e016d89698d3#L379-L406 . Could you please take a look at the same, and make any changes if needed?

The warnings fall into two categories:
PytestUnknownMarkWarning - Fixed by registering the integration marker in tox.ini
Deprecation warnings from external dependencies - These are from mock and botocore libraries, not our code:
asyncio.iscoroutinefunction deprecation → mock library issue
datetime.utcnow() deprecation → botocore (AWS SDK) issue
These will be resolved when the respective library maintainers release updates. No action required on our side.


def api_client():
return docker.from_env().api
def api_client() -> docker.DockerClient:

Choose a reason for hiding this comment

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

return type is changed here. Will this need changes in downstream? seems like a breaking change.
Also will it be better to rename the method name be docker_client()?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've searched for the api-client org wide its not used directly in any of the confluentinc repos. I'll rename this method. It wont break any downstream component.

@abh1sh5k Abhishek Krishna (abh1sh5k) merged commit 75e1248 into master Feb 19, 2026
2 checks passed
@abh1sh5k Abhishek Krishna (abh1sh5k) deleted the replace-docker-compose-with-sdk branch February 19, 2026 08:25
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.

3 participants