Fix the installation of the scala plugin. It must be global.

This commit is contained in:
Andrea Dell'Amico 2020-09-01 16:00:11 +02:00
parent 893e25baaf
commit fafc5b128a
2 changed files with 16 additions and 6 deletions

View File

@ -5,13 +5,16 @@
user: name={{ jupyter_hub_user }} home={{ jupyter_hub_user_home }} createhome=no shell=/usr/sbin/nologin system=yes
- name: Create the jupyterhub home, if it does not exist
file: dest={{ jupyter_hub_user_home }} owner={{ jupyter_hub_user }} group={{ jupyter_hub_user }} state=directory recurse=yes
file: dest={{ jupyter_hub_user_home }} owner={{ jupyter_hub_user }} group={{ jupyter_hub_user }} state=directory recurse=yes mode='0750'
- name: Create the jupyterhub base directory
file: dest={{ jupyter_hub_base_dir }} owner=root group=root state=directory recurse=yes mode='0755'
- name: Create a configuration directory for jupyter hub
file: dest={{ jupyter_hub_conf_dir }} state=directory owner=root group={{ jupyter_hub_user }} mode=0750
file: dest={{ jupyter_hub_conf_dir }} state=directory owner=root group={{ jupyter_hub_user }} mode='0750'
- name: Create a data directory for jupyter hub
file: dest={{ jupyter_hub_data_dir }} state=directory owner={{ jupyter_hub_user }} group={{ jupyter_hub_user }} mode=0750
file: dest={{ jupyter_hub_data_dir }} state=directory owner={{ jupyter_hub_user }} group={{ jupyter_hub_user }} mode='0755'
- name: Create a log directory for jupyter hub
file: dest={{ jupyter_hub_logdir }} state=directory owner={{ jupyter_hub_user }} group={{ jupyter_hub_user }} mode=0750
@ -51,7 +54,7 @@
- name: Jupyterhub and SPARK
block:
- name: Ensure that the spark configuration directory exists
file: dest=/usr/share/jupyter/kernels/pyspark2 state=directory
file: dest=/usr/share/jupyter/kernels/pyspark2 state=directory recurse=yes mode='0755'
- name: Install the spark configuration
copy: src=spark-kernel.json dest=/usr/share/jupyter/kernels/pyspark2/kernel.json
@ -65,14 +68,20 @@
- name: Download the coursier executable
get_url: url=https://git.io/coursier-cli-linux dest=/usr/local/bin/coursier owner=root group=root mode='0555'
- name: Create the coursier cache directory
file: dest={{ jupyter_hub_coursier_cache_dir }} owner=root group=root state=directory recurse=yes mode='0755'
- name: Check if the scala support for jupyter is already installed
stat: path="/root/.local/share/jupyter/kernels/scala"
stat: path="/usr/local/share/jupyter/kernels/scala/launcher.jar"
register: jupyter_scala
- name: Integrate Spark and Scala
command: /usr/local/bin/coursier launch --fork almond:0.5.0 --scala {{ jupyter_spark_scala_version }} -- --install
command: /usr/local/bin/coursier launch --cache {{ jupyter_hub_coursier_cache_dir }} --fork almond:0.5.0 --scala {{ jupyter_spark_scala_version }} -- --install --global --force
when: not jupyter_scala.stat.exists
- name: Fix the scala launcher permissions
file: dest="/usr/local/share/jupyter/kernels/scala/launcher.jar" mode='0644'
when:
- jupyter_is_hadoop_node
tags: [ 'jupyter', 'jupyter_hub', 'spark' ]

View File

@ -14,6 +14,7 @@ jupyter_hub_conf: '{{ jupyter_hub_conf_dir }}/jupyterhub_config.py'
jupyter_hub_venv_dir: '/opt/{{ jupyter_hub_venv }}'
jupyter_hub_logdir: /var/log/jupyter
jupyter_hub_user: jhub
jupyter_hub_coursier_cache_dir: '{{ jupyter_hub_base_dir }}/cs_cache'
py3_env_install: True
# Always install everything