Use host-managed SSH accounts for browser terminal
This commit is contained in:
@@ -23,7 +23,6 @@ courseware_promptfoo_dir: "{{ courseware_lab6_dir }}"
|
||||
courseware_wiki_repo_dir: "{{ courseware_repos_dir }}/LLM-Labs"
|
||||
courseware_wiki_runtime_config_path: "{{ courseware_wiki_repo_dir }}/public/courseware-runtime.json"
|
||||
courseware_llama_cpp_bin_dir: "{{ courseware_repos_dir }}/llama.cpp/build/bin"
|
||||
courseware_lab3_dir: "/home/student/lab3"
|
||||
|
||||
courseware_bind_host: "0.0.0.0"
|
||||
courseware_url_host: "127.0.0.1"
|
||||
@@ -70,8 +69,6 @@ courseware_node_runtime_version: "20.20.2"
|
||||
courseware_wetty_spec: "wetty@2.5.0"
|
||||
courseware_wetty_base_path: "/wetty"
|
||||
courseware_wiki_repo: "https://git.zuccaro.me/bzuccaro/LLM-Labs.git"
|
||||
courseware_student_username: "student"
|
||||
courseware_student_password_hash: "{{ lookup('env', 'COURSEWARE_STUDENT_PASSWORD_HASH') | default('', true) }}"
|
||||
|
||||
courseware_open_webui_spec: "open-webui"
|
||||
courseware_embedding_atlas_spec: "embedding-atlas"
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
- name: Fail when student password hash is not configured
|
||||
fail:
|
||||
msg: >-
|
||||
Set COURSEWARE_STUDENT_PASSWORD_HASH in the environment before running ./labctl up.
|
||||
Example:
|
||||
export COURSEWARE_STUDENT_PASSWORD_HASH="$(openssl passwd -6 'student-password')"
|
||||
when: courseware_student_password_hash | trim | length == 0
|
||||
|
||||
- name: Install terminal prerequisites
|
||||
become: true
|
||||
apt:
|
||||
@@ -79,84 +71,6 @@
|
||||
- ansible_service_mgr != "systemd"
|
||||
- courseware_terminal_sshd_pid.rc != 0
|
||||
|
||||
- name: Ensure managed terminal user exists
|
||||
become: true
|
||||
user:
|
||||
name: "{{ courseware_student_username }}"
|
||||
password: "{{ courseware_student_password_hash }}"
|
||||
shell: /bin/bash
|
||||
create_home: true
|
||||
state: present
|
||||
|
||||
- name: Ensure lab 3 workspace root exists
|
||||
become: true
|
||||
file:
|
||||
path: "{{ courseware_lab3_dir }}"
|
||||
state: directory
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Ensure lab 3 WhiteRabbitNeo workspace exists
|
||||
become: true
|
||||
file:
|
||||
path: "{{ courseware_lab3_dir }}/WhiteRabbitNeo"
|
||||
state: directory
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Write lab 3 workspace README
|
||||
become: true
|
||||
template:
|
||||
src: lab3-workspace-readme.txt.j2
|
||||
dest: "{{ courseware_lab3_dir }}/README.txt"
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
mode: "0644"
|
||||
|
||||
- name: Check for repo-local WhiteRabbitNeo base repo
|
||||
stat:
|
||||
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
|
||||
register: courseware_lab3_base_repo_stat
|
||||
|
||||
- name: Check for repo-local WhiteRabbitNeo GGUF directory
|
||||
stat:
|
||||
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
||||
register: courseware_lab3_gguf_repo_stat
|
||||
|
||||
- name: Link WhiteRabbitNeo base repo into the student workspace when repo-local assets exist
|
||||
become: true
|
||||
file:
|
||||
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
|
||||
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo-V3-7B"
|
||||
state: link
|
||||
force: true
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
when: courseware_lab3_base_repo_stat.stat.exists
|
||||
|
||||
- name: Link WhiteRabbitNeo GGUF directory into the student workspace when repo-local assets exist
|
||||
become: true
|
||||
file:
|
||||
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
||||
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
||||
state: link
|
||||
force: true
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
when: courseware_lab3_gguf_repo_stat.stat.exists
|
||||
|
||||
- name: Link WhiteRabbitNeo download helper into the student workspace
|
||||
become: true
|
||||
file:
|
||||
src: "{{ courseware_lab2_dir }}/download_whiterabbitneo-gguf.sh"
|
||||
dest: "{{ courseware_lab3_dir }}/download_whiterabbitneo-gguf.sh"
|
||||
state: link
|
||||
force: true
|
||||
owner: "{{ courseware_student_username }}"
|
||||
group: "{{ courseware_student_username }}"
|
||||
|
||||
- name: Create contained WeTTY directory
|
||||
file:
|
||||
path: "{{ courseware_wetty_dir }}"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
This workspace is managed for the Lab 3 browser terminal.
|
||||
|
||||
You should log in as:
|
||||
- username: {{ courseware_student_username }}
|
||||
|
||||
Start here:
|
||||
- working directory: {{ courseware_lab3_dir }}
|
||||
|
||||
Helpful paths:
|
||||
- WhiteRabbitNeo helper: {{ courseware_lab3_dir }}/download_whiterabbitneo-gguf.sh
|
||||
- repo-local base repo symlink: {{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo-V3-7B
|
||||
- repo-local GGUF symlink: {{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF
|
||||
|
||||
Some symlinks only appear after the corresponding repo-local lab assets are present.
|
||||
@@ -6,7 +6,6 @@ PasswordAuthentication yes
|
||||
KbdInteractiveAuthentication no
|
||||
ChallengeResponseAuthentication no
|
||||
UsePAM yes
|
||||
AllowUsers {{ courseware_student_username }}
|
||||
AllowTcpForwarding no
|
||||
X11Forwarding no
|
||||
PrintMotd no
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
{
|
||||
"lab3TerminalUrl": "http://{{ courseware_url_host }}:{{ courseware_ports.wetty }}{{ courseware_wetty_base_path }}",
|
||||
"lab3Username": "{{ courseware_student_username }}",
|
||||
"lab3WorkingDirectory": "{{ courseware_lab3_dir }}"
|
||||
"lab3TerminalUrl": "http://{{ courseware_url_host }}:{{ courseware_ports.wetty }}{{ courseware_wetty_base_path }}"
|
||||
}
|
||||
|
||||
@@ -28,8 +28,6 @@ TRANSFORMERLAB_DEFAULT_USER_EMAIL="{{ courseware_transformerlab_default_user_ema
|
||||
TRANSFORMERLAB_DEFAULT_USER_PASSWORD="{{ courseware_transformerlab_default_user_password }}"
|
||||
TRANSFORMERLAB_DEFAULT_USER_FIRST_NAME="{{ courseware_transformerlab_default_user_first_name }}"
|
||||
TRANSFORMERLAB_DEFAULT_USER_LAST_NAME="{{ courseware_transformerlab_default_user_last_name }}"
|
||||
COURSEWARE_STUDENT_USERNAME="{{ courseware_student_username }}"
|
||||
COURSEWARE_LAB3_DIR="{{ courseware_lab3_dir }}"
|
||||
UNSLOTH_BIN="{{ ansible_env.HOME }}/.local/bin/unsloth"
|
||||
PROMPTFOO_DIR="{{ courseware_promptfoo_dir }}"
|
||||
PROMPTFOO_BIN="{{ courseware_tools_dir }}/promptfoo/node_modules/.bin/promptfoo"
|
||||
|
||||
Reference in New Issue
Block a user