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

jongyoul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 61d7e7fde9 [ZEPPELIN-6034] Write a Dockerfile for shell interpreter 
(#4781)
61d7e7fde9 is described below

commit 61d7e7fde9015afd057ac2bd13d6cffa7c3ebd9f
Author: SeungYoung Oh <seung...@naver.com>
AuthorDate: Sun Aug 11 23:38:09 2024 +0900

    [ZEPPELIN-6034] Write a Dockerfile for shell interpreter (#4781)
    
    * [ZEPPELIN-6034] Write a Dockerfile for shell interpreter image build
    
    * [ZEPPELIN-6034] Modify shell interpreter README
    
    * [ZEPPELIN-6034] Split the builder and runner stage in the shell image
    
    * [ZEPPELIN-6034] Reduce the shell image size removing extra stuff
---
 shell/Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++
 shell/README.md  | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/shell/Dockerfile b/shell/Dockerfile
new file mode 100644
index 0000000000..6ae9566158
--- /dev/null
+++ b/shell/Dockerfile
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+
+FROM openjdk:11 as builder
+
+COPY . /zeppelin/
+
+WORKDIR /zeppelin
+
+RUN chmod +x ./mvnw
+
+RUN ./mvnw package -am -pl 
zeppelin-interpreter-shaded,zeppelin-interpreter,shell -DskipTests
+
+
+FROM openjdk:11
+
+COPY --from=builder /zeppelin/bin /zeppelin/bin/
+COPY --from=builder /zeppelin/conf /zeppelin/conf
+
+COPY --from=builder /zeppelin/interpreter/sh /zeppelin/interpreter/sh
+COPY --from=builder /zeppelin/zeppelin-interpreter-shaded/target 
/zeppelin/zeppelin-interpreter-shaded/target
+
+WORKDIR /zeppelin
+
+ENV SHELL_INTERPRETER_PORT=8081
+
+RUN chmod +x ./bin/interpreter.sh
+
+CMD ./bin/interpreter.sh -d interpreter/sh -c host.docker.internal -p 
${INTERPRETER_EVENT_SERVER_PORT} -r 
${SHELL_INTERPRETER_PORT}:${SHELL_INTERPRETER_PORT} -i sh-shared_process -l 
./local-repo -g sh
diff --git a/shell/README.md b/shell/README.md
new file mode 100644
index 0000000000..b2f2cfa18b
--- /dev/null
+++ b/shell/README.md
@@ -0,0 +1,35 @@
+## Overview
+Shell interpreter for Apache Zeppelin
+
+## Run the interpreter with docker
+You can run the shell interpreter as a standalone docker container.
+
+### step 1. Specify the configuration for the shell interpreter
+```bash
+    # conf/interpreter.json
+    
+    "sh": {
+      ...
+      "option":
+      } {
+        "remote": true,
+        "port": {INTERPRETER_PROCESS_PORT_IN_HOST},
+        "isExistingProcess": true,
+        "host": "localhost",
+        ...
+      }
+````
+
+### step 2. Build and run the shell interpreter
+```bash
+zeppelin $ ./mvnw clean install -DskipTests
+ 
+zeppelin $ ./bin/zeppelin-daemon.sh start # start zeppelin server.
+# check the port of the interpreter event server. you can find it by looking 
for the log that starts with "InterpreterEventServer is starting at"
+   
+zeppelin $ docker build -f ./shell/Dockerfile -t shell-interpreter .
+
+zeppelin $ docker run -p {INTERPRETER_PROCESS_PORT_IN_HOST}:8081 \
+  -e INTERPRETER_EVENT_SERVER_PORT={INTERPRETER_EVENT_SERVER_PORT} \
+  shell-interpreter
+```

Reply via email to