a1c4892b37
Made-with: Cursor
113 lines
2.8 KiB
YAML
113 lines
2.8 KiB
YAML
- name: Create Open WebUI data directory
|
|
file:
|
|
path: "{{ courseware_state_dir }}/open-webui"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Create uv helper virtual environment
|
|
command:
|
|
argv:
|
|
- "{{ courseware_python_bin }}"
|
|
- -m
|
|
- venv
|
|
- "{{ courseware_uv_venv_dir }}"
|
|
args:
|
|
creates: "{{ courseware_uv_venv_dir }}/bin/python"
|
|
|
|
- name: Install uv helper
|
|
command:
|
|
argv:
|
|
- "{{ courseware_uv_venv_dir }}/bin/python"
|
|
- -m
|
|
- pip
|
|
- install
|
|
- --upgrade
|
|
- pip
|
|
- uv
|
|
args:
|
|
creates: "{{ courseware_uv_venv_dir }}/bin/uv"
|
|
|
|
- name: Check Open WebUI virtual environment Python version
|
|
command:
|
|
argv:
|
|
- "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
|
- -c
|
|
- "import importlib.util, sys; expected = tuple(map(int, '{{ courseware_open_webui_python_version }}'.split('.')[:2])); ok = sys.version_info[:len(expected)] == expected and importlib.util.find_spec('pip') is not None; raise SystemExit(0 if ok else 1)"
|
|
register: courseware_open_webui_python_check
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Remove incompatible Open WebUI virtual environment
|
|
file:
|
|
path: "{{ courseware_venvs_dir }}/open-webui"
|
|
state: absent
|
|
when: courseware_open_webui_python_check.rc != 0
|
|
|
|
- name: Create Open WebUI virtual environment
|
|
command:
|
|
argv:
|
|
- "{{ courseware_uv_venv_dir }}/bin/uv"
|
|
- venv
|
|
- --seed
|
|
- --python
|
|
- "{{ courseware_open_webui_python_version }}"
|
|
- "{{ courseware_venvs_dir }}/open-webui"
|
|
args:
|
|
creates: "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
|
environment:
|
|
UV_PYTHON_INSTALL_DIR: "{{ courseware_uv_python_install_dir }}"
|
|
|
|
- name: Upgrade Open WebUI venv tooling
|
|
command:
|
|
argv:
|
|
- "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
|
- -m
|
|
- pip
|
|
- install
|
|
- --upgrade
|
|
- pip
|
|
- setuptools
|
|
- wheel
|
|
|
|
- name: Install Open WebUI
|
|
command:
|
|
argv:
|
|
- "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
|
- -m
|
|
- pip
|
|
- install
|
|
- "{{ courseware_open_webui_spec }}"
|
|
- "numpy<2"
|
|
|
|
- name: Create Embedding Atlas virtual environment
|
|
command:
|
|
argv:
|
|
- "{{ courseware_python_bin }}"
|
|
- -m
|
|
- venv
|
|
- "{{ courseware_venvs_dir }}/embedding-atlas"
|
|
args:
|
|
creates: "{{ courseware_venvs_dir }}/embedding-atlas/bin/python"
|
|
|
|
- name: Upgrade Embedding Atlas venv tooling
|
|
command:
|
|
argv:
|
|
- "{{ courseware_venvs_dir }}/embedding-atlas/bin/python"
|
|
- -m
|
|
- pip
|
|
- install
|
|
- --upgrade
|
|
- pip
|
|
- setuptools
|
|
- wheel
|
|
|
|
- name: Install Embedding Atlas
|
|
command:
|
|
argv:
|
|
- "{{ courseware_venvs_dir }}/embedding-atlas/bin/python"
|
|
- -m
|
|
- pip
|
|
- install
|
|
- "{{ courseware_embedding_atlas_spec }}"
|
|
- "numpy<2"
|