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/06/18 21:03:40 UTC

[GitHub] [airflow] aneesh-joseph commented on a change in pull request #16503: Clean up Mssql data directories at the end of each CI run

aneesh-joseph commented on a change in pull request #16503:
URL: https://github.com/apache/airflow/pull/16503#discussion_r653828986



##########
File path: scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
##########
@@ -100,6 +100,10 @@ function run_airflow_testing_in_docker() {
             # to be set to "root" (GID=0) for the volume to work and this cannot be accomplished without sudo
             chmod a+rwx "${MSSQL_DATA_VOLUME}"
             backend_docker_compose+=("-f" "${SCRIPTS_CI_DIR}/docker-compose/backend-mssql-bind-volume.yml")
+
+            # Runner user doesn't have blanket sudo access, but we can run docker as root. Go figure
+            traps::add_trap "docker run --rm ${MSSQL_DATA_VOLUME}:/mssql -v alpine sh -c 'rm -rf -- /mssql/*' 2>/dev/null" EXIT

Review comment:
       
   ```suggestion
               traps::add_trap "docker run --rm -v ${MSSQL_DATA_VOLUME}:/mssql  alpine sh -c 'rm -rf -- /mssql/*' 2>/dev/null" EXIT
   ```

##########
File path: scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
##########
@@ -100,6 +100,10 @@ function run_airflow_testing_in_docker() {
             # to be set to "root" (GID=0) for the volume to work and this cannot be accomplished without sudo
             chmod a+rwx "${MSSQL_DATA_VOLUME}"
             backend_docker_compose+=("-f" "${SCRIPTS_CI_DIR}/docker-compose/backend-mssql-bind-volume.yml")
+
+            # Runner user doesn't have blanket sudo access, but we can run docker as root. Go figure
+            traps::add_trap "docker run --rm ${MSSQL_DATA_VOLUME}:/mssql -v alpine sh -c 'rm -rf -- /mssql/*' 2>/dev/null" EXIT

Review comment:
       ```suggestion
               traps::add_trap "docker run --rm -v ${MSSQL_DATA_VOLUME}:/mssql alpine sh -c 'rm -rf -- /mssql/*' 2>/dev/null" EXIT
   ```

##########
File path: scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
##########
@@ -100,6 +100,10 @@ function run_airflow_testing_in_docker() {
             # to be set to "root" (GID=0) for the volume to work and this cannot be accomplished without sudo
             chmod a+rwx "${MSSQL_DATA_VOLUME}"
             backend_docker_compose+=("-f" "${SCRIPTS_CI_DIR}/docker-compose/backend-mssql-bind-volume.yml")
+
+            # Runner user doesn't have blanket sudo access, but we can run docker as root. Go figure
+            traps::add_trap "docker run --rm -v ${MSSQL_DATA_VOLUME}:/mssql alpine sh -c 'rm -rf -- /mssql/*' 2>/dev/null" EXIT
+            traps:add_trap "rm -rf -- '${MSSQL_DATA_VOLUME}'" EXIT

Review comment:
       ```suggestion
               traps::add_trap "rm -rf -- '${MSSQL_DATA_VOLUME}'" EXIT
   ```




-- 
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.

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