Skip to content

Commit 5cf7b96

Browse files
update
1 parent 4e8e5f4 commit 5cf7b96

3 files changed

Lines changed: 600 additions & 0 deletions

File tree

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
# Playbook do wdrażania mikrousług llm-orchestrator
3+
- name: Deploy LLM Orchestrator Microservices
4+
hosts: all
5+
become: yes
6+
vars:
7+
docker_compose_version: "2.15.1"
8+
project_root: "/opt/llm-orchestrator"
9+
docker_registry: "your-registry.example.com"
10+
environment: "{{ env | default('dev') }}"
11+
12+
tasks:
13+
- name: Aktualizacja pakietów
14+
apt:
15+
update_cache: yes
16+
cache_valid_time: 3600
17+
18+
- name: Instalacja wymaganych pakietów
19+
apt:
20+
name:
21+
- apt-transport-https
22+
- ca-certificates
23+
- curl
24+
- software-properties-common
25+
- python3-pip
26+
- git
27+
state: present
28+
29+
- name: Dodanie klucza GPG Docker
30+
apt_key:
31+
url: https://download.docker.com/linux/ubuntu/gpg
32+
state: present
33+
34+
- name: Dodanie repozytorium Docker
35+
apt_repository:
36+
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
37+
state: present
38+
39+
- name: Instalacja Docker
40+
apt:
41+
name: docker-ce
42+
state: present
43+
44+
- name: Instalacja Docker Compose
45+
get_url:
46+
url: https://github.com/docker/compose/releases/download/v{{ docker_compose_version }}/docker-compose-Linux-x86_64
47+
dest: /usr/local/bin/docker-compose
48+
mode: '0755'
49+
50+
- name: Utworzenie katalogu projektu
51+
file:
52+
path: "{{ project_root }}"
53+
state: directory
54+
mode: '0755'
55+
56+
- name: Klonowanie repozytorium
57+
git:
58+
repo: https://github.com/coboarding/python.git
59+
dest: "{{ project_root }}/repo"
60+
version: main
61+
62+
- name: Kopiowanie plików mikrousług
63+
copy:
64+
src: "{{ project_root }}/repo/containers/llm-orchestrator-min/microservices/"
65+
dest: "{{ project_root }}/microservices/"
66+
remote_src: yes
67+
68+
- name: Kopiowanie docker-compose.yml
69+
copy:
70+
src: "{{ project_root }}/repo/containers/llm-orchestrator-min/docker-compose.yml"
71+
dest: "{{ project_root }}/docker-compose.yml"
72+
remote_src: yes
73+
74+
- name: Tworzenie pliku .env
75+
template:
76+
src: templates/env.j2
77+
dest: "{{ project_root }}/.env"
78+
79+
- name: Budowanie obrazów Docker
80+
community.docker.docker_compose:
81+
project_src: "{{ project_root }}"
82+
build: yes
83+
nocache: "{{ nocache | default(false) }}"
84+
register: output
85+
86+
- name: Wyświetlenie wyniku budowania
87+
debug:
88+
var: output
89+
90+
- name: Uruchomienie usług
91+
community.docker.docker_compose:
92+
project_src: "{{ project_root }}"
93+
state: present
94+
95+
- name: Sprawdzenie statusu usług
96+
community.docker.docker_compose:
97+
project_src: "{{ project_root }}"
98+
services: all
99+
register: service_status
100+
101+
- name: Wyświetlenie statusu usług
102+
debug:
103+
var: service_status
104+
105+
- name: Czekanie na uruchomienie API Gateway
106+
uri:
107+
url: http://localhost:80/api/health
108+
status_code: 200
109+
register: result
110+
until: result.status == 200
111+
retries: 30
112+
delay: 10
113+
ignore_errors: yes
114+
115+
- name: Uruchomienie testów
116+
shell: "{{ project_root }}/microservices/model-service/scripts/run_tests_after_startup.sh --url=http://localhost"
117+
args:
118+
chdir: "{{ project_root }}"
119+
when: run_tests | default(false) | bool
120+
121+
- name: Konfiguracja monitoringu
122+
include_tasks: tasks/setup_monitoring.yml
123+
when: setup_monitoring | default(false) | bool

0 commit comments

Comments
 (0)