enima2684 commented on a change in pull request #17474:
URL: https://github.com/apache/airflow/pull/17474#discussion_r689567708



##########
File path: airflow/providers/docker/operators/docker_swarm.py
##########
@@ -93,13 +93,40 @@ class DockerSwarmOperator(DockerOperator):
         Supported only if the Docker engine is using json-file or journald 
logging drivers.
         The `tty` parameter should be set to use this with Python applications.
     :type enable_logging: bool
+    :param configs: List of docker configs to be exposed to the containers of 
the swarm service.
+        The configs are ConfigReference objects as per the docker api
+        
[https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
+    :type configs: List[docker.types.ConfigReference]
+    :param secrets: List of docker secrets to be exposed to the containers of 
the swarm service.
+        The secrets are SecretReference objects as per the docker 
create_service api.
+        
[https://docker-py.readthedocs.io/en/stable/services.html#docker.models.services.ServiceCollection.create]_
+    :type secrets: List[docker.types.SecretReference]
+    :param mode: Indicate whether a service should be deployed as a replicated 
or global service,
+        and associated parameters
+    :type mode: docker.types.ServiceMode
+    :param networks: List of network names or IDs or NetworkAttachmentConfig 
to attach the service to.
+    :type networks: List[Union[str, NetworkAttachmentConfig]]
     """
 
-    def __init__(self, *, image: str, enable_logging: bool = True, **kwargs) 
-> None:
+    def __init__(
+        self,
+        *,
+        image: str,
+        enable_logging: bool = True,
+        configs: Optional[List[types.ConfigReference]] = None,

Review comment:
       Hi @akki, thanks a lot for your review :)
   I tought of doing it but struggled on this because the secrets, configs or 
networks should be created ahead on the swarm cluster.
   Adding them on the example will result on having to preconfigure the cluster 
with secrets, configs and networks before being able to run it.
   In order to keep the examples running standalone, I prefered not to add it.
   
   Another option would be to create a config, secret and network with the 
docker sdk on the example. But this does not have much to do with airflow.
   
   What do you think ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to