75 lines
5.0 KiB
XML
75 lines
5.0 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="434" viewBox="0 96 1000 434" role="img" aria-labelledby="title description">
|
||
<title id="title">Архитектура сервиса генерации описаний</title>
|
||
<desc id="description">Пользователь обращается к REST API. Сервер передаёт задачи через RabbitMQ воркерам. Воркеры сохраняют описания в общем Docker volume, откуда сервер читает их. Для компонента CALLBACKS воркеры также отправляют уведомления серверу через RabbitMQ.</desc>
|
||
<defs>
|
||
<marker id="message-arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto" markerUnits="userSpaceOnUse">
|
||
<path d="M 1 1 L 9 5 L 1 9" fill="none" stroke="#2563eb" stroke-width="2" stroke-linejoin="round"/>
|
||
</marker>
|
||
<marker id="notification-arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto" markerUnits="userSpaceOnUse">
|
||
<path d="M 1 1 L 9 5 L 1 9" fill="none" stroke="#7c3aed" stroke-width="2" stroke-linejoin="round"/>
|
||
</marker>
|
||
<marker id="file-arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto" markerUnits="userSpaceOnUse">
|
||
<path d="M 1 1 L 9 5 L 1 9" fill="none" stroke="#0f766e" stroke-width="2" stroke-linejoin="round"/>
|
||
</marker>
|
||
<style>
|
||
text { font-family: Arial, sans-serif; fill: #1e293b; }
|
||
.heading { font-size: 23px; font-weight: 700; }
|
||
.label { font-size: 20px; }
|
||
.detail { font-size: 17px; fill: #475569; }
|
||
.message { fill: none; stroke: #2563eb; stroke-width: 2.5; marker-end: url(#message-arrow); }
|
||
.notification { fill: none; stroke: #7c3aed; stroke-width: 2.5; stroke-dasharray: 7 5; marker-end: url(#notification-arrow); }
|
||
.file { fill: none; stroke: #0f766e; stroke-width: 2.5; marker-end: url(#file-arrow); }
|
||
</style>
|
||
</defs>
|
||
|
||
<rect width="1000" height="530" fill="#ffffff"/>
|
||
|
||
<!-- HTTP client and API server. -->
|
||
<rect x="20" y="185" width="140" height="100" rx="12" fill="#f8fafc" stroke="#94a3b8" stroke-width="2"/>
|
||
<text x="90" y="228" text-anchor="middle" class="label">Пользователь</text>
|
||
<text x="90" y="255" text-anchor="middle" class="detail">HTTP-клиент</text>
|
||
|
||
<rect x="220" y="140" width="180" height="180" rx="14" fill="#eff6ff" stroke="#2563eb" stroke-width="2"/>
|
||
<text x="310" y="221" text-anchor="middle" class="heading">Сервер</text>
|
||
<text x="310" y="251" text-anchor="middle" class="label">REST API</text>
|
||
|
||
<path d="M 160 214 H 218" class="message"/>
|
||
<path d="M 220 265 H 162" class="message"/>
|
||
<text x="190" y="245" text-anchor="middle" class="detail">HTTP</text>
|
||
|
||
<!-- RabbitMQ and its two message flows. -->
|
||
<rect x="460" y="116" width="200" height="228" rx="14" fill="#fff7ed" stroke="#ea580c" stroke-width="2"/>
|
||
<text x="560" y="149" text-anchor="middle" class="heading">RabbitMQ</text>
|
||
<rect x="480" y="170" width="160" height="48" rx="8" fill="#ffffff" stroke="#fb923c" stroke-width="1.5"/>
|
||
<text x="560" y="201" text-anchor="middle" class="label">Задачи</text>
|
||
|
||
<rect x="480" y="260" width="160" height="48" rx="8" fill="#ffffff" stroke="#a78bfa" stroke-width="1.5" stroke-dasharray="6 4"/>
|
||
<text x="560" y="291" text-anchor="middle" class="label">Уведомления</text>
|
||
|
||
<!-- A worker pool: the service can use several workers. -->
|
||
<rect x="740" y="140" width="240" height="180" rx="14" fill="#f8fafc" stroke="#64748b" stroke-width="2"/>
|
||
<text x="860" y="171" text-anchor="middle" class="heading">Воркеры</text>
|
||
<rect x="760" y="188" width="200" height="45" rx="8" fill="#ffffff" stroke="#94a3b8" stroke-width="1.5"/>
|
||
<text x="860" y="217" text-anchor="middle" class="label">Воркер 1</text>
|
||
<rect x="760" y="249" width="200" height="45" rx="8" fill="#ffffff" stroke="#94a3b8" stroke-width="1.5"/>
|
||
<text x="860" y="278" text-anchor="middle" class="label">Воркер 2</text>
|
||
|
||
<path d="M 400 194 H 458" class="message"/>
|
||
<path d="M 660 194 H 738" class="message"/>
|
||
<path d="M 740 284 H 662" class="notification"/>
|
||
<path d="M 460 284 H 402" class="notification"/>
|
||
|
||
<!-- Files are stored independently of messages. -->
|
||
<rect x="220" y="410" width="760" height="82" rx="14" fill="#f0fdfa" stroke="#0f766e" stroke-width="2"/>
|
||
<text x="600" y="444" text-anchor="middle" class="heading">Общий Docker volume</text>
|
||
<text x="600" y="473" text-anchor="middle" class="label">Файлы с описаниями</text>
|
||
|
||
<path d="M 310 410 V 322" class="file"/>
|
||
<text x="325" y="372" class="detail" style="fill:#0f766e">Чтение описаний</text>
|
||
<path d="M 860 320 V 408" class="file"/>
|
||
<text x="845" y="372" text-anchor="end" class="detail" style="fill:#0f766e">Запись описаний</text>
|
||
|
||
<path d="M 220 518 H 261" class="notification"/>
|
||
<text x="273" y="524" class="detail">Уведомления для компонента CALLBACKS</text>
|
||
</svg>
|