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/11/24 04:19:58 UTC

[GitHub] [airflow] vsimon opened a new issue #19802: airflow-create-user job does not run on helm upgrade

vsimon opened a new issue #19802:
URL: https://github.com/apache/airflow/issues/19802


   ### Official Helm Chart version
   
   1.3.0 (latest released)
   
   ### Apache Airflow version
   
   2.2.1
   
   ### Kubernetes Version
   
   v1.21.1
   
   ### Helm Chart configuration
   
         executor: KubernetesExecutor
         redis:
           enabled: false
         statsd:
           enabled: false
         postgresql:
           persistence:
             enabled: false
   
   ### Docker Image customisations
   
   _No response_
   
   ### What happened
   
   When running `helm upgrade...` the `airflow-run-airflow-migrations` job runs however the `airflow-create-user` does not run. I'm wondering what the difference in the two jobs where one would run and not the other for helm upgrade. They have identical hook annotations.
   
   
   ### What you expected to happen
   
   Like 'airflow-run-airflow-migrations', the `airflow-create-user` job runs.
   
   ### How to reproduce
   
   ```
   $ kubectl create ns airflow-temp 
   
   $ helm install airflow apache-airflow/airflow --namespace airflow-temp --set executor=KubernetesExecutor,redis.enabled=false,statsd.enabled=false,postgresql.persistence.enabled=false
   
   # notice both `airflow-run-airflow-migrations` and `airflow-create-user` jobs run - look
   
   $ kubectl get jobs -n airflow-temp -w
   NAME                             COMPLETIONS   DURATION   AGE
   airflow-run-airflow-migrations   0/1                      0s
   airflow-run-airflow-migrations   0/1           0s         0s
   airflow-run-airflow-migrations   1/1           30s        30s
   airflow-create-user              0/1                      0s
   airflow-create-user              0/1           0s         0s
   airflow-create-user              1/1           17s        17s
   airflow-run-airflow-migrations   1/1           30s        50s
   airflow-create-user              1/1           17s        18s
   
   
   $ helm upgrade airflow apache-airflow/airflow --namespace airflow-temp --set executor=KubernetesExecutor,redis.enabled=false,statsd.enabled=false,postgresql.persistence.enabled=false
   
   # notice only `airflow-run-airflow-migrations` job runs 
   
   $ kubectl get jobs -n airflow-temp -w
   
   NAME                             COMPLETIONS   DURATION   AGE
   airflow-run-airflow-migrations   0/1                      0s
   airflow-run-airflow-migrations   0/1           1s         1s
   airflow-run-airflow-migrations   0/1           0s         1s
   airflow-run-airflow-migrations   1/1           23s        24s
   airflow-run-airflow-migrations   1/1           23s        24s
   
   ```
   
   ### Anything else
   
   helm version
   
       version.BuildInfo{Version:"v3.7.1", GitCommit:"1d11fcb5d3f3bf00dbe6fe31b8412839a96b3dc4", GitTreeState:"clean", GoVersion:"go1.17.2"}
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.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] vsimon commented on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon commented on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980270661


   Thanks @kaxil I was looking at the helm hooks in that file from the main branch, instead of the 1.3 tag 🤦 . I see the difference now, its been fixed on main but the 1.4 chart hasn't been released 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] vsimon closed issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon closed issue #19802:
URL: https://github.com/apache/airflow/issues/19802


   


-- 
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] vsimon commented on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon commented on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-1001051431


   I'm in favor of closing this Issue now, helm hooks doesn't seem like the right approach in the case of unexpected node restarts, some manual action to trigger the hooks would still be needed. The discussion here mentions from @thesuperzapper how the user-community helm chart addresses this by using Deployments for all things which previously ran as post-install jobs: https://github.com/apache/airflow/issues/11979#issuecomment-931754946
   
   Using the other chart now and after `airflow.dbMigrations.checkInterval` seconds, configs are automatically reapplied after node/pod restarts.
   


-- 
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] vsimon edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980270661


   Thanks @kaxil I was looking at the helm hooks in that file from main, instead of the 1.3 tag 🤦 . I see the difference now, its been fixed on main but the 1.4 chart hasn't been released 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] kaxil commented on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980266072


   This happens because of Helm hooks:
   
   https://github.com/apache/airflow/blob/helm-chart/1.3.0/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/migrate-database-job.yaml#L38
   
   This was accidentally changed in https://github.com/apache/airflow/commit/35f3bf8fb447be0ed581cc317897180b541c63ce so the next version of chart should run it on upgrades.


-- 
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] vsimon edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980247725


   Yes. In the case of having light-weight dev environments created with helm (with postgres persistence setting set to false). If the database is restarted for any reason, the volume is empty again and would like the user job to rerun (like the migrations job currently does).


-- 
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] vsimon edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980270661


   Thanks @kaxil I was looking at the helm hooks in that file from main, instead of the 1.3 tag 🤦 . I see the difference now, its been fixed on main and the 1.4 chart hasn't been released 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] vsimon edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980247725


   Yes. In the case of having light-weight short-lived dev environments created with helm (with postgres persistence setting set to false). If the database is restarted for any reason, the volume is empty again and would like the user job to rerun (like the migrations job currently does) if I re-run the helm install/upgrade.


-- 
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] vsimon edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980247725


   Yes. In the case of having light-weight short-lived dev environments created with helm (with postgres persistence setting set to false). If the database is restarted for any reason, the volume is empty again and would like the user job to rerun (like the migrations job currently does).


-- 
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] vsimon commented on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
vsimon commented on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980247725


   Yes. In the case of having light-weight dev environments (with postgres persistence set to false). If the database is restarted for any reason, the volume is empty again and would like the user job to rerun (like the migrations job currently does).


-- 
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] kaxil edited a comment on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980266072


   This happens because of Helm hooks:
   
   https://github.com/apache/airflow/blob/helm-chart/1.3.0/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/create-user-job.yaml#L39
   
   https://github.com/apache/airflow/blob/6dfc939833fd3dc477b3971d965ba142d3b8bd77/chart/templates/jobs/migrate-database-job.yaml#L38
   
   This was accidentally changed in https://github.com/apache/airflow/commit/35f3bf8fb447be0ed581cc317897180b541c63ce so the next version of chart should run it on upgrades.
   
   cc @jedcunningham @schnie 


-- 
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] kaxil commented on issue #19802: airflow-create-user job does not run on helm upgrade

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #19802:
URL: https://github.com/apache/airflow/issues/19802#issuecomment-980243121


   A larger question, why do you want it to run again?
   
   If the default user is already created, it won't create a new 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