From 28cc6aa53113fe8f6c5c3da095329e2a4c78ff91 Mon Sep 17 00:00:00 2001 From: deusebio Date: Thu, 30 Nov 2023 21:56:54 +0100 Subject: [PATCH] [DPE-3067] Changes following up entrypoint service refactoring (#57) --- Dockerfile | 2 +- README.md | 14 ------- ...rk-history-server.sh => history-server.sh} | 0 ...{charmed-spark-entrypoint.sh => sparkd.sh} | 0 ...park-thrift-server.sh => thrift-server.sh} | 0 rockcraft.yaml | 42 +++++-------------- 6 files changed, 11 insertions(+), 47 deletions(-) rename files/spark/bin/{charmed-spark-history-server.sh => history-server.sh} (100%) rename files/spark/bin/{charmed-spark-entrypoint.sh => sparkd.sh} (100%) rename files/spark/bin/{charmed-spark-thrift-server.sh => thrift-server.sh} (100%) diff --git a/Dockerfile b/Dockerfile index be4fd3d2..7a3b64ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ ARG BASE_IMAGE=base-charmed-spark:latest FROM $BASE_IMAGE # Provide Default Entrypoint for Pebble -ENTRYPOINT [ "/bin/pebble", "enter", "--verbose", "--args", "entrypoint" ] \ No newline at end of file +ENTRYPOINT [ "/bin/pebble", "enter", "--verbose", "--args", "sparkd" ] \ No newline at end of file diff --git a/README.md b/README.md index 6dcd30df..a42268b9 100644 --- a/README.md +++ b/README.md @@ -71,20 +71,6 @@ Charmed Spark Rock Image is delivered with Pebble already included in order to m docker run ghcr.io/canonical/charmed-spark:3.4.1-22.04_edge \; start history-server ``` -#### Starting Jupyter Notebook - -```shell -docker run \ - -v /path/to/kube/config:/var/lib/spark/.kube/config \ - -p :8888 - ghcr.io/canonical/charmed-spark:3.4.1-22.04_edge \ - \; --args jupyter --username --namespace \ - \; start jupyter -``` - -Make sure to have created the `` in the `` with the `spark8t` CLI beforehand. -You should be able to access the jupyter server at `http://0.0.0.0:`. - ## Developers and Contributing Please see the [CONTRIBUTING.md](https://github.com/canonical/charmed-spark-rock/blob/3.4-22.04/edge/CONTRIBUTING.md) for guidelines and for developer guidance. diff --git a/files/spark/bin/charmed-spark-history-server.sh b/files/spark/bin/history-server.sh similarity index 100% rename from files/spark/bin/charmed-spark-history-server.sh rename to files/spark/bin/history-server.sh diff --git a/files/spark/bin/charmed-spark-entrypoint.sh b/files/spark/bin/sparkd.sh similarity index 100% rename from files/spark/bin/charmed-spark-entrypoint.sh rename to files/spark/bin/sparkd.sh diff --git a/files/spark/bin/charmed-spark-thrift-server.sh b/files/spark/bin/thrift-server.sh similarity index 100% rename from files/spark/bin/charmed-spark-thrift-server.sh rename to files/spark/bin/thrift-server.sh diff --git a/rockcraft.yaml b/rockcraft.yaml index 5616f9fb..9e71436d 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -22,15 +22,15 @@ environment: SPARK_LOG_DIR: /var/log/spark services: - entrypoint: - command: "/bin/bash /opt/pebble/charmed-spark-entrypoint.sh" + sparkd: + command: "/bin/bash /opt/pebble/sparkd.sh" summary: "This is the service to startup Spark processes using the Spark entrypoint" override: replace startup: enabled on-success: shutdown on-failure: shutdown history-server: - command: "/bin/bash /opt/pebble/charmed-spark-history-server.sh" + command: "/bin/bash /opt/pebble/history-server.sh" summary: "This is the Spark History Server service" override: replace startup: disabled @@ -39,20 +39,12 @@ services: environment: SPARK_PROPERTIES_FILE: /etc/spark8t/conf/spark-defaults.conf thrift-server: - command: "/bin/bash /opt/pebble/charmed-spark-thrift-server.sh" + command: "/bin/bash /opt/pebble/thrift-server.sh" summary: "This is the Spark Thrift Server service" override: replace startup: disabled environment: SPARK_PROPERTIES_FILE: /etc/spark8t/conf/spark-defaults.conf - jupyter: - command: "spark-client.pyspark [ --username spark --namespace spark ]" - summary: "This is the Spark-powered Jupyter service" - override: replace - startup: disabled - environment: - PYSPARK_DRIVER_PYTHON: jupyter - PYSPARK_DRIVER_PYTHON_OPTS: "lab --no-browser --port=8888 --ip=0.0.0.0 --NotebookApp.token='' --notebook-dir=/var/lib/spark/notebook" parts: spark: @@ -146,20 +138,6 @@ parts: stage: - opt/spark8t/python/dist - jupyter: - plugin: python - source: . - python-packages: - - jupyterlab - stage-packages: - - python3-venv - organize: - lib: usr/lib - bin: usr/bin - share: usr/share - stage: - - usr - kubectl: plugin: nil build-packages: @@ -187,18 +165,18 @@ parts: source: files/spark organize: conf/spark-defaults.conf: etc/spark8t/conf/spark-defaults.conf - bin/charmed-spark-entrypoint.sh: opt/pebble/charmed-spark-entrypoint.sh - bin/charmed-spark-history-server.sh: opt/pebble/charmed-spark-history-server.sh - bin/charmed-spark-thrift-server.sh: opt/pebble/charmed-spark-thrift-server.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/spark-client.pyspark: opt/spark-client/python/bin/spark-client.pyspark bin/spark-client.service-account-registry: opt/spark-client/python/bin/spark-client.service-account-registry bin/spark-client.spark-shell: opt/spark-client/python/bin/spark-client.spark-shell bin/spark-client.spark-submit: opt/spark-client/python/bin/spark-client.spark-submit stage: - etc/spark8t/conf/ - - opt/pebble/charmed-spark-entrypoint.sh - - opt/pebble/charmed-spark-history-server.sh - - opt/pebble/charmed-spark-thrift-server.sh + - opt/pebble/sparkd.sh + - opt/pebble/history-server.sh + - opt/pebble/thrift-server.sh - opt/spark-client/python/bin/spark-client.pyspark - opt/spark-client/python/bin/spark-client.service-account-registry - opt/spark-client/python/bin/spark-client.spark-shell