You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by el...@apache.org on 2018/08/23 15:16:45 UTC

hadoop git commit: HADOOP-15656. Support byteman in hadoop-runner baseimage. Contributed by Elek, Marton.

Repository: hadoop
Updated Branches:
  refs/heads/docker-hadoop-runner 44f08ef7c -> 691be264b


HADOOP-15656. Support byteman in hadoop-runner baseimage. Contributed by Elek, Marton.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/691be264
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/691be264
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/691be264

Branch: refs/heads/docker-hadoop-runner
Commit: 691be264be9a339d156438c1aadbf6d3b9efcb6c
Parents: 44f08ef
Author: Márton Elek <el...@apache.org>
Authored: Thu Aug 9 09:16:41 2018 +0200
Committer: Márton Elek <el...@apache.org>
Committed: Thu Aug 23 17:11:03 2018 +0200

----------------------------------------------------------------------
 Dockerfile         |  2 ++
 scripts/starter.sh | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/691be264/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 11e6da8..1c50e8b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,6 +19,8 @@ RUN apt-get update && apt-get install -y jq curl python sudo && apt-get clean
 RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64
 RUN chmod +x /usr/local/bin/dumb-init
 RUN mkdir -p /etc/security/keytabs && chmod -R a+wr /etc/security/keytabs 
+ADD https://repo.maven.apache.org/maven2/org/jboss/byteman/byteman/4.0.4/byteman-4.0.4.jar /opt/byteman.jar
+RUN chmod o+r /opt/byteman.jar
 ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
 ENV PATH $PATH:/opt/hadoop/bin
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/691be264/scripts/starter.sh
----------------------------------------------------------------------
diff --git a/scripts/starter.sh b/scripts/starter.sh
index 90fdc92..047791b 100755
--- a/scripts/starter.sh
+++ b/scripts/starter.sh
@@ -109,4 +109,28 @@ if [ -n "$ENSURE_KSM_INITIALIZED" ]; then
    fi
 fi
 
+
+# Supports byteman script to instrument hadoop process with byteman script
+#
+#
+if [ -n "$BYTEMAN_SCRIPT" ] || [ -n "$BYTEMAN_SCRIPT_URL" ]; then
+
+  export PATH=$PATH:$BYTEMAN_DIR/bin
+
+  if [ ! -z "$BYTEMAN_SCRIPT_URL" ]; then
+    sudo wget $BYTEMAN_SCRIPT_URL -O /tmp/byteman.btm
+    export BYTEMAN_SCRIPT=/tmp/byteman.btm
+  fi
+
+  if [ ! -f "$BYTEMAN_SCRIPT" ]; then
+    echo "ERROR: The defined $BYTEMAN_SCRIPT does not exist!!!"
+    exit -1
+  fi
+
+  AGENT_STRING="-javaagent:/opt/byteman.jar=script:$BYTEMAN_SCRIPT"
+  export HADOOP_OPTS="$AGENT_STRING $HADOOP_OPTS"
+  echo "Process is instrumented with adding $AGENT_STRING to HADOOP_OPTS"
+fi
+
+
 $@


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org