@cloud-ru/uikit-product-calculator 0.33.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/CHANGELOG.md +1508 -0
  2. package/LICENSE +201 -0
  3. package/README.md +85 -0
  4. package/package.json +75 -0
  5. package/src/components/Calculator/Calculator.tsx +79 -0
  6. package/src/components/Calculator/index.ts +1 -0
  7. package/src/components/CalculatorContent/CalculatorContent.tsx +38 -0
  8. package/src/components/CalculatorContent/index.ts +1 -0
  9. package/src/components/CalculatorContent/styles.module.scss +79 -0
  10. package/src/components/Catalog/Catalog.tsx +225 -0
  11. package/src/components/Catalog/components/PrivateCardHeader.tsx +63 -0
  12. package/src/components/Catalog/components/index.ts +1 -0
  13. package/src/components/Catalog/components/styles.module.scss +35 -0
  14. package/src/components/Catalog/index.ts +1 -0
  15. package/src/components/Catalog/styles.module.scss +104 -0
  16. package/src/components/Controls/AlertControl/AlertControl.tsx +44 -0
  17. package/src/components/Controls/AlertControl/index.ts +1 -0
  18. package/src/components/Controls/ArrayControl/ArrayControl.tsx +105 -0
  19. package/src/components/Controls/ArrayControl/index.ts +1 -0
  20. package/src/components/Controls/ArrayControl/styles.module.scss +33 -0
  21. package/src/components/Controls/CarouselControl/CarouselControl.tsx +173 -0
  22. package/src/components/Controls/CarouselControl/index.ts +1 -0
  23. package/src/components/Controls/CarouselControl/styles.module.scss +32 -0
  24. package/src/components/Controls/Control/Control.tsx +205 -0
  25. package/src/components/Controls/Control/index.ts +1 -0
  26. package/src/components/Controls/ObjectControl/ObjectControl.tsx +150 -0
  27. package/src/components/Controls/ObjectControl/index.ts +1 -0
  28. package/src/components/Controls/ObjectControl/styles.module.scss +18 -0
  29. package/src/components/Controls/ObjectDecorator/ObjectDecorator.tsx +23 -0
  30. package/src/components/Controls/ObjectDecorator/index.ts +1 -0
  31. package/src/components/Controls/ObjectDecorator/styles.module.scss +15 -0
  32. package/src/components/Controls/SegmentedControl/SegmentedControl.tsx +79 -0
  33. package/src/components/Controls/SegmentedControl/SegmentedControlCard.tsx +38 -0
  34. package/src/components/Controls/SegmentedControl/index.ts +1 -0
  35. package/src/components/Controls/SegmentedControl/styles.module.scss +8 -0
  36. package/src/components/Controls/SelectControl/SelectControl.tsx +172 -0
  37. package/src/components/Controls/SelectControl/index.ts +1 -0
  38. package/src/components/Controls/SelectControl/styles.module.scss +5 -0
  39. package/src/components/Controls/SliderControl/SliderControl.tsx +92 -0
  40. package/src/components/Controls/SliderControl/index.ts +1 -0
  41. package/src/components/Controls/StepperControl/StepperControl.tsx +160 -0
  42. package/src/components/Controls/StepperControl/index.ts +1 -0
  43. package/src/components/Controls/StepperControl/styles.module.scss +16 -0
  44. package/src/components/Controls/TableControl/TableControl.tsx +162 -0
  45. package/src/components/Controls/TableControl/helperComponents/StepperWithAllowedValues.tsx +50 -0
  46. package/src/components/Controls/TableControl/helperComponents/index.ts +1 -0
  47. package/src/components/Controls/TableControl/helperComponents/styles.module.scss +53 -0
  48. package/src/components/Controls/TableControl/index.ts +1 -0
  49. package/src/components/Controls/TableControl/styles.module.scss +104 -0
  50. package/src/components/Controls/ToggleCard/ToggleCard.tsx +46 -0
  51. package/src/components/Controls/ToggleCard/index.ts +1 -0
  52. package/src/components/Controls/ToggleCard/styles.module.scss +11 -0
  53. package/src/components/Controls/ToggleCardsControl/ToggleCardsControl.tsx +93 -0
  54. package/src/components/Controls/ToggleCardsControl/index.ts +1 -0
  55. package/src/components/Controls/ToggleCardsControl/styles.module.scss +40 -0
  56. package/src/components/Controls/ToggleControl/ToggleControl.tsx +59 -0
  57. package/src/components/Controls/ToggleControl/components/SwitchRow.tsx +98 -0
  58. package/src/components/Controls/ToggleControl/components/index.ts +1 -0
  59. package/src/components/Controls/ToggleControl/components/styles.module.scss +110 -0
  60. package/src/components/Controls/ToggleControl/index.ts +1 -0
  61. package/src/components/Controls/ToggleObjectControl/ToggleObjectControl.tsx +111 -0
  62. package/src/components/Controls/ToggleObjectControl/index.ts +1 -0
  63. package/src/components/Controls/ToggleObjectControl/styles.module.scss +13 -0
  64. package/src/components/Controls/constants.ts +16 -0
  65. package/src/components/Controls/index.tsx +26 -0
  66. package/src/components/Controls/types.ts +181 -0
  67. package/src/components/Controls/utils.ts +49 -0
  68. package/src/components/Disclaimer/Disclaimer.tsx +33 -0
  69. package/src/components/Disclaimer/index.ts +1 -0
  70. package/src/components/Disclaimer/styles.module.scss +14 -0
  71. package/src/components/HeaderContainer/index.tsx +32 -0
  72. package/src/components/HeaderContainer/styles.module.scss +24 -0
  73. package/src/components/PriceSummary/PriceSummary.tsx +158 -0
  74. package/src/components/PriceSummary/components/PricePeriodSelect/PricePeriodSelect.tsx +81 -0
  75. package/src/components/PriceSummary/components/PricePeriodSelect/index.ts +1 -0
  76. package/src/components/PriceSummary/components/ProductCard/ProductCard.tsx +85 -0
  77. package/src/components/PriceSummary/components/ProductCard/index.ts +1 -0
  78. package/src/components/PriceSummary/components/ProductCard/styles.module.scss +7 -0
  79. package/src/components/PriceSummary/components/ProductListActions/ProductListActions.tsx +118 -0
  80. package/src/components/PriceSummary/components/ProductListActions/index.ts +1 -0
  81. package/src/components/PriceSummary/components/ProductListActions/styles.module.scss +38 -0
  82. package/src/components/PriceSummary/components/index.ts +3 -0
  83. package/src/components/PriceSummary/hooks.ts +36 -0
  84. package/src/components/PriceSummary/index.ts +1 -0
  85. package/src/components/PriceSummary/styles.module.scss +110 -0
  86. package/src/components/PriceSummary/utils/getTotalPrice.ts +19 -0
  87. package/src/components/PriceSummary/utils/index.ts +2 -0
  88. package/src/components/PriceSummary/utils/transformToProductCardData.ts +36 -0
  89. package/src/components/ProductHeadline/ProductPageHeadline.tsx +134 -0
  90. package/src/components/ProductHeadline/components/PriceCount.tsx +93 -0
  91. package/src/components/ProductHeadline/components/index.ts +1 -0
  92. package/src/components/ProductHeadline/components/styles.module.scss +52 -0
  93. package/src/components/ProductHeadline/index.ts +1 -0
  94. package/src/components/ProductHeadline/styles.module.scss +32 -0
  95. package/src/components/ProductPage/ProductPage.tsx +105 -0
  96. package/src/components/ProductPage/index.ts +1 -0
  97. package/src/components/ProductPage/styles.module.scss +13 -0
  98. package/src/components/Welcome/Welcome.tsx +138 -0
  99. package/src/components/Welcome/index.ts +1 -0
  100. package/src/components/Welcome/styles.module.scss +155 -0
  101. package/src/components/index.ts +3 -0
  102. package/src/config/config.tsx +27 -0
  103. package/src/config/index.ts +2 -0
  104. package/src/config/platforms/advanced/catalog.ts +82 -0
  105. package/src/config/platforms/advanced/constants.ts +23 -0
  106. package/src/config/platforms/advanced/index.ts +5 -0
  107. package/src/config/platforms/advanced/platform.tsx +13 -0
  108. package/src/config/platforms/advanced/product-config/AdvancedCloudBackup.ts +76 -0
  109. package/src/config/platforms/advanced/product-config/AdvancedCloudContainerEngine.tsx +260 -0
  110. package/src/config/platforms/advanced/product-config/AdvancedCloudServer.tsx +526 -0
  111. package/src/config/platforms/advanced/product-config/AdvancedDataAsYouUse.ts +159 -0
  112. package/src/config/platforms/advanced/product-config/AdvancedDataLakeInsight.ts +134 -0
  113. package/src/config/platforms/advanced/product-config/AdvancedDataWarehouseService.ts +94 -0
  114. package/src/config/platforms/advanced/product-config/AdvancedDcsMemcached.ts +69 -0
  115. package/src/config/platforms/advanced/product-config/AdvancedDcsRedis.ts +220 -0
  116. package/src/config/platforms/advanced/product-config/AdvancedDmsKafka.tsx +186 -0
  117. package/src/config/platforms/advanced/product-config/AdvancedDmsRabbitMq.ts +202 -0
  118. package/src/config/platforms/advanced/product-config/AdvancedDocumentDatabase.tsx +323 -0
  119. package/src/config/platforms/advanced/product-config/AdvancedElasticLoadBalance.tsx +252 -0
  120. package/src/config/platforms/advanced/product-config/AdvancedElasticSearch.ts +365 -0
  121. package/src/config/platforms/advanced/product-config/AdvancedFunctionGraph.tsx +65 -0
  122. package/src/config/platforms/advanced/product-config/AdvancedMapReduce.tsx +394 -0
  123. package/src/config/platforms/advanced/product-config/AdvancedMySqlDataBase.ts +417 -0
  124. package/src/config/platforms/advanced/product-config/AdvancedNetwork.ts +146 -0
  125. package/src/config/platforms/advanced/product-config/AdvancedObjectStorage.ts +232 -0
  126. package/src/config/platforms/advanced/product-config/AdvancedPostgreSqlDatabase.ts +402 -0
  127. package/src/config/platforms/advanced/product-config/AdvancedScalableFile.tsx +161 -0
  128. package/src/config/platforms/advanced/product-config/AdvancedSqlDatabase.ts +380 -0
  129. package/src/config/platforms/advanced/product-config/index.ts +21 -0
  130. package/src/config/platforms/advanced/products.ts +267 -0
  131. package/src/config/platforms/evolution/catalog.tsx +107 -0
  132. package/src/config/platforms/evolution/constants.ts +80 -0
  133. package/src/config/platforms/evolution/index.ts +5 -0
  134. package/src/config/platforms/evolution/platform.tsx +13 -0
  135. package/src/config/platforms/evolution/product-config/EvolutionArenadataDb.ts +151 -0
  136. package/src/config/platforms/evolution/product-config/EvolutionArtifactRegistry.ts +57 -0
  137. package/src/config/platforms/evolution/product-config/EvolutionBareMetal.tsx +172 -0
  138. package/src/config/platforms/evolution/product-config/EvolutionCloudServer.tsx +407 -0
  139. package/src/config/platforms/evolution/product-config/EvolutionCloudServerFreeTier.tsx +185 -0
  140. package/src/config/platforms/evolution/product-config/EvolutionCloudServerGpu.tsx +301 -0
  141. package/src/config/platforms/evolution/product-config/EvolutionContainerApps.ts +84 -0
  142. package/src/config/platforms/evolution/product-config/EvolutionContainerAppsFreeTier.ts +29 -0
  143. package/src/config/platforms/evolution/product-config/EvolutionKubernetes.ts +388 -0
  144. package/src/config/platforms/evolution/product-config/EvolutionManagedMetastore.ts +38 -0
  145. package/src/config/platforms/evolution/product-config/EvolutionManagedRedis.ts +161 -0
  146. package/src/config/platforms/evolution/product-config/EvolutionManagedSpark.ts +360 -0
  147. package/src/config/platforms/evolution/product-config/EvolutionManagedTrino.ts +53 -0
  148. package/src/config/platforms/evolution/product-config/EvolutionMlInference.tsx +703 -0
  149. package/src/config/platforms/evolution/product-config/EvolutionPostgreSql.ts +217 -0
  150. package/src/config/platforms/evolution/product-config/EvolutionPublicIp.ts +39 -0
  151. package/src/config/platforms/evolution/product-config/EvolutionSnatGateway.ts +22 -0
  152. package/src/config/platforms/evolution/product-config/EvolutionStorageS3.ts +223 -0
  153. package/src/config/platforms/evolution/product-config/EvolutionStorageS3FreeTier.ts +97 -0
  154. package/src/config/platforms/evolution/product-config/index.ts +17 -0
  155. package/src/config/platforms/evolution/products.ts +260 -0
  156. package/src/config/platforms/index.ts +3 -0
  157. package/src/config/platforms/vmware/catalog.ts +19 -0
  158. package/src/config/platforms/vmware/constants.ts +6 -0
  159. package/src/config/platforms/vmware/index.ts +5 -0
  160. package/src/config/platforms/vmware/platform.tsx +13 -0
  161. package/src/config/platforms/vmware/product-config/VmWareCloudBackup.ts +56 -0
  162. package/src/config/platforms/vmware/product-config/VmWareVirtualDataCenter.ts +309 -0
  163. package/src/config/platforms/vmware/product-config/VmWareVirtualMachinesBackup.ts +58 -0
  164. package/src/config/platforms/vmware/product-config/VmWareVirtualWorkspaces.tsx +210 -0
  165. package/src/config/platforms/vmware/product-config/index.ts +4 -0
  166. package/src/config/platforms/vmware/products.ts +63 -0
  167. package/src/config/styles.module.scss +9 -0
  168. package/src/config/utils/disk.ts +94 -0
  169. package/src/config/utils/diskPostgreSqlMySQL.ts +94 -0
  170. package/src/config/utils/eip.ts +104 -0
  171. package/src/config/utils/index.ts +52 -0
  172. package/src/config/utils/obs.ts +100 -0
  173. package/src/constants.ts +56 -0
  174. package/src/contexts/CalculatorContext.tsx +193 -0
  175. package/src/contexts/ProductContext.ts +25 -0
  176. package/src/contexts/index.ts +2 -0
  177. package/src/hooks/index.ts +6 -0
  178. package/src/hooks/useAdaptive.ts +20 -0
  179. package/src/hooks/useCatalogCardClick.ts +37 -0
  180. package/src/hooks/useProductClick.ts +14 -0
  181. package/src/hooks/useProductDelete.ts +46 -0
  182. package/src/index.ts +6 -0
  183. package/src/services/constants.ts +5 -0
  184. package/src/services/getFetcherFn.ts +57 -0
  185. package/src/services/getInitPrice.ts +64 -0
  186. package/src/services/getOnDownloadFileClick.ts +37 -0
  187. package/src/services/getOnShareClick.ts +56 -0
  188. package/src/services/index.ts +4 -0
  189. package/src/types/CalculatorType.ts +16 -0
  190. package/src/types/CatalogConfig.ts +13 -0
  191. package/src/types/Category.ts +14 -0
  192. package/src/types/FetcherFn.ts +26 -0
  193. package/src/types/FormValues.ts +4 -0
  194. package/src/types/Platform.ts +24 -0
  195. package/src/types/Price.ts +18 -0
  196. package/src/types/Product.ts +39 -0
  197. package/src/types/ProductState.ts +11 -0
  198. package/src/types/State.ts +7 -0
  199. package/src/types/index.ts +10 -0
  200. package/src/utils/filterNonEmptyArrays.ts +13 -0
  201. package/src/utils/formatNumber.ts +5 -0
  202. package/src/utils/getPrice.ts +38 -0
  203. package/src/utils/index.ts +5 -0
  204. package/src/utils/parseKeyToDataTest.ts +14 -0
  205. package/src/utils/value.ts +11 -0
