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

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 722b1a480a3024f6f2063e260579a94ba5a22cac
Author: Jarek Potiuk <[email protected]>
AuthorDate: Wed Oct 7 02:00:00 2020 +0200

    Adds --no-rbac-ui flag for Breeze airflow 1.10 installation (#11315)
    
    When installing airflow 1.10 via breeze we now enable rbac
    by default, but we can disable it with --no-rbac-ui flag.
    
    This is useful to test different variants of 1.10 when testing
    release candidataes in connection with the 'start-airflow'
    command.
    
    (cherry picked from commit 22c6a843d760d920f329fc97aa55f45d82682ab9)
---
 breeze                                  |  3 +--
 breeze-complete                         |  1 +
 scripts/ci/docker-compose/base.yml      |  2 +-
 scripts/ci/libraries/_initialization.sh |  7 +++++++
 scripts/in_container/entrypoint_ci.sh   | 11 +++++++++++
 5 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/breeze b/breeze
index 63471d0..1878e31 100755
--- a/breeze
+++ b/breeze
@@ -63,7 +63,6 @@ export EXTRA_STATIC_CHECK_OPTIONS
 #    FORWARD_CREDENTIALS
 #    DB_RESET
 #    START_AIRFLOW
-#    RBAC_UI
 #    INSTALL_AIRFLOW_VERSION
 #    INSTALL_AIRFLOW_REFERENCE
 #    FORCE_BUILD_IMAGES
@@ -121,7 +120,7 @@ function breeze::setup_default_breeze_constants() {
     # If set to true, the test connections will be created
     export LOAD_DEFAULT_CONNECTIONS="false"
 
-    # If set to true, the sample dags will be created
+    # If set to true, the sample dags will be used
     export LOAD_EXAMPLES="false"
 
     # If set to true, RBAC mode is enabled
diff --git a/breeze-complete b/breeze-complete
index 8b1d597..5c58e50 100644
--- a/breeze-complete
+++ b/breeze-complete
@@ -141,6 +141,7 @@ additional-extras: additional-python-deps:
 dev-apt-deps: additional-dev-apt-deps: dev-apt-command: 
additional-dev-apt-command: additional-dev-apt-env:
 runtime-apt-deps: additional-runtime-apt-deps: runtime-apt-command: 
additional-runtime-apt-command: additional-runtime-apt-env:
 load-default-connections load-example-dags
+no-rbac-ui
 "
 
 _breeze_commands="
diff --git a/scripts/ci/docker-compose/base.yml 
b/scripts/ci/docker-compose/base.yml
index 706d90c..a0e7728 100644
--- a/scripts/ci/docker-compose/base.yml
+++ b/scripts/ci/docker-compose/base.yml
@@ -52,7 +52,7 @@ services:
       - START_AIRFLOW
       - LOAD_EXAMPLES
       - LOAD_DEFAULT_CONNECTIONS
-      - RBAC_UI
+      - DISABLE_RBAC
       - ENABLED_SYSTEMS
       - RUN_SYSTEM_TESTS
       - PYTHON_MAJOR_MINOR_VERSION
diff --git a/scripts/ci/libraries/_initialization.sh 
b/scripts/ci/libraries/_initialization.sh
index e71ce39..4aa72e1 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -111,9 +111,15 @@ function initialization::initialize_base_variables() {
     # If set to true, the database will be initialized, a user created and 
webserver and scheduler started
     export START_AIRFLOW=${START_AIRFLOW:="false"}
 
+    # If set to true, the sample dags will be used
     export LOAD_EXAMPLES=${LOAD_EXAMPLES:="false"}
 
+    # If set to true, the test connections will be created
     export LOAD_DEFAULT_CONNECTIONS=${LOAD_DEFAULT_CONNECTIONS:="false"}
+
+    # If set to true, RBAC UI will not be used for 1.10 version
+    export DISABLE_RBAC=${DISABLE_RBAC:="false"}
+
     # If set the specified file will be used to initialized Airflow after the 
environment is created,
     # otherwise it will use files/airflow-breeze-config/init.sh
     export INIT_SCRIPT_FILE=${INIT_SCRIPT_FILE:=""}
@@ -543,6 +549,7 @@ Initialization variables:
     INIT_SCRIPT_FILE: ${INIT_SCRIPT_FILE}
     LOAD_DEFAULT_CONNECTIONS: ${LOAD_DEFAULT_CONNECTIONS}
     LOAD_EXAMPLES: ${LOAD_EXAMPLES}
+    DISABLE_RBAC: ${DISABLE_RBAC}
 
 EOF
 
diff --git a/scripts/in_container/entrypoint_ci.sh 
b/scripts/in_container/entrypoint_ci.sh
index e74fe40..7a24875 100755
--- a/scripts/in_container/entrypoint_ci.sh
+++ b/scripts/in_container/entrypoint_ci.sh
@@ -19,6 +19,15 @@ if [[ ${VERBOSE_COMMANDS:="false"} == "true" ]]; then
     set -x
 fi
 
+function disable_rbac_if_requested() {
+    if [[ ${DISABLE_RBAC:="false"} == "true" ]]; then
+        export AIRFLOW__WEBSERVER__RBAC="False"
+    else
+        export AIRFLOW__WEBSERVER__RBAC="True"
+    fi
+}
+
+
 # shellcheck source=scripts/in_container/_in_container_script_init.sh
 . /opt/airflow/scripts/in_container/_in_container_script_init.sh
 
@@ -100,6 +109,8 @@ unset AIRFLOW__CORE__UNIT_TEST_MODE
 mkdir -pv "${AIRFLOW_HOME}/logs/"
 cp -f "${IN_CONTAINER_DIR}/airflow_ci.cfg" "${AIRFLOW_HOME}/unittests.cfg"
 
+disable_rbac_if_requested
+
 set +e
 "${IN_CONTAINER_DIR}/check_environment.sh"
 ENVIRONMENT_EXIT_CODE=$?

Reply via email to