Executing a local/host command as an user from the host as well, in an airflow docker container

141 Views Asked by At

I have to execute some maprcli commands on a daily basis, and the maprcli command needs to be executed with a special user. The maprcli command and the user are both on the local host. To schedule this tasks I need to use airflow, which further on works in a docker container. I am facing 2 problems here:

  1. the maprcli is not available in the airflow docker conainer
  2. the user with whom it should be executed is not available in the container.

The first problem can be solved with a volume mapping, but is there maybe a cleaner solution?

Is there any way to use the needed local/host user during the execution of a python script inside the airflow docker container?

1

There are 1 best solutions below

1
Ted Dunning On

The permissions depend on the availability of a mapr ticket that is normally generated by maprlogin.

Making this work correctly is much easier in Kubernetes than in bare docker containers because of the more advanced handling of tickets.