@@ -0,0 +1,703 @@
1
+ import { CONTROL, FormConfig } from '../../../../components';
2
+ import { WORKING_HOURS_ITEMS, WorkingHoursSpecification } from '../../../../constants';
3
+ import { getMaxWorkingHoursAmount, getNumeralWord } from '../../../utils';
4
+
5
+ const LaunchMode = {
6
+ ModelSharedGPU: 'model-shared-gpu',
7
+ InstanceTypeGPU: 'instance-type-gpu',
8
+ } as const;
9
+
10
+ const ConfigurationType = {
11
+ SharedReady: 'shared-ready',
12
+ Custom: 'custom',
13
+ } as const;
14
+
15
+ const Configuration = {
16
+ Qwen: 'qwen-qwen-2.5',
17
+ Google: 'google',
18
+ Baai: 'baai',
19
+ BlackForest: 'black-forest',
20
+ QwenQwq: 'qwen-qwq',
21
+ DeepSeek: 'deepseek',
22
+ } as const;
23
+
24
+ const launchModeItems = [
25
+ {
26
+ label: 'Model Shared GPU',
27
+ value: LaunchMode.ModelSharedGPU,
28
+ description:
29
+ 'Запуск модели с возможностью частичного потребления GPU-ресурса (в пределах его физического объема памяти)',
30
+ },
31
+ {
32
+ label: 'Instance Type GPU',
33
+ value: LaunchMode.InstanceTypeGPU,
34
+ description:
35
+ 'Запуск образа на преднастроенной конфигурации инстанса с поддержкой частичного потребления GPU-ресурса',
36
+ },
37
+ ];
38
+
39
+ const configurationTypeItems = [
40
+ {
41
+ label: 'Готовая',
42
+ value: ConfigurationType.SharedReady,
43
+ description: 'Преднастроенная конфигурация для запуска популярных моделей',
44
+ },
45
+ {
46
+ label: 'Пользовательская',
47
+ value: ConfigurationType.Custom,
48
+ description: 'С возможностью настроить собственную конфигурацию для запуска моделей',
49
+ },
50
+ ];
51
+
52
+ const configurationItems = [
53
+ {
54
+ label: 'Qwen/Qwen2.5-Coder-32B-Instruct',
55
+ value: Configuration.Qwen,
56
+ description: (
57
+ <div>
58
+ Графический процессор NVIDIA® H100 PCIe
59
+ <br />
60
+ Видеопамять GPU 80 ГБ
61
+ <br />
62
+ Запросы к ML-моделям 5 млн запросов
63
+ <br />
64
+ Кэш ML-моделей 90 ГБ
65
+ </div>
66
+ ),
67
+ },
68
+ {
69
+ label: 'google-bert/bert-base-uncased',
70
+ value: Configuration.Google,
71
+ description: (
72
+ <div>
73
+ Графический процессор NVIDIA® H100 PCIe
74
+ <br />
75
+ Видеопамять GPU 4 ГБ
76
+ <br />
77
+ Запросы к ML-моделям 10 млн запросов
78
+ <br />
79
+ Кэш ML-моделей 1 ГБ
80
+ </div>
81
+ ),
82
+ },
83
+ {
84
+ label: 'BAAI/bge-reranker-v2-m3',
85
+ value: Configuration.Baai,
86
+ description: (
87
+ <div>
88
+ Графический процессор NVIDIA® V100 NVLink
89
+ <br />
90
+ Видеопамять GPU 4 ГБ
91
+ <br />
92
+ Запросы к ML-моделям 15 млн запросов
93
+ <br />
94
+ Кэш ML-моделей 1 ГБ
95
+ </div>
96
+ ),
97
+ },
98
+ {
99
+ label: 'black-forest-labs/FLUX.1-dev',
100
+ value: Configuration.BlackForest,
101
+ description: (
102
+ <div>
103
+ Графический процессор NVIDIA® H100 NVLink
104
+ <br />
105
+ Видеопамять GPU 40 ГБ
106
+ <br />
107
+ Запросы к ML-моделям 300 млн запросов
108
+ <br />
109
+ Кэш ML-моделей 60 ГБ
110
+ </div>
111
+ ),
112
+ },
113
+ {
114
+ label: 'Qwen/QwQ-32B',
115
+ value: Configuration.QwenQwq,
116
+ description: (
117
+ <div>
118
+ Графический процессор NVIDIA® H100 NVLink
119
+ <br />
120
+ Видеопамять GPU 80 ГБ
121
+ <br />
122
+ Запросы к ML-моделям 5 млн запросов
123
+ <br />
124
+ Кэш ML-моделей 70 ГБ
125
+ </div>
126
+ ),
127
+ },
128
+ {
129
+ label: 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
130
+ value: Configuration.DeepSeek,
131
+ description: (
132
+ <div>
133
+ Графический процессор NVIDIA® H100 NVLink
134
+ <br />
135
+ Видеопамять GPU 160 ГБ
136
+ <br />
137
+ Запросы к ML-моделям 4 млн запросов
138
+ <br />
139
+ Кэш ML-моделей 150 ГБ
140
+ </div>
141
+ ),
142
+ },
143
+ ];
144
+
145
+ const GpuValues = {
146
+ NvidiaH100Pcie: 'nvidia-h100-pcie',
147
+ NvidiaH100NVLink: 'nvidia-h100-nvlink',
148
+ NvidiaA100Pcie: 'nvidia-a100-pcie',
149
+ NvidiaV100NVLink: 'nvidia-v100-nvlink',
150
+ } as const;
151
+
152
+ const gpuItems = [
153
+ {
154
+ label: 'NVIDIA® H100 PCIe',
155
+ value: GpuValues.NvidiaH100Pcie,
156
+ },
157
+ {
158
+ label: 'NVIDIA® H100 NVLink',
159
+ value: GpuValues.NvidiaH100NVLink,
160
+ },
161
+ {
162
+ label: 'NVIDIA® A100 PCIe',
163
+ value: GpuValues.NvidiaA100Pcie,
164
+ },
165
+ {
166
+ label: 'NVIDIA® V100 NVLink',
167
+ value: GpuValues.NvidiaV100NVLink,
168
+ },
169
+ ];
170
+
171
+ const gpuInstanceTypes = {
172
+ [GpuValues.NvidiaH100Pcie]: [
173
+ {
174
+ label: 'NVIDIA® H100 PCIe',
175
+ value: GpuValues.NvidiaH100Pcie + '-1gpu',
176
+ description: (
177
+ <div>
178
+ 1 GPU
179
+ <br />
180
+ 20 vCPU
181
+ <br />
182
+ 125 ГБ RAM
183
+ </div>
184
+ ),
185
+ },
186
+ {
187
+ label: 'NVIDIA® H100 PCIe',
188
+ value: GpuValues.NvidiaH100Pcie + '-2gpu',
189
+ description: (
190
+ <div>
191
+ 2 GPU
192
+ <br />
193
+ 40 vCPU
194
+ <br />
195
+ 250 ГБ RAM
196
+ </div>
197
+ ),
198
+ },
199
+ {
200
+ label: 'NVIDIA® H100 PCIe',
201
+ value: GpuValues.NvidiaH100Pcie + '-4gpu',
202
+ description: (
203
+ <div>
204
+ 4 GPU
205
+ <br />
206
+ 80 vCPU
207
+ <br />
208
+ 500 ГБ RAM
209
+ </div>
210
+ ),
211
+ },
212
+ {
213
+ label: 'NVIDIA® H100 PCIe',
214
+ value: GpuValues.NvidiaH100Pcie + '-6gpu',
215
+ description: (
216
+ <div>
217
+ 6 GPU
218
+ <br />
219
+ 120 vCPU
220
+ <br />
221
+ 750 ГБ RAM
222
+ </div>
223
+ ),
224
+ },
225
+ {
226
+ label: 'NVIDIA® H100 PCIe',
227
+ value: GpuValues.NvidiaH100Pcie + '-8gpu',
228
+ description: (
229
+ <div>
230
+ 8 GPU
231
+ <br />
232
+ 160 vCPU
233
+ <br />
234
+ 1000 ГБ RAM
235
+ </div>
236
+ ),
237
+ },
238
+ ],
239
+ [GpuValues.NvidiaH100NVLink]: [
240
+ {
241
+ label: 'NVIDIA® H100 NVLink',
242
+ value: GpuValues.NvidiaH100NVLink + '-1gpu',
243
+ description: (
244
+ <div>
245
+ 1 GPU
246
+ <br />
247
+ 20 vCPU
248
+ <br />
249
+ 190 ГБ RAM
250
+ </div>
251
+ ),
252
+ },
253
+ {
254
+ label: 'NVIDIA® H100 NVLink',
255
+ value: GpuValues.NvidiaH100NVLink + '-2gpu',
256
+ description: (
257
+ <div>
258
+ 2 GPU
259
+ <br />
260
+ 40 vCPU
261
+ <br />
262
+ 380 ГБ RAM
263
+ </div>
264
+ ),
265
+ },
266
+ {
267
+ label: 'NVIDIA® H100 NVLink',
268
+ value: GpuValues.NvidiaH100NVLink + '-4gpu',
269
+ description: (
270
+ <div>
271
+ 4 GPU
272
+ <br />
273
+ 80 vCPU
274
+ <br />
275
+ 760 ГБ RAM
276
+ </div>
277
+ ),
278
+ },
279
+ {
280
+ label: 'NVIDIA® H100 NVLink',
281
+ value: GpuValues.NvidiaH100NVLink + '-6gpu',
282
+ description: (
283
+ <div>
284
+ 6 GPU
285
+ <br />
286
+ 120 vCPU
287
+ <br />
288
+ 1140 ГБ RAM
289
+ </div>
290
+ ),
291
+ },
292
+ {
293
+ label: 'NVIDIA® H100 NVLink',
294
+ value: GpuValues.NvidiaH100NVLink + '-8gpu',
295
+ description: (
296
+ <div>
297
+ 8 GPU
298
+ <br />
299
+ 160 vCPU
300
+ <br />
301
+ 1520 ГБ RAM
302
+ </div>
303
+ ),
304
+ },
305
+ ],
306
+ [GpuValues.NvidiaA100Pcie]: [
307
+ {
308
+ label: 'NVIDIA® A100 PCIe',
309
+ value: GpuValues.NvidiaA100Pcie + '-1gpu',
310
+ description: (
311
+ <div>
312
+ 1 GPU
313
+ <br />
314
+ 20 vCPU
315
+ <br />
316
+ 125 ГБ RAM
317
+ </div>
318
+ ),
319
+ },
320
+ {
321
+ label: 'NVIDIA® A100 PCIe',
322
+ value: GpuValues.NvidiaA100Pcie + '-2gpu',
323
+ description: (
324
+ <div>
325
+ 2 GPU
326
+ <br />
327
+ 40 vCPU
328
+ <br />
329
+ 250 ГБ RAM
330
+ </div>
331
+ ),
332
+ },
333
+ {
334
+ label: 'NVIDIA® A100 PCIe',
335
+ value: GpuValues.NvidiaA100Pcie + '-4gpu',
336
+ description: (
337
+ <div>
338
+ 4 GPU
339
+ <br />
340
+ 80 vCPU
341
+ <br />
342
+ 500 ГБ RAM
343
+ </div>
344
+ ),
345
+ },
346
+ {
347
+ label: 'NVIDIA® A100 PCIe',
348
+ value: GpuValues.NvidiaA100Pcie + '-6gpu',
349
+ description: (
350
+ <div>
351
+ 6 GPU
352
+ <br />
353
+ 120 vCPU
354
+ <br />
355
+ 750 ГБ RAM
356
+ </div>
357
+ ),
358
+ },
359
+ {
360
+ label: 'NVIDIA® A100 PCIe',
361
+ value: GpuValues.NvidiaA100Pcie + '-8gpu',
362
+ description: (
363
+ <div>
364
+ 8 GPU
365
+ <br />
366
+ 160 vCPU
367
+ <br />
368
+ 1000 ГБ RAM
369
+ </div>
370
+ ),
371
+ },
372
+ ],
373
+ [GpuValues.NvidiaV100NVLink]: [
374
+ {
375
+ label: 'NVIDIA® V100 NVLink',
376
+ value: GpuValues.NvidiaV100NVLink + '-1gpu',
377
+ description: (
378
+ <div>
379
+ 1 GPU
380
+ <br />
381
+ 4 vCPU
382
+ <br />
383
+ 64 ГБ RAM
384
+ </div>
385
+ ),
386
+ },
387
+ {
388
+ label: 'NVIDIA® V100 NVLink',
389
+ value: GpuValues.NvidiaV100NVLink + '-2gpu',
390
+ description: (
391
+ <div>
392
+ 2 GPU
393
+ <br />
394
+ 8 vCPU
395
+ <br />
396
+ 128 ГБ RAM
397
+ </div>
398
+ ),
399
+ },
400
+ {
401
+ label: 'NVIDIA® V100 NVLink',
402
+ value: GpuValues.NvidiaV100NVLink + '-4gpu',
403
+ description: (
404
+ <div>
405
+ 4 GPU
406
+ <br />
407
+ 16 vCPU
408
+ <br />
409
+ 256 ГБ RAM
410
+ </div>
411
+ ),
412
+ },
413
+ {
414
+ label: 'NVIDIA® V100 NVLink',
415
+ value: GpuValues.NvidiaV100NVLink + '-8gpu',
416
+ description: (
417
+ <div>
418
+ 8 GPU
419
+ <br />
420
+ 32 vCPU
421
+ <br />
422
+ 512 ГБ RAM
423
+ </div>
424
+ ),
425
+ },
426
+ {
427
+ label: 'NVIDIA® V100 NVLink',
428
+ value: GpuValues.NvidiaV100NVLink + '-16gpu',
429
+ description: (
430
+ <div>
431
+ 16 GPU
432
+ <br />
433
+ 64 vCPU
434
+ <br />
435
+ 1024 ГБ RAM
436
+ </div>
437
+ ),
438
+ },
439
+ ],
440
+ };
441
+
442
+ export const EVOLUTION_ML_INFERENCE_FORM_CONFIG: FormConfig = {
443
+ ui: [
444
+ 'mlInferenceLaunchMode',
445
+ 'mlInferenceConfigurationType',
446
+ 'mlInferenceConfiguration',
447
+ ['mlInferenceGpu', 'mlInferenceGpuMemory'],
448
+ 'mlInferenceGpuInstanceType',
449
+ 'mlInferenceRequests',
450
+ ['mlInferenceWorkingHours', 'mlInferenceWorkingHoursSpecification'],
451
+ ],
452
+ controls: {
453
+ mlInferenceLaunchMode: {
454
+ type: CONTROL.ToggleCards,
455
+ accessorKey: 'mlInferenceLaunchMode',
456
+ defaultValue: LaunchMode.ModelSharedGPU,
457
+ items: launchModeItems,
458
+ decoratorProps: {
459
+ label: 'Способ запуска инференса',
460
+ },
461
+ },
462
+ mlInferenceConfigurationType: {
463
+ type: CONTROL.ToggleCards,
464
+ accessorKey: 'mlInferenceConfigurationType',
465
+ defaultValue: ConfigurationType.SharedReady,
466
+ items: configurationTypeItems,
467
+ decoratorProps: {
468
+ label: 'Тип конфигурации',
469
+ },
470
+ watchedControls: {
471
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
472
+ },
473
+ relateFn: ({ mlInferenceLaunchMode }) => {
474
+ if (mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU) {
475
+ return {
476
+ uiProps: {
477
+ visible: false,
478
+ },
479
+ };
480
+ }
481
+ },
482
+ },
483
+ mlInferenceConfiguration: {
484
+ type: CONTROL.ToggleCards,
485
+ accessorKey: 'mlInferenceConfiguration',
486
+ defaultValue: Configuration.Qwen,
487
+ items: configurationItems,
488
+ watchedControls: {
489
+ mlInferenceConfigurationType: 'mlInferenceConfigurationType',
490
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
491
+ },
492
+ relateFn: ({ mlInferenceConfigurationType, mlInferenceLaunchMode }) => {
493
+ if (
494
+ mlInferenceConfigurationType !== ConfigurationType.SharedReady ||
495
+ mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU
496
+ ) {
497
+ return {
498
+ uiProps: {
499
+ visible: false,
500
+ },
501
+ };
502
+ }
503
+ },
504
+ decoratorProps: {
505
+ label: 'Конфигурация',
506
+ },
507
+ },
508
+ mlInferenceGpu: {
509
+ type: CONTROL.SelectSingle,
510
+ accessorKey: 'mlInferenceGpu',
511
+ items: gpuItems,
512
+ decoratorProps: {
513
+ label: 'Графический процессор',
514
+ },
515
+ watchedControls: {
516
+ mlInferenceConfigurationType: 'mlInferenceConfigurationType',
517
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
518
+ },
519
+ relateFn: ({ mlInferenceConfigurationType, mlInferenceLaunchMode }) => {
520
+ if (mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU) {
521
+ return {
522
+ uiProps: {
523
+ visible: true,
524
+ },
525
+ };
526
+ }
527
+ if (mlInferenceConfigurationType === ConfigurationType.SharedReady) {
528
+ return {
529
+ uiProps: {
530
+ visible: false,
531
+ },
532
+ };
533
+ }
534
+ },
535
+ },
536
+ mlInferenceGpuMemory: {
537
+ type: CONTROL.Stepper,
538
+ accessorKey: 'mlInferenceGpuMemory',
539
+ decoratorProps: {
540
+ label: 'Объем видеопамяти GPU',
541
+ },
542
+ defaultValue: 4,
543
+ uiProps: {
544
+ min: 4,
545
+ max: 80,
546
+ postfix: 'ГБ',
547
+ allowedValues: [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80],
548
+ },
549
+ watchedControls: {
550
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
551
+ mlInferenceConfigurationType: 'mlInferenceConfigurationType',
552
+ },
553
+ relateFn: ({ mlInferenceLaunchMode, mlInferenceConfigurationType }) => {
554
+ if (
555
+ mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU ||
556
+ mlInferenceConfigurationType === ConfigurationType.SharedReady
557
+ ) {
558
+ return {
559
+ uiProps: {
560
+ visible: false,
561
+ },
562
+ };
563
+ }
564
+ },
565
+ },
566
+ mlInferenceGpuInstanceType: {
567
+ type: CONTROL.ToggleCards,
568
+ accessorKey: 'mlInferenceGpuInstanceType',
569
+ items: gpuInstanceTypes[GpuValues.NvidiaH100Pcie],
570
+ decoratorProps: {
571
+ label: 'Тип инстанса',
572
+ },
573
+ watchedControls: {
574
+ mlInferenceGpu: 'mlInferenceGpu',
575
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
576
+ },
577
+ relateFn: ({
578
+ mlInferenceGpu,
579
+ mlInferenceLaunchMode,
580
+ }: {
581
+ mlInferenceGpu: keyof typeof gpuInstanceTypes;
582
+ mlInferenceLaunchMode: string;
583
+ }) => {
584
+ if (mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU) {
585
+ return {
586
+ uiProps: {
587
+ visible: true,
588
+ },
589
+ items: gpuInstanceTypes[mlInferenceGpu],
590
+ };
591
+ }
592
+
593
+ return {
594
+ uiProps: {
595
+ visible: false,
596
+ },
597
+ };
598
+ },
599
+ },
600
+ mlInferenceRequests: {
601
+ type: CONTROL.Object,
602
+ ui: [['mlInferenceRequestsCount', 'mlInferenceCacheVolume']],
603
+ watchedControls: {
604
+ mlInferenceConfigurationType: 'mlInferenceConfigurationType',
605
+ mlInferenceLaunchMode: 'mlInferenceLaunchMode',
606
+ },
607
+ relateFn: ({ mlInferenceConfigurationType, mlInferenceLaunchMode }) => {
608
+ if (mlInferenceLaunchMode === LaunchMode.InstanceTypeGPU) {
609
+ return {
610
+ visible: true,
611
+ };
612
+ }
613
+ if (mlInferenceConfigurationType === ConfigurationType.SharedReady) {
614
+ return {
615
+ visible: false,
616
+ };
617
+ }
618
+ },
619
+ controls: {
620
+ mlInferenceRequestsCount: {
621
+ type: CONTROL.Stepper,
622
+ accessorKey: 'mlInferenceRequestsCount',
623
+ decoratorProps: {
624
+ label: 'Количество запросов к ML-моделям',
625
+ },
626
+ defaultValue: 1,
627
+ uiProps: {
628
+ min: 1,
629
+ max: 9_999_999_999,
630
+ postfix: 'млн. шт.',
631
+ showHint: false,
632
+ },
633
+ },
634
+ mlInferenceCacheVolume: {
635
+ type: CONTROL.Stepper,
636
+ accessorKey: 'mlInferenceCacheVolume',
637
+ decoratorProps: {
638
+ label: 'Кэш ML-моделей',
639
+ },
640
+ defaultValue: 1,
641
+ uiProps: {
642
+ min: 1,
643
+ max: 9_999_999_999,
644
+ postfix: 'ГБ',
645
+ showHint: false,
646
+ },
647
+ },
648
+ },
649
+ },
650
+ mlInferenceWorkingHours: {
651
+ type: CONTROL.Stepper,
652
+ accessorKey: 'mlInferenceWorkingHours',
653
+ defaultValue: 1,
654
+ uiProps: {
655
+ min: 1,
656
+ max: 1,
657
+ postfix: 'час',
658
+ },
659
+ decoratorProps: {
660
+ label: 'Время работы',
661
+ },
662
+ watchedControls: {
663
+ period: 'mlInferenceWorkingHoursSpecification',
664
+ workingHours: 'mlInferenceWorkingHours',
665
+ },
666
+ relateFn: ({ period, workingHours }) => {
667
+ const maxWorkingHours = getMaxWorkingHoursAmount(period, {
668
+ hour: 1,
669
+ day: 24,
670
+ month: 744,
671
+ });
672
+ const isStepperDisabled = maxWorkingHours === 1;
673
+
674
+ return {
675
+ uiProps: {
676
+ min: 1,
677
+ max: maxWorkingHours,
678
+ showHint: !isStepperDisabled,
679
+ disabled: isStepperDisabled,
680
+ postfix: getNumeralWord(workingHours, ['час', 'часа', 'часов']),
681
+ },
682
+ };
683
+ },
684
+ },
685
+ mlInferenceWorkingHoursSpecification: {
686
+ type: CONTROL.SelectSingle,
687
+ accessorKey: 'mlInferenceWorkingHoursSpecification',
688
+ defaultValue: WorkingHoursSpecification.Hour,
689
+ items: WORKING_HOURS_ITEMS,
690
+ uiProps: {
691
+ showClearButton: false,
692
+ searchable: false,
693
+ },
694
+ decoratorProps: {
695
+ label: 'Период',
696
+ },
697
+ onChangePeriod: (period, setValue) => {
698
+ setValue([['mlInferenceWorkingHoursSpecification', period]]);
699
+ },
700
+ canChangeWholePricePeriod: true,
701
+ },
702
+ },
703
+ };