mik-laj commented on a change in pull request #9223: URL: https://github.com/apache/airflow/pull/9223#discussion_r438656648
########## File path: scripts/ci/run_cli_tool.sh ########## @@ -0,0 +1,140 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +set -euo pipefail + +if [ -z "${AIRFLOW_CI_IMAGE}" ]; then + echo "Missing environment variable AIRFLOW_CI_IMAGE" + exit 1 +fi + +SCRIPT_NAME="$( basename "${BASH_SOURCE[0]}")" +# Drop "-update" suffix, if exists +TOOL_NAME="$(echo "${SCRIPT_NAME}" | cut -d "-" -f 1)" + +SUPPORTED_TOOL_NAMES=("aws" "az" "gcloud" "bq" "gsutil" "terraform" "java") + +if [ "$SCRIPT_NAME" == "run_cli_tool.sh" ] +then + # Direct execution - return installation script + SCRIPT_PATH=$(readlink -e "${BASH_SOURCE[0]}") + >&2 echo "# CLI tool wrappers" + >&2 echo "#" + >&2 echo "# To install, run the following command:" + >&2 echo "# source <(bash ${SCRIPT_PATH@Q})" + >&2 echo "#" + >&2 echo "" + # Print installation script + for NAME in "${SUPPORTED_TOOL_NAMES[@]}" + do + echo "ln -s ${SCRIPT_PATH@Q} /usr/bin/${NAME}" + echo "ln -s ${SCRIPT_PATH@Q} /usr/bin/${NAME}-update" + echo "chmod +x /usr/bin/${NAME} /usr/bin/${NAME}-update" + done + exit 0 +fi + +COMMON_DOCKER_ARGS=( Review comment: Real example: I working system tests for DataflowCreateJavaJobOperator operator. This operator starts the java process to submit Dataflow job, This operation may take a while, because it must send the necessary files to Google. Then it waits for the Job ID to appear in the log. If I have problems with the process, I don't have a simple tool to see the whole system situation. I need to check individual containers to check situations. Previously, I could run the `ps -aux` command and see that I have` pytest`, `local task job`,` dataflow`, and others running. I don't think anyone needs this insulation here. For a developer, this makes work difficult. For a production environment, this is an important safeguard. ---------------------------------------------------------------- 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: [email protected]
