Skip to content

Commit

Permalink
[DPE-3514] Add Apache Kyuubi entrypoint to Charmed Spark base rock im…
Browse files Browse the repository at this point in the history
…age (#75)
  • Loading branch information
theoctober19th authored Mar 13, 2024
1 parent 4c150d3 commit 97487d3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions files/spark/bin/kyuubi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

pushd /opt/kyuubi
/opt/kyuubi/bin/kyuubi run
3 changes: 3 additions & 0 deletions files/spark/conf/kyuubi-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export SPARK_HOME="/opt/spark/"
export SPARK_CONF_DIR="/etc/spark8t/conf"
27 changes: 21 additions & 6 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ services:
# working-dir: /opt/spark
environment:
SPARK_PROPERTIES_FILE: /etc/spark8t/conf/spark-defaults.conf
thrift-server:
command: "/bin/bash /opt/pebble/thrift-server.sh"
summary: "This is the Spark Thrift Server service"
kyuubi:
command: "/bin/bash /opt/pebble/kyuubi.sh"
summary: "This is the Kyuubi service"
override: replace
startup: disabled
environment:
SPARK_PROPERTIES_FILE: /etc/spark8t/conf/spark-defaults.conf

parts:
spark:
Expand Down Expand Up @@ -95,9 +93,19 @@ parts:
- opt/spark/python
- opt/spark/data

kyuubi:
plugin: dump
after: [ spark ]
source: https://dlcdn.apache.org/kyuubi/kyuubi-1.8.1/apache-kyuubi-1.8.1-bin.tgz
source-checksum: sha512/355ebbc184bbb0ab2fe521dda213a7769dae222a6a278a1fc0b3bf1173fd26091ccbc073038564ea8bb2ad2d5f5d1049c19508201ed710978d2ea79d20cd5726
override-build: |
mkdir -p $CRAFT_PART_INSTALL/opt/kyuubi && cp -r ./* $CRAFT_PART_INSTALL/opt/kyuubi
stage:
- opt/kyuubi

dependencies:
plugin: nil
after: [ spark ]
after: [ kyuubi ]
build-packages:
- wget
overlay-script: |
Expand Down Expand Up @@ -186,9 +194,11 @@ parts:
source: files/spark
organize:
conf/spark-defaults.conf: etc/spark8t/conf/spark-defaults.conf
conf/kyuubi-env.sh: opt/kyuubi/conf/kyuubi-env.sh
bin/sparkd.sh: opt/pebble/sparkd.sh
bin/history-server.sh: opt/pebble/history-server.sh
bin/thrift-server.sh: opt/pebble/thrift-server.sh
bin/kyuubi.sh: opt/pebble/kyuubi.sh
bin/spark-client.pyspark: opt/spark-client/python/bin/spark-client.pyspark
bin/spark-client.spark-sql: opt/spark-client/python/bin/spark-client.spark-sql
bin/spark-client.service-account-registry: opt/spark-client/python/bin/spark-client.service-account-registry
Expand All @@ -199,6 +209,8 @@ parts:
- opt/pebble/sparkd.sh
- opt/pebble/history-server.sh
- opt/pebble/thrift-server.sh
- opt/pebble/kyuubi.sh
- opt/kyuubi/conf/kyuubi-env.sh
- opt/spark-client/python/bin/spark-client.pyspark
- opt/spark-client/python/bin/spark-client.spark-sql
- opt/spark-client/python/bin/spark-client.service-account-registry
Expand Down Expand Up @@ -237,6 +249,9 @@ parts:
chown -R ${SPARK_GID}:${SPARK_UID} opt/spark
chmod -R 750 opt/spark
chown -R ${SPARK_GID}:${SPARK_UID} opt/kyuubi
chmod -R 750 opt/kyuubi
mkdir -p var/lib/spark
mkdir -p var/lib/spark/notebook
chown -R ${SPARK_GID}:${SPARK_UID} var/lib/spark
Expand Down

0 comments on commit 97487d3

Please sign in to comment.