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 6ad5baa5b3 [ZEPPELIN-6048] Write a Dockerfile for jdbc interpreter
image build (#4794)
6ad5baa5b3 is described below
commit 6ad5baa5b31c50bb28b61a9c14d215baa28ab883
Author: SeungYoung Oh <[email protected]>
AuthorDate: Sun Sep 8 14:05:37 2024 +0900
[ZEPPELIN-6048] Write a Dockerfile for jdbc interpreter image build (#4794)
* refactor: Reformat shell interpreter command in Dockerfile
* docs: Fix capitalization in shell interpreter README
* feat: Write a Dockerfile for jdbc interpreter image build
---
{shell => jdbc}/Dockerfile | 15 +++++++++++----
{shell => jdbc}/README.md | 17 +++++++++--------
shell/Dockerfile | 9 ++++++++-
shell/README.md | 4 ++--
4 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/shell/Dockerfile b/jdbc/Dockerfile
similarity index 69%
copy from shell/Dockerfile
copy to jdbc/Dockerfile
index 6ae9566158..a8865e8738 100644
--- a/shell/Dockerfile
+++ b/jdbc/Dockerfile
@@ -23,7 +23,7 @@ WORKDIR /zeppelin
RUN chmod +x ./mvnw
-RUN ./mvnw package -am -pl
zeppelin-interpreter-shaded,zeppelin-interpreter,shell -DskipTests
+RUN ./mvnw clean package -am -pl
zeppelin-interpreter-shaded,zeppelin-interpreter,jdbc -DskipTests
FROM openjdk:11
@@ -31,13 +31,20 @@ 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/interpreter/jdbc /zeppelin/interpreter/jdbc
COPY --from=builder /zeppelin/zeppelin-interpreter-shaded/target
/zeppelin/zeppelin-interpreter-shaded/target
WORKDIR /zeppelin
-ENV SHELL_INTERPRETER_PORT=8081
+ENV JDBC_INTERPRETER_PORT=8082
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
+CMD ["./bin/interpreter.sh", \
+ "-d", "./interpreter/jdbc", \
+ "-c", "host.docker.internal", \
+ "-p", "${INTERPRETER_EVENT_SERVER_PORT}", \
+ "-r", "${JDBC_INTERPRETER_PORT}:${JDBC_INTERPRETER_PORT}", \
+ "-i", "jdbc-shared_process", \
+ "-l", "./local-repo", \
+ "-g", "jdbc"]
diff --git a/shell/README.md b/jdbc/README.md
similarity index 55%
copy from shell/README.md
copy to jdbc/README.md
index b2f2cfa18b..2223336d71 100644
--- a/shell/README.md
+++ b/jdbc/README.md
@@ -1,14 +1,15 @@
## Overview
-Shell interpreter for Apache Zeppelin
+Jdbc interpreter for Apache Zeppelin
## Run the interpreter with docker
-You can run the shell interpreter as a standalone docker container.
+You can run the jdbc interpreter as a standalone docker container.
-### step 1. Specify the configuration for the shell interpreter
+### Step 1. Specify the configuration for the jdbc interpreter
+* NOTE: Your jdbc properties should be configured using the host environment
settings, such as the URL, username, and password.
```bash
# conf/interpreter.json
- "sh": {
+ "jdbc": {
...
"option":
} {
@@ -20,16 +21,16 @@ You can run the shell interpreter as a standalone docker
container.
}
````
-### step 2. Build and run the shell interpreter
+### Step 2. Build and run the jdbc 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 build -f ./jdbc/Dockerfile -t jdbc-interpreter .
-zeppelin $ docker run -p {INTERPRETER_PROCESS_PORT_IN_HOST}:8081 \
+zeppelin $ docker run -p {INTERPRETER_PROCESS_PORT_IN_HOST}:8082 \
-e INTERPRETER_EVENT_SERVER_PORT={INTERPRETER_EVENT_SERVER_PORT} \
- shell-interpreter
+ jdbc-interpreter
```
diff --git a/shell/Dockerfile b/shell/Dockerfile
index 6ae9566158..1da36a2633 100644
--- a/shell/Dockerfile
+++ b/shell/Dockerfile
@@ -40,4 +40,11 @@ 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
+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
index b2f2cfa18b..ce224ea815 100644
--- a/shell/README.md
+++ b/shell/README.md
@@ -4,7 +4,7 @@ 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
+### Step 1. Specify the configuration for the shell interpreter
```bash
# conf/interpreter.json
@@ -20,7 +20,7 @@ You can run the shell interpreter as a standalone docker
container.
}
````
-### step 2. Build and run the shell interpreter
+### Step 2. Build and run the shell interpreter
```bash
zeppelin $ ./mvnw clean install -DskipTests