You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/12 17:49:37 UTC
[GitHub] [airflow] potiuk opened a new pull request #18915: Update entrypoint.rst
potiuk opened a new pull request #18915:
URL: https://github.com/apache/airflow/pull/18915
<!--
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 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/
-->
---
**^ 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 change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
--
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
[GitHub] [airflow] potiuk closed pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #18915:
URL: https://github.com/apache/airflow/pull/18915
--
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
[GitHub] [airflow] uranusjr commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727516599
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
```suggestion
Such *custom* entryopoint should be run after the main entrypoint. You can even execute
```
I'm assuming we don't actually mean to imply `custom` is some kind of code, so this switches to use more idiomatic emphasis format.
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727480731
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint.sh"
+
Review comment:
No need. We are using `dumb-init` which will propagate signals to all children by default (see the next chapter).
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such *custom* entrypoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
Review comment:
```suggestion
The entrypoint can be added to the image by extending it:
```
--
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
[GitHub] [airflow] yiga2 commented on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
yiga2 commented on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-942802491
I still believe there is an use case for executing stuff BEFORE the entrypoint. In our case, we override the DB pointer dynamically, depending on some values in the ENV -> can only be set at runtime. Hence must run **before** the entrypoint as the latter (`entrypoint_prod`) performs a DB check, which we want (+ create user).
Our way around it: build an image with our `my_entrypoint.sh` as entrypoint, which will do all ENV settings, and then exec the base entrypoint passing on any argument.
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r729040844
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
+---------------------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint extension that does any custom operations.
+Such *custom* entrypoint extension should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such extension script.
+The entrypoint extension can be added to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint_extension.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint_extension.sh"
+
+Execute custom code before the Airflow entrypoint
+-------------------------------------------------
+
+If you want to execute some custom code before Airflow's entrypoint you can also add extra code executed
+before the Airflow entrypoint by replacing the entrypoint of Airflow and calling Airflow's entrypoint as
Review comment:
```suggestion
before the Airflow one by using your custom script and calling Airflow's entrypoint as
```
--
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
[GitHub] [airflow] uranusjr commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727516599
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
```suggestion
Such *custom* entryopoint should be run after the main entrypoint. You can even execute
```
I'm assuming we don't actually mean to imply `custom` is some kind of code, so this switches to use more idiomatic emphasis format.
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r729040844
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
+---------------------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint extension that does any custom operations.
+Such *custom* entrypoint extension should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such extension script.
+The entrypoint extension can be added to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint_extension.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint_extension.sh"
+
+Execute custom code before the Airflow entrypoint
+-------------------------------------------------
+
+If you want to execute some custom code before Airflow's entrypoint you can also add extra code executed
+before the Airflow entrypoint by replacing the entrypoint of Airflow and calling Airflow's entrypoint as
Review comment:
```suggestion
before the Airflow one by adding new one and calling Airflow's entrypoint as
```
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r729107401
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
Review comment:
I think you are right, it's more about adding custom behaviour. I will reword it
--
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
[GitHub] [airflow] potiuk closed pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #18915:
URL: https://github.com/apache/airflow/pull/18915
--
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
[GitHub] [airflow] theodesp commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
theodesp commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727986855
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
```suggestion
Such *custom* entrypoint should be run after the main entrypoint. You can even execute
```
--
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
[GitHub] [airflow] mik-laj commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727476558
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint.sh"
+
Review comment:
Should we use exec?
--
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
[GitHub] [airflow] potiuk commented on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-943223383
> Our way around it: build an image with our `my_entrypoint.sh` as entrypoint, which will do all ENV settings, and then exec the base entrypoint passing on any argument.
Good point. I added this option to the PR with documentation : https://github.com/apache/airflow/pull/18915/
There are a few things that you have to be aware of (read the docs) in this case:
- never add any secrets this way (either via image variables, scripts, or arguments of image call)
- make sure you use dumb-init in the entrypoint (otherwise your signal propagation will be broken)
```
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/your_entrypoint.sh"]
```
- always use `exec /entrypoint "${@}"` as last command in your custom entrypoint.
I explained that all in the PR #18915
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r728105478
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such *custom* entrypoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
Review comment:
```suggestion
The entrypoint can be added to the image by extending it:
```
--
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
[GitHub] [airflow] potiuk edited a comment on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-943228651
I also added code explaining that "before" executing Airflow's entrypoint, certain functionality is not be available (updated the PR)
> Also be aware that code executed before Airflow's entrypoint should not create any files or
> directories inside the image and not everything might work the same way as after it is executed.
> Before Airflow entrypoint is executed, the following functionalities are not available:
>
> * umask is not set properly to allow "group" write access
> * user is not yet created in /etc/passwd in case aribitrary user is used to run the image
> * the database and brokers might not be available yet
--
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
[GitHub] [airflow] yiga2 commented on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
yiga2 commented on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-943383271
@potiuk great ! Thanks so much for the detailed documentation. I am all set ! Btw, your PR pretty much closes https://github.com/apache/airflow/issues/14346 in my mind.
--
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
[GitHub] [airflow] potiuk commented on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-943387096
Cool. Now I need just an approve from another committer :). Anyone?
--
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
[GitHub] [airflow] mik-laj commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727475627
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
entryopoint=>entrypoint
--
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
[GitHub] [airflow] jedcunningham commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r729096305
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
Review comment:
I'm not sure I'm following on this extension section. This is simply just COPYing an extra script into the image, the entrypoint wont actually run it, right? I'm not sure it's worth having this example if that's the case, and I think using "extension" is slightly misleading too.
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
+---------------------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
Review comment:
```suggestion
The Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
```
--
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
[GitHub] [airflow] mik-laj commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727475627
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
entryopoint=>entrypoint
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint.sh"
+
Review comment:
Should we use exec?
--
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
[GitHub] [airflow] theodesp commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
theodesp commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727986855
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
Review comment:
```suggestion
Such *custom* entrypoint should be run after the main entrypoint. You can even execute
```
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r727480731
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,27 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint
+-----------------------
+
+Airflow image executes a lot of steps in the entrypoint, but it does not do everything that you might
+want to run - and you might want to provide your own entrypoint which does any custom operations.
+Such ``custom`` entryopoint should be run after the main entrypoint. You can even execute
+the usual components of airflow - scheduler, webserver, worker, triggerer in such script.
+The entrypoint can be addedd to the image by extending it:
+
+.. code-block:: Dockerfile
+
+ FROM airflow::2.3.0.dev0
+ COPY my_entrypoint.sh /
+
+
+And then you can run this script by running the command:
+
+.. code-block:: bash
+
+ docker run -it apache/airflow:2.3.0.dev0-python3.6 bash -c "/my_entrypoint.sh"
+
Review comment:
No need. We are using `dumb-init` which will propagate signals to all children by default (see the next chapter).
--
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
[GitHub] [airflow] potiuk commented on a change in pull request #18915: Add decription on how you can customize image entrypoint
Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#discussion_r729116384
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -194,6 +194,69 @@ If there are any other arguments - they are simply passed to the "airflow" comma
optional arguments:
-h, --help show this help message and exit
+Add your own entrypoint extension
Review comment:
I reworded it, and put it as "second" option - explaining that this customizing the image behaviour.
--
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
[GitHub] [airflow] potiuk commented on pull request #18915: Add custom entrypoint documentation
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18915:
URL: https://github.com/apache/airflow/pull/18915#issuecomment-943228651
I also added code explaining that "before" executing Airflow's entrypoint, certain functionality is not be available (updated the PR)
> Also be aware that code executed before Airflow's entrypoint should not make any file-related
> changes inside the image and not everything might possible to execute. Before Airflow entrypoint
> is executed, the following changes are not applied:
>
> * umask is not set properly to allow "group" write access
> * user is not yet created in /etc/passwd in case aribitrary user is used to run the image
> * the database and brokers might not be available yet
--
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