|
|
--- |
|
|
- name: Test Environment Provisioning |
|
|
hosts: test_environments |
|
|
remote_user: fedora |
|
|
become: true |
|
|
gather_facts: false |
|
|
|
|
|
tasks: |
|
|
|
|
|
- name: Wait until the instance is ready |
|
|
ansible.builtin.wait_for_connection: |
|
|
delay: 10 |
|
|
timeout: 60 |
|
|
|
|
|
- name: Gather facts for first time |
|
|
ansible.builtin.setup: |
|
|
|
|
|
- name: Required Packages |
|
|
ansible.builtin.package: |
|
|
name: "{{ item }}" |
|
|
state: present |
|
|
with_items: |
|
|
- podman |
|
|
- python3-libdnf5 |
|
|
|
|
|
- name: Models host directory |
|
|
ansible.builtin.file: |
|
|
path: locallm/models |
|
|
state: directory |
|
|
|
|
|
- name: Download Model |
|
|
ansible.builtin.get_url: |
|
|
url: https://huggingface.co/MaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUF/resolve/main/Mistral-7B-Instruct-v0.3.Q4_K_M.gguf |
|
|
dest: locallm/models |
|
|
|
|
|
- name: Run Model |
|
|
containers.podman.podman_container: |
|
|
name: llamacpp_python |
|
|
image: ghcr.io/containers/llamacpp_python:latest |
|
|
state: started |
|
|
interactive: true |
|
|
tty: true |
|
|
detach: true |
|
|
ports: |
|
|
- 8001:8001 |
|
|
volume: |
|
|
- ./locallm/models:/locallm/models:ro,Z |
|
|
env: |
|
|
MODEL_PATH: models/Mistral-7B-Instruct-v0.3.Q4_K_M.gguf |
|
|
HOST: 0.0.0.0 |
|
|
PORT: 8001 |
|
|
|
|
|
- name: Run Application |
|
|
containers.podman.podman_container: |
|
|
name: function_calling |
|
|
image: ghcr.io/containers/function_calling:latest |
|
|
state: started |
|
|
interactive: true |
|
|
tty: true |
|
|
ports: |
|
|
- 8501:8501 |
|
|
env: |
|
|
MODEL_ENDPOINT: http://10.88.0.1:8001 |
|
|
|