You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/11/28 11:33:06 UTC

[PR] Make rootless-docker documented first-class-citizen in Breeze [airflow]

potiuk opened a new pull request, #35917:
URL: https://github.com/apache/airflow/pull/35917

   Since rootless docker is becoming more and more popular and soon likely becomes standard, we should recognise it in our decisions when it comes to runnig Breeze as it changes some of the basic assumptions about files and ownership we had when we designed how we are running containers in Breeze.
   
   Reviewed the places where "rootless docker" had an impact and fixed a typo in fix-ownership (it did not matter because fix-ownership was not even executed in linux in the first place, but it should be fixed for consistency).
   
   Documented the rootless docker in the ADRs for breeze as this is building on top of the ADR 6 and ADR 14 where the root user and ownership fixing decisions were made.
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make rootless-docker documented first-class-citizen in Breeze [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #35917:
URL: https://github.com/apache/airflow/pull/35917#discussion_r1407667977


##########
dev/breeze/doc/adr/0015-handling-rootless-docker.md:
##########
@@ -0,0 +1,67 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+
+- [15. Handling rootless docker](#15-handling-rootless-docker)
+  - [Status](#status)
+  - [Context](#context)
+  - [Decision](#decision)
+  - [Consequences](#consequences)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+# 15. Handling rootless docker
+
+Date: 2023-11-29
+
+## Status
+
+Accepted
+
+Builds on [6. Using root user and fixing ownership for-ci-container](0006-using-root-user-and-fixing-ownership-for-ci-container.md)
+Builds on [14. Fix root ownership after exiting docker command](0014-fix-root-ownership-after-exiting-docker-command.md)
+
+## Context
+
+[Rootless docker](https://docs.docker.com/engine/security/rootless/) solutions are becoming more and
+more popular. They are more secure to run and they allow to run docker containers without root privileges.
+It is expected that in the near future, rootless docker will become the default way of running docker.
+
+In case of rootless docker, the assumptions from both 6. and 14. ADRs are not valid. The user running
+docker is re-mapped from the original user in the host that run the container. This means that the
+ownership of files created in the container does not have to be fixed (the user ids will be re-mapped
+from the container back to the host automatically) and that the dag folder owned by the user on the
+host will be automatically owned by the right user inside the container.
+
+This means that we do not need to neither fix the ownership or change the ownership when the docker

Review Comment:
   Neither fix nor*



##########
dev/breeze/doc/adr/0015-handling-rootless-docker.md:
##########
@@ -0,0 +1,67 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+
+- [15. Handling rootless docker](#15-handling-rootless-docker)
+  - [Status](#status)
+  - [Context](#context)
+  - [Decision](#decision)
+  - [Consequences](#consequences)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+# 15. Handling rootless docker
+
+Date: 2023-11-29
+
+## Status
+
+Accepted
+
+Builds on [6. Using root user and fixing ownership for-ci-container](0006-using-root-user-and-fixing-ownership-for-ci-container.md)
+Builds on [14. Fix root ownership after exiting docker command](0014-fix-root-ownership-after-exiting-docker-command.md)
+
+## Context
+
+[Rootless docker](https://docs.docker.com/engine/security/rootless/) solutions are becoming more and
+more popular. They are more secure to run and they allow to run docker containers without root privileges.
+It is expected that in the near future, rootless docker will become the default way of running docker.
+
+In case of rootless docker, the assumptions from both 6. and 14. ADRs are not valid. The user running
+docker is re-mapped from the original user in the host that run the container. This means that the
+ownership of files created in the container does not have to be fixed (the user ids will be re-mapped
+from the container back to the host automatically) and that the dag folder owned by the user on the
+host will be automatically owned by the right user inside the container.

Review Comment:
   Owned by the correct user*?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make rootless-docker documented first-class-citizen in Breeze [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #35917:
URL: https://github.com/apache/airflow/pull/35917#discussion_r1407723353


##########
dev/breeze/doc/adr/0015-handling-rootless-docker.md:
##########
@@ -0,0 +1,67 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+
+- [15. Handling rootless docker](#15-handling-rootless-docker)
+  - [Status](#status)
+  - [Context](#context)
+  - [Decision](#decision)
+  - [Consequences](#consequences)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+# 15. Handling rootless docker
+
+Date: 2023-11-29
+
+## Status
+
+Accepted
+
+Builds on [6. Using root user and fixing ownership for-ci-container](0006-using-root-user-and-fixing-ownership-for-ci-container.md)
+Builds on [14. Fix root ownership after exiting docker command](0014-fix-root-ownership-after-exiting-docker-command.md)
+
+## Context
+
+[Rootless docker](https://docs.docker.com/engine/security/rootless/) solutions are becoming more and
+more popular. They are more secure to run and they allow to run docker containers without root privileges.
+It is expected that in the near future, rootless docker will become the default way of running docker.
+
+In case of rootless docker, the assumptions from both 6. and 14. ADRs are not valid. The user running
+docker is re-mapped from the original user in the host that run the container. This means that the
+ownership of files created in the container does not have to be fixed (the user ids will be re-mapped
+from the container back to the host automatically) and that the dag folder owned by the user on the
+host will be automatically owned by the right user inside the container.
+
+This means that we do not need to neither fix the ownership or change the ownership when the docker

Review Comment:
   Right. Another "Polish-ness" :). We do not distinguish those two cases, they are obvious from context in Polish :D



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make rootless-docker documented first-class-citizen in Breeze [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #35917:
URL: https://github.com/apache/airflow/pull/35917


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make rootless-docker documented first-class-citizen in Breeze [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #35917:
URL: https://github.com/apache/airflow/pull/35917#discussion_r1407722356


##########
dev/breeze/doc/adr/0015-handling-rootless-docker.md:
##########
@@ -0,0 +1,67 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+
+- [15. Handling rootless docker](#15-handling-rootless-docker)
+  - [Status](#status)
+  - [Context](#context)
+  - [Decision](#decision)
+  - [Consequences](#consequences)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+# 15. Handling rootless docker
+
+Date: 2023-11-29
+
+## Status
+
+Accepted
+
+Builds on [6. Using root user and fixing ownership for-ci-container](0006-using-root-user-and-fixing-ownership-for-ci-container.md)
+Builds on [14. Fix root ownership after exiting docker command](0014-fix-root-ownership-after-exiting-docker-command.md)
+
+## Context
+
+[Rootless docker](https://docs.docker.com/engine/security/rootless/) solutions are becoming more and
+more popular. They are more secure to run and they allow to run docker containers without root privileges.
+It is expected that in the near future, rootless docker will become the default way of running docker.
+
+In case of rootless docker, the assumptions from both 6. and 14. ADRs are not valid. The user running
+docker is re-mapped from the original user in the host that run the container. This means that the
+ownership of files created in the container does not have to be fixed (the user ids will be re-mapped
+from the container back to the host automatically) and that the dag folder owned by the user on the
+host will be automatically owned by the right user inside the container.

Review Comment:
   `mapped` :)



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org