-
Notifications
You must be signed in to change notification settings - Fork 12
/
tljh.yml
51 lines (42 loc) · 1.68 KB
/
tljh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- hosts: all
become: true
vars_files:
- vars/default.yml
tasks:
- name: Install required system packages
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'curl', 'python3', 'python3-dev', 'python3-pip']
- name: Download the TLJH installer
get_url:
url: "{{ tljh_installer_url }}"
dest: "{{ tljh_installer_dest }}"
- name: Check if the tljh-plasma is already installed
command: "{{ tljh_prefix }}/hub/bin/python3 -c 'import tljh_plasma'"
register: tljh_plasma_installed
failed_when: tljh_plasma_installed.rc > 2
changed_when: False
- name: Upgrade the tljh-plasma plugin first if it is already installed
shell: "{{ tljh_prefix }}/hub/bin/pip3 install --upgrade {{ tljh_plasma }} {{ tljh_repo2docker }}"
when: tljh_plasma_installed.rc == 0
- name: Run the TLJH installer
shell: |
{{ ansible_python_interpreter }} {{ tljh_installer_dest }} --no-user-env \
--plugin {{ tljh_plasma }} {{ tljh_repo2docker }}
# TODO: remove when --no-user-env (or equivalent) is available
environment:
TLJH_BOOTSTRAP_PIP_SPEC: "{{ tljh_bootstrap_pip_spec }}"
- name: Set the idle culler timeout to 1 hour
shell: "tljh-config set services.cull.timeout 3600"
- name: Set the default memory and cpu limits
shell: |
tljh-config set limits.memory 2G
tljh-config set limits.cpu 2
- name: Reload the hub
shell: "tljh-config reload hub"
# Pull the repo2docker image to build user images
- name: Pull the repo2docker Docker image
docker_image:
name: quay.io/jupyterhub/repo2docker
tag: main
source: pull