This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 9967a5f  refactor: adopt --app as celery global option (#15053)
9967a5f is described below

commit 9967a5f640036a9f41d3e19e22c114dfb218cd8a
Author: Ke Zhu <[email protected]>
AuthorDate: Tue Jun 8 23:18:55 2021 -0400

    refactor: adopt --app as celery global option (#15053)
---
 .github/workflows/superset-python-presto-hive.yml         | 4 ++--
 .github/workflows/superset-python-unittest.yml            | 6 +++---
 CONTRIBUTING.md                                           | 2 +-
 docker/docker-bootstrap.sh                                | 4 ++--
 docs/installation.rst                                     | 4 ++--
 docs/src/pages/docs/installation/alerts_reports.mdx       | 4 ++--
 docs/src/pages/docs/installation/async_queries_celery.mdx | 4 ++--
 helm/superset/Chart.yaml                                  | 2 +-
 helm/superset/values.yaml                                 | 2 +-
 tox.ini                                                   | 2 +-
 10 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/superset-python-presto-hive.yml 
b/.github/workflows/superset-python-presto-hive.yml
index 34d23e8..b7e05b3 100644
--- a/.github/workflows/superset-python-presto-hive.yml
+++ b/.github/workflows/superset-python-presto-hive.yml
@@ -73,7 +73,7 @@ jobs:
             setup-postgres
       - name: Run celery
         if: steps.check.outcome == 'failure'
-        run: celery worker --app=superset.tasks.celery_app:app -Ofair -c 2 &
+        run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
       - name: Python unit tests (PostgreSQL)
         if: steps.check.outcome == 'failure'
         run: |
@@ -148,7 +148,7 @@ jobs:
             setup-postgres
       - name: Run celery
         if: steps.check.outcome == 'failure'
-        run: celery worker --app=superset.tasks.celery_app:app -Ofair -c 2 &
+        run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
       - name: Python unit tests (PostgreSQL)
         if: steps.check.outcome == 'failure'
         run: |
diff --git a/.github/workflows/superset-python-unittest.yml 
b/.github/workflows/superset-python-unittest.yml
index 8d03fa8..3a95556 100644
--- a/.github/workflows/superset-python-unittest.yml
+++ b/.github/workflows/superset-python-unittest.yml
@@ -62,7 +62,7 @@ jobs:
             setup-mysql
       - name: Run celery
         if: steps.check.outcome == 'failure'
-        run: celery worker --app=superset.tasks.celery_app:app -Ofair -c 2 &
+        run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
       - name: Python unit tests (MySQL)
         if: steps.check.outcome == 'failure'
         run: |
@@ -126,7 +126,7 @@ jobs:
             setup-postgres
       - name: Run celery
         if: steps.check.outcome == 'failure'
-        run: celery worker --app=superset.tasks.celery_app:app -Ofair -c 2 &
+        run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
       - name: Python unit tests (PostgreSQL)
         if: steps.check.outcome == 'failure'
         run: |
@@ -182,7 +182,7 @@ jobs:
             mkdir ${{ github.workspace }}/.temp
       - name: Run celery
         if: steps.check.outcome == 'failure'
-        run: celery worker --app=superset.tasks.celery_app:app -Ofair -c 2 &
+        run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
       - name: Python unit tests (SQLite)
         if: steps.check.outcome == 'failure'
         run: |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e8a20d1..e9b82c0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1264,7 +1264,7 @@ To do this, you'll need to:
 - Start up a celery worker
 
   ```shell script
-  celery worker --app=superset.tasks.celery_app:app -Ofair
+  celery --app=superset.tasks.celery_app:app worker -Ofair
   ```
 
 Note that:
diff --git a/docker/docker-bootstrap.sh b/docker/docker-bootstrap.sh
index 57163cc..e4468b8 100755
--- a/docker/docker-bootstrap.sh
+++ b/docker/docker-bootstrap.sh
@@ -38,10 +38,10 @@ fi
 
 if [[ "${1}" == "worker" ]]; then
   echo "Starting Celery worker..."
-  celery worker --app=superset.tasks.celery_app:app -Ofair -l INFO
+  celery --app=superset.tasks.celery_app:app worker -Ofair -l INFO
 elif [[ "${1}" == "beat" ]]; then
   echo "Starting Celery beat..."
-  celery beat --app=superset.tasks.celery_app:app --pidfile 
/tmp/celerybeat.pid -l INFO -s "${SUPERSET_HOME}"/celerybeat-schedule
+  celery --app=superset.tasks.celery_app:app beat --pidfile 
/tmp/celerybeat.pid -l INFO -s "${SUPERSET_HOME}"/celerybeat-schedule
 elif [[ "${1}" == "app" ]]; then
   echo "Starting web app..."
   flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0
diff --git a/docs/installation.rst b/docs/installation.rst
index edfedce..f35b8c5 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -1080,11 +1080,11 @@ have the same configuration.
 
 * To start a Celery worker to leverage the configuration run: ::
 
-    celery worker --app=superset.tasks.celery_app:app --pool=prefork -O fair 
-c 4
+    celery --app=superset.tasks.celery_app:app worker --pool=prefork -O fair 
-c 4
 
 * To start a job which schedules periodic background jobs, run ::
 
-    celery beat --app=superset.tasks.celery_app:app
+    celery --app=superset.tasks.celery_app:app beat
 
 To setup a result backend, you need to pass an instance of a derivative
 of ``from cachelib.base.BaseCache`` to the ``RESULTS_BACKEND``
diff --git a/docs/src/pages/docs/installation/alerts_reports.mdx 
b/docs/src/pages/docs/installation/alerts_reports.mdx
index 6ac292b..0b25cbb 100644
--- a/docs/src/pages/docs/installation/alerts_reports.mdx
+++ b/docs/src/pages/docs/installation/alerts_reports.mdx
@@ -246,7 +246,7 @@ services:
       - superset
       - postgres
       - redis
-    command: "celery worker --app=superset.tasks.celery_app:app --pool=gevent 
--concurrency=500"
+    command: "celery --app=superset.tasks.celery_app:app worker --pool=gevent 
--concurrency=500"
     volumes:
       - ./config/:/app/pythonpath/
   beat:
@@ -258,7 +258,7 @@ services:
       - superset
       - postgres
       - redis
-    command: "celery beat --app=superset.tasks.celery_app:app --pidfile 
/tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule"
+    command: "celery --app=superset.tasks.celery_app:app beat --pidfile 
/tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule"
     volumes:
       - ./config/:/app/pythonpath/
   superset:
diff --git a/docs/src/pages/docs/installation/async_queries_celery.mdx 
b/docs/src/pages/docs/installation/async_queries_celery.mdx
index a95fcf0..58c1f1a 100644
--- a/docs/src/pages/docs/installation/async_queries_celery.mdx
+++ b/docs/src/pages/docs/installation/async_queries_celery.mdx
@@ -57,13 +57,13 @@ CELERY_CONFIG = CeleryConfig
 To start a Celery worker to leverage the configuration, run the following 
command:
 
 ```
-celery worker --app=superset.tasks.celery_app:app --pool=prefork -O fair -c 4
+celery --app=superset.tasks.celery_app:app worker --pool=prefork -O fair -c 4
 ```
 
 To start a job which schedules periodic background jobs, run the following 
command:
 
 ```
-celery beat --app=superset.tasks.celery_app:app
+celery --app=superset.tasks.celery_app:app beat
 ```
 
 To setup a result backend, you need to pass an instance of a derivative of from
diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml
index d06eff1..7f44652 100644
--- a/helm/superset/Chart.yaml
+++ b/helm/superset/Chart.yaml
@@ -22,7 +22,7 @@ maintainers:
   - name: craig-rueda
     email: [email protected]
     url: https://github.com/craig-rueda
-version: 0.1.3
+version: 0.1.4
 dependencies:
 - name: postgresql
   version: 10.2.0
diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml
index 58e9faa..45e956e 100644
--- a/helm/superset/values.yaml
+++ b/helm/superset/values.yaml
@@ -203,7 +203,7 @@ supersetCeleryBeat:
   command:
     - "/bin/sh"
     - "-c"
-    - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery beat 
--app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid --schedule 
/tmp/celerybeat-schedule"
+    - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery 
--app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid 
--schedule /tmp/celerybeat-schedule"
   forceReload: false # If true, forces deployment to reload on each upgrade
   initContainers:
     - name: wait-for-postgres
diff --git a/tox.ini b/tox.ini
index 970930b..39bc8e5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@
 #
 
 # Remember to start celery workers to run celery tests, e.g.
-# celery worker --app=superset.tasks.celery_app:app -Ofair -c 2
+# celery --app=superset.tasks.celery_app:app worker -Ofair -c 2
 [testenv]
 basepython = python3.8
 ignore_basepython_conflict = true

Reply via email to