Skip to content

DockerSwarmOperator uses inspect_container() #56029

@sealmove

Description

@sealmove

Apache Airflow Provider(s)

docker

Versions of Apache Airflow Providers

apache-airflow-providers-docker==4.4.2

Apache Airflow version

3.0.6

Operating System

Debian GNU/Linux 12 (bookworm)

Deployment

Docker-Compose

Deployment details

I am using a standard docker compose deployment with LocalExecutor. I am spawning containers to an external docker swarm cluster using the tcp of the cluster manager.

What happened

DockerSwarmOperator uses inspect_container() (see code) which queries the local docker daemon of the manager node, and therefore fails when the task is run on a worker node:

NotFound: 404 Client Error for http://x.x.x.x:2375/v1.51/containers/f5204cb864c79ba19bab684f792b56f18206b8c3a38a6738e98593ef2b995379/json: Not Found ("No such container: f5204cb864c79ba19bab684f792b56f18206b8c3a38a6738e98593ef2b995379")

I replaced the actual ip with x.x.x.x.

What you think should happen instead

inspect_service() should be used instead of inspect_container()

How to reproduce

Run a docker swarm cluster with at least 2 nodes and point DockerSwarmOperator to it.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions