Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jupyter VM #69

Merged
merged 6 commits into from
Mar 21, 2024
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
16 changes: 0 additions & 16 deletions ubuntu/appdb/datahub-jupyter-ubuntu-20.04.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions ubuntu/appdb/datahub-jupyter-ubuntu-22.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
appdb:
version: 2024.03.21
expireson: 6
notes: Updated base OS to Ubuntu 22.04
url: "https://api.cloud.ifca.es:8080/swift/v1/egi_endorsed_vas/DataHub-Jupyter-Ubuntu.22.04-2024.03.21.ova"
sha512: "f3ae1bfced91ea9e9b6813c82a2910457ea960718a0c3b6a35edc99627a1b0337cd2cb958da8fe107107745b9ebaf709c0357f88ec1427ff637dce6ff8b03060"
arch: x86_64
os:
family: Linux
name: Ubuntu
version: '22.04'
ram:
minimum: 1GB
format: OVA
hypervisor: VirtualBox
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@
"builders": [
{
"boot_command": [
"<up><wait><esc><f6><esc>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs>",
"initrd=/casper/initrd --- autoinstall ",
"ds=nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ",
"PACKER_USER=ubuntu ",
"PACKER_AUTHORIZED_KEY={{ user `SSH_PUB_KEY` | urlquery }}",
"<wait><enter>"
"c<wait>",
"linux /casper/vmlinuz --- autoinstall ds=\"nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/\"",
" PACKER_USER=ubuntu PACKER_AUTHORIZED_KEY={{ user `SSH_PUB_KEY` | urlquery }}",
"<enter><wait>",
"initrd /casper/initrd",
"<enter><wait>",
"boot",
"<enter>"
],
"boot_wait": "3s",
"boot_wait": "5s",
"disk_size": 8000,
"format": "qcow2",
"headless": true,
"http_directory": "httpdir",
"http_port_max": 8550,
"http_port_min": 8500,
"iso_url": "https://releases.ubuntu.com/20.04/ubuntu-20.04.6-live-server-amd64.iso",
"iso_checksum": "sha256:b8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b",
"iso_url": "https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso",
"iso_checksum": "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2",
"memory": 1024,
"ssh_timeout": "25m",
"ssh_timeout": "20m",
"ssh_clear_authorized_keys": true,
"ssh_private_key_file": "{{ user `SSH_PRIVATE_KEY_FILE` }}",
"shutdown_command": "sudo -- sh -c 'rm /etc/sudoers.d/99-egi-installation && shutdown -h now'",
Expand All @@ -36,7 +34,7 @@
"qemuargs": [
[ "-cpu", "host" ]
],
"vm_name": "DataHub-Jupyter-Ubuntu.20.04-2024.01.02"
"vm_name": "DataHub-Jupyter-Ubuntu.22.04-2024.03.21"
}
],
"provisioners": [
Expand Down
24 changes: 16 additions & 8 deletions ubuntu/provisioners/datahub-jupyter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
name: jovyan
comment: Jupyter user
shell: /bin/bash
uid: 1002
- name: Install micromamba
shell: |
wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
mv bin/micromamba /usr/local/bin/micromamba
- name: install packages
ansible.builtin.apt:
name: [nginx, acl]
name: [nginx, acl, bzip2]
state: present
- name: Install foo
- name: Install micromamba
shell: |
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
mv bin/micromamba /usr/local/bin/micromamba
args:
creates: /usr/local/bin/micromamba
- name: Install certbot
community.general.snap:
channel: latest
classic: true
Expand All @@ -53,7 +54,7 @@
mode: '0755'
- name: Install jupyterhub using conda
shell: |
micromamba install -y -c conda-forge -p /home/jovyan/micromamba jupyter jupyterlab jq
micromamba install -y -c conda-forge -p /home/jovyan/micromamba jupyter jupyterlab jupyter-collaboration jq
- name: Get micromamba env
shell: |
micromamba shell init --shell=bash --prefix=/home/jovyan/micromamba || true
Expand All @@ -76,6 +77,11 @@

- hosts: all
become: true
handlers:
- name: Restart nginx
service:
state: reloaded
name: nginx
tasks:
- name: Create jupyter unit
ansible.builtin.copy:
Expand Down Expand Up @@ -149,6 +155,8 @@
internal;
}
}
notify:
- Restart nginx

- hosts: all
become: true
Expand Down