abstractdog commented on code in PR #456:
URL: https://github.com/apache/tez/pull/456#discussion_r2852172030


##########
tez-dist/src/docker/entrypoint.sh:
##########
@@ -0,0 +1,143 @@
+#!/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 -xeou pipefail
+
+################################################
+# 1. Mocking DAGAppMaster#main() env variables #
+################################################
+
+: "${CONTAINER_ID:="container_1700000000000_0001_01_000001"}"
+: "${USER:="tez"}"
+: "${HADOOP_USER_NAME:="tez"}"
+: "${NM_HOST:="localhost"}"
+: "${NM_PORT:="12345"}"
+: "${NM_HTTP_PORT:="8042"}"
+: "${LOCAL_DIRS:="/tmp"}"
+: "${LOG_DIRS:="/opt/tez/logs"}"
+: "${APP_SUBMIT_TIME_ENV:=$(($(date +%s) * 1000))}"
+: "${TEZ_AM_EXTERNAL_ID:="tez-session-$(hostname)"}"
+
+export CONTAINER_ID USER HADOOP_USER_NAME NM_HOST NM_PORT NM_HTTP_PORT \
+    LOCAL_DIRS LOG_DIRS APP_SUBMIT_TIME_ENV TEZ_AM_EXTERNAL_ID
+
+mkdir -p "$LOG_DIRS"
+
+##########################
+# CONFIGURATION HANDLING #
+##########################
+
+# Symlink hadoop conf in tez conf dir
+if [[ -d "$HADOOP_HOME/etc/hadoop" ]]; then
+    echo "--> Linking missing Hadoop configs to $TEZ_CONF_DIR..."
+    for f in "$HADOOP_HOME/etc/hadoop"/*; do
+        basename=$(basename "$f")
+        # this check helps in case user wants to provide its custom 
hfds-site.xml
+        # or any other configuration file
+        if [[ ! -e "$TEZ_CONF_DIR/$basename" ]]; then
+            ln -s "$f" "$TEZ_CONF_DIR/$basename"
+        fi
+    done
+fi
+
+###########################
+# Custom Config directory #
+###########################
+if [[ -n "${TEZ_CUSTOM_CONF_DIR:-}" ]] && [[ -d "$TEZ_CUSTOM_CONF_DIR" ]]; then
+    echo "--> Using custom configuration directory: $TEZ_CUSTOM_CONF_DIR"
+    find "${TEZ_CUSTOM_CONF_DIR}" -type f -exec \
+        ln -sf {} "${TEZ_CONF_DIR}"/ \;
+
+    # Remove template keyword if it exist

Review Comment:
   nit: "exists"



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to