Skip to content

Conversation

@mdegat01
Copy link
Contributor

@mdegat01 mdegat01 commented Oct 15, 2025

Proposed change

First in a series of PRs to migrate us from Dockerpy to Aiodocker. See #6247 for details and reasoning. This is far too much work for 1 PR so it'll be broken down into chunks.

This PR covers the following:

  1. Migrates all usage of dockerpy's ImageCollection object to aiodocker
  2. Adds aiodocker to our requirements
  3. Initializes both client objects at startup during this migration.
  4. The DockerAPI.docker property will now return the aiodocker client object. The DockerAPI.dockerpy property will be used to access the dockerpy client until it is no longer needed

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue: Migrate from dockerpy to aiodocker #6247
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@mdegat01 mdegat01 requested a review from agners October 15, 2025 18:16
@mdegat01 mdegat01 added the refactor A code change that neither fixes a bug nor adds a feature label Oct 15, 2025
_LOGGER.info("Prune stale volumes")
try:
output = self.docker.api.prune_builds()
output = self.dockerpy.api.prune_volumes()
Copy link
Contributor Author

@mdegat01 mdegat01 Oct 15, 2025

Choose a reason for hiding this comment

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

🙈

No idea how long this bug has been hidden in here. There were no test cases for this method.

@mdegat01 mdegat01 marked this pull request as draft October 16, 2025 17:40
@mdegat01
Copy link
Contributor Author

Looking at the failed build log, I'm thinking that the idea of doing this migration in stages may not work right now. Both libraries want the same unix socket and I don't think it can work like that. We may actually have to do this as one giant PR unless we can find a way to get both running simultaneously during the migration

@mdegat01 mdegat01 force-pushed the docker-to-aiodocker-1 branch from 8d4957c to 94d1f52 Compare October 27, 2025 16:40
@mdegat01 mdegat01 marked this pull request as ready for review October 27, 2025 16:40
@mdegat01
Copy link
Contributor Author

Ok I resolved the conflict with the unix sockets. In testing locally it seems to work fine as long as you aren't using literally the same file. So by binding one to /run/docker.sock and the other to /var/run/docker.sock things seem to work fine.

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

Labels

cla-signed Hacktoberfest refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants