Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- communitylab#26: Error handling in Conda Package Manager

## [v1.6.0] - 2025-04-28

### Added

- communitylab#63: Extend GitHub Action, add Mamba for conda environments, update JupyterHub and JupyterLab
- communitylab#61: Add GitHub Action to lint and test all Ansible collections
- communitylab#59: Upgrading to PostgreSQL 17
- communitylab#57: Add new kernels for JupyterLab and upgrade software components
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 GeorgSchulz
Copyright (c) 2025 GeorgSchulz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ _CommunityLab_ consists of following components:

| Component | Version |
|------------------|---------|
| JupyterHub | 5.2.0 |
| JupyterLab | 4.3.0 |
| JupyterHub | 5.3.0 |
| JupyterLab | 4.4.1 |
| Apache Hadoop | 3.4.1 |
| Apache Spark | 3.5.3 |
| Apache Zookeeper | 3.9.3 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,10 @@
serial: 1
roles:
- role: jupyter.lab.setup

- name: Check JupyterHub Health
hosts: hub1
become: true
gather_facts: true
roles:
- role: jupyter.hub.check
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ provisioner:
service_uid: "5001"
service_group: jupyterhub
service_gid: "4001"
tls_user: jupyterhub
tls_group: jupyterhub
tls_user: root
tls_group: root
keytab_group: jupyterhub
cert_file: /etc/ssl/private/cert.pem
key_file: /etc/ssl/private/key.pem
Expand All @@ -159,6 +159,7 @@ provisioner:
kerberos_keytabs:
- principal: "{{ jupyterhub_user }}"
keytab_user: "{{ jupyterhub_user }}"
common_hdfs_data_dir: /var/hadoop/hdfs
ldap:
ldap_user: openldap
ldap_uid: "5001"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ provisioner:
kerberos_keytabs:
- principal: "{{ jupyterhub_user }}"
keytab_user: "{{ jupyterhub_user }}"
common_hdfs_data_dir: /var/hadoop/hdfs
ldap:
ldap_user: openldap
ldap_uid: "5001"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,84 @@
---
- name: Check if JupyterHub GUI is reachable
ansible.builtin.uri:
url: "{% if jupyterhub_domain_ip is defined %}{{ jupyterhub_domain }}{% else %}https://{{ inventory_hostname }}{% endif %}"
method: GET
validate_certs: false
register: jupyterhub_gui_status
retries: 10
until: jupyterhub_gui_status.status == 200

- name: Set variable jupyterhub_gui_status
ansible.builtin.debug:
var: jupyterhub_gui_status
- name: Install curl
ansible.builtin.apt:
name: curl
state: present
update_cache: true

- name: Log into JupyterHub and start session
changed_when: true
ansible.builtin.shell:
cmd: |
set -o pipefail
curl -k -c cookies.txt https://172.23.27.3:8443/hub/login 2>/dev/null | \
grep -o 'name="_xsrf" value="[^"]*"' | \
sed -E 's/.*value="([^"]*)".*/\1/' > xsrf.txt

xsrf=$(cat xsrf.txt)

curl -k -b cookies.txt -c cookies.txt -X POST https://172.23.27.3:8443/hub/login \
-d "_xsrf=$xsrf" \
-d "username=gschulz" \
-d "password=datascience"

# Trigger the user server
curl -k -b cookies.txt -c cookies.txt https://172.23.27.3:8443/hub/spawn
executable: /bin/bash
args:
chdir: /tmp

- name: Wait for 30 seconds
ansible.builtin.pause:
seconds: 30

- name: List YARN application
changed_when: false
ansible.builtin.shell:
cmd: |
set -o pipefail
app_ids=$(/opt/apache-hadoop/hadoop/bin/yarn application -list | awk 'NR>2 {print $1}')
if [ -n "$app_ids" ]; then
echo "$app_ids"
else
echo "No running applications found"
fi
executable: /bin/bash
delegate_to: "{{ groups['resourcemanager1'][0] }}"
run_once: true
become: true
become_user: "{{ yarn_user }}"
register: result_list_application

- name: Assert that YARN application was found
ansible.builtin.assert:
that: result_list_application.stdout != "No running applications found"
fail_msg: No YARN application found, check Logs for more information
success_msg: YARN application found

- name: Kill YARN application
changed_when: true
ansible.builtin.shell:
cmd: |
set -o pipefail
app_ids=$(/opt/apache-hadoop/hadoop/bin/yarn application -list | awk 'NR>2 {print $1}')
if [ -n "$app_ids" ]; then
echo "$app_ids" | xargs -r -n 1 -I {} /opt/apache-hadoop/hadoop/bin/yarn application -kill {}
else
echo "No running applications found"
fi
executable: /bin/bash
delegate_to: "{{ groups['resourcemanager1'][0] }}"
run_once: true
become: true
become_user: "{{ yarn_user }}"
register: result_kill_application

- name: Assert that YARN application was killed
ansible.builtin.assert:
that: result_kill_application.stdout != "No running applications found"
fail_msg: No YARN applications killed, check Logs for more information
success_msg: YARN applications killed

- name: Debug variable jupyterhub_gui_status
- name: Show that started YARN application was killed
ansible.builtin.debug:
msg: "IDE installed successfully, you can now visit JupyterHub GUI under: https://hub1.{{ domain }}:8443"
when: jupyterhub_gui_status.status == 200
var: result_kill_application.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@
group: "{{ jupyterhub_group }}"
mode: "0600"

- name: Set read ACL for jupyterhub user on SSL cert files
when: groups.hubs | length == 1
ansible.posix.acl:
path: "{{ item }}"
entity: jupyterhub
etype: user
permissions: r
state: present
loop:
- /etc/ssl/private/cert.pem
- /etc/ssl/private/chain.pem
- /etc/ssl/private/key.pem

- name: Create system service for JupyterHub
ansible.builtin.template:
src: jupyterhub.service
Expand All @@ -69,3 +82,8 @@
ansible.builtin.systemd:
name: jupyterhub.service
state: started

- name: Wait until port 8443 is bound
ansible.builtin.wait_for:
port: 8443
timeout: 5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ install_miniforge_base_path: /opt/miniforge/miniforge
install_environment_python_version: 3.10.15

install_conda_packages:
- jupyterhub=5.2.0
- jupyterhub=5.3.0
- nodejs=20.12.2
- configurable-http-proxy=4.6.2
- jupyterhub-yarnspawner=0.4.0
Expand Down
Loading