@lakutata/containerd 0.0.0-stage → 3.0.0-beta.1

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 (301) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +409 -2
  3. package/THIRD_PARTY_NOTICES.md +310 -0
  4. package/dist/cjs/client/BuildKit.d.ts +176 -0
  5. package/dist/cjs/client/BuildKit.js +536 -0
  6. package/dist/cjs/client/BuildKitMessages.d.ts +35 -0
  7. package/dist/cjs/client/BuildKitMessages.js +123 -0
  8. package/dist/cjs/client/ContainerStore.d.ts +558 -0
  9. package/dist/cjs/client/ContainerStore.js +1384 -0
  10. package/dist/cjs/client/ContainerdClient.d.ts +244 -0
  11. package/dist/cjs/client/ContainerdClient.js +455 -0
  12. package/dist/cjs/client/DockerIgnore.d.ts +44 -0
  13. package/dist/cjs/client/DockerIgnore.js +186 -0
  14. package/dist/cjs/client/Fifo.d.ts +31 -0
  15. package/dist/cjs/client/Fifo.js +66 -0
  16. package/dist/cjs/client/ImageStore.d.ts +258 -0
  17. package/dist/cjs/client/ImageStore.js +636 -0
  18. package/dist/cjs/client/Messages.d.ts +103 -0
  19. package/dist/cjs/client/Messages.js +397 -0
  20. package/dist/cjs/client/Networks.d.ts +221 -0
  21. package/dist/cjs/client/Networks.js +630 -0
  22. package/dist/cjs/client/Platforms.d.ts +53 -0
  23. package/dist/cjs/client/Platforms.js +169 -0
  24. package/dist/cjs/client/Reference.d.ts +33 -0
  25. package/dist/cjs/client/Reference.js +70 -0
  26. package/dist/cjs/client/Registry.d.ts +145 -0
  27. package/dist/cjs/client/Registry.js +272 -0
  28. package/dist/cjs/client/Rootfs.d.ts +83 -0
  29. package/dist/cjs/client/Rootfs.js +245 -0
  30. package/dist/cjs/client/Seccomp.d.ts +36 -0
  31. package/dist/cjs/client/Seccomp.js +156 -0
  32. package/dist/cjs/client/Spec.d.ts +151 -0
  33. package/dist/cjs/client/Spec.js +227 -0
  34. package/dist/cjs/client/Volumes.d.ts +42 -0
  35. package/dist/cjs/client/Volumes.js +80 -0
  36. package/dist/cjs/containerd/Containerd.d.ts +442 -0
  37. package/dist/cjs/containerd/Containerd.js +929 -0
  38. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  39. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.js +16 -0
  40. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  41. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.js +15 -0
  42. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  43. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.js +16 -0
  44. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  45. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.js +17 -0
  46. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  47. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.js +16 -0
  48. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  49. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.js +16 -0
  50. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  51. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.js +16 -0
  52. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  53. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.js +16 -0
  54. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  55. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.js +16 -0
  56. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  57. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.js +15 -0
  58. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  59. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.js +16 -0
  60. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  61. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.js +16 -0
  62. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  63. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.js +15 -0
  64. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  65. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.js +16 -0
  66. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  67. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.js +15 -0
  68. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  69. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.js +15 -0
  70. package/dist/cjs/containerd/lib/ContainerdContainer.d.ts +292 -0
  71. package/dist/cjs/containerd/lib/ContainerdContainer.js +536 -0
  72. package/dist/cjs/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  73. package/dist/cjs/containerd/lib/ContainerdContainerTTY.js +178 -0
  74. package/dist/cjs/containerd/lib/ContainerdErrors.d.ts +6 -0
  75. package/dist/cjs/containerd/lib/ContainerdErrors.js +37 -0
  76. package/dist/cjs/containerd/lib/ContainerdImage.d.ts +149 -0
  77. package/dist/cjs/containerd/lib/ContainerdImage.js +222 -0
  78. package/dist/cjs/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  79. package/dist/cjs/containerd/options/ContainerdPruneOptions.js +51 -0
  80. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  81. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.js +45 -0
  82. package/dist/cjs/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  83. package/dist/cjs/containerd/options/container/ContainerCommitOptions.js +66 -0
  84. package/dist/cjs/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  85. package/dist/cjs/containerd/options/container/ContainerCreateOptions.js +239 -0
  86. package/dist/cjs/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  87. package/dist/cjs/containerd/options/container/ContainerExecOptions.js +63 -0
  88. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  89. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.js +45 -0
  90. package/dist/cjs/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  91. package/dist/cjs/containerd/options/container/ContainerKillOptions.js +41 -0
  92. package/dist/cjs/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  93. package/dist/cjs/containerd/options/container/ContainerLogsOptions.js +44 -0
  94. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  95. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.js +34 -0
  96. package/dist/cjs/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  97. package/dist/cjs/containerd/options/container/ContainerResourceOptions.js +67 -0
  98. package/dist/cjs/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  99. package/dist/cjs/containerd/options/container/ContainerStopOptions.js +41 -0
  100. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  101. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.js +40 -0
  102. package/dist/cjs/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  103. package/dist/cjs/containerd/options/container/ContainerTTYOptions.js +63 -0
  104. package/dist/cjs/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  105. package/dist/cjs/containerd/options/image/ImageBuildOptions.js +95 -0
  106. package/dist/cjs/containerd/options/image/ImageExportOptions.d.ts +25 -0
  107. package/dist/cjs/containerd/options/image/ImageExportOptions.js +39 -0
  108. package/dist/cjs/containerd/options/image/ImageImportOptions.d.ts +38 -0
  109. package/dist/cjs/containerd/options/image/ImageImportOptions.js +47 -0
  110. package/dist/cjs/containerd/options/image/ImagePullOptions.d.ts +53 -0
  111. package/dist/cjs/containerd/options/image/ImagePullOptions.js +66 -0
  112. package/dist/cjs/containerd/options/image/ImagePushOptions.d.ts +44 -0
  113. package/dist/cjs/containerd/options/image/ImagePushOptions.js +58 -0
  114. package/dist/cjs/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  115. package/dist/cjs/containerd/options/network/NetworkCreateOptions.js +83 -0
  116. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  117. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.js +40 -0
  118. package/dist/cjs/containerd/types/ContainerdBind.d.ts +28 -0
  119. package/dist/cjs/containerd/types/ContainerdBind.js +2 -0
  120. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  121. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.js +2 -0
  122. package/dist/cjs/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  123. package/dist/cjs/containerd/types/ContainerdContainerNetwork.js +2 -0
  124. package/dist/cjs/containerd/types/ContainerdContainerPort.d.ts +22 -0
  125. package/dist/cjs/containerd/types/ContainerdContainerPort.js +2 -0
  126. package/dist/cjs/containerd/types/ContainerdContainerState.d.ts +42 -0
  127. package/dist/cjs/containerd/types/ContainerdContainerState.js +2 -0
  128. package/dist/cjs/containerd/types/ContainerdContainerStats.d.ts +107 -0
  129. package/dist/cjs/containerd/types/ContainerdContainerStats.js +2 -0
  130. package/dist/cjs/containerd/types/ContainerdDevice.d.ts +25 -0
  131. package/dist/cjs/containerd/types/ContainerdDevice.js +2 -0
  132. package/dist/cjs/containerd/types/ContainerdExecResult.d.ts +18 -0
  133. package/dist/cjs/containerd/types/ContainerdExecResult.js +2 -0
  134. package/dist/cjs/containerd/types/ContainerdImageConfig.d.ts +46 -0
  135. package/dist/cjs/containerd/types/ContainerdImageConfig.js +2 -0
  136. package/dist/cjs/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  137. package/dist/cjs/containerd/types/ContainerdNetworkInfo.js +2 -0
  138. package/dist/cjs/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  139. package/dist/cjs/containerd/types/ContainerdProgressCallback.js +2 -0
  140. package/dist/cjs/containerd/types/ContainerdPruneResult.d.ts +21 -0
  141. package/dist/cjs/containerd/types/ContainerdPruneResult.js +2 -0
  142. package/dist/cjs/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  143. package/dist/cjs/containerd/types/ContainerdRestartPolicy.js +2 -0
  144. package/dist/cjs/containerd/types/ContainerdTmpfs.d.ts +20 -0
  145. package/dist/cjs/containerd/types/ContainerdTmpfs.js +2 -0
  146. package/dist/cjs/containerd/types/ContainerdVolume.d.ts +19 -0
  147. package/dist/cjs/containerd/types/ContainerdVolume.js +2 -0
  148. package/dist/cjs/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  149. package/dist/cjs/containerd/types/ContainerdVolumeInfo.js +2 -0
  150. package/dist/cjs/exports/Containerd.d.ts +69 -0
  151. package/dist/cjs/exports/Containerd.js +87 -0
  152. package/dist/cjs/package.json +1 -0
  153. package/dist/esm/client/BuildKit.js +488 -0
  154. package/dist/esm/client/BuildKitMessages.js +120 -0
  155. package/dist/esm/client/ContainerStore.js +1339 -0
  156. package/dist/esm/client/ContainerdClient.js +416 -0
  157. package/dist/esm/client/DockerIgnore.js +179 -0
  158. package/dist/esm/client/Fifo.js +59 -0
  159. package/dist/esm/client/ImageStore.js +628 -0
  160. package/dist/esm/client/Messages.js +393 -0
  161. package/dist/esm/client/Networks.js +621 -0
  162. package/dist/esm/client/Platforms.js +156 -0
  163. package/dist/esm/client/Reference.js +66 -0
  164. package/dist/esm/client/Registry.js +263 -0
  165. package/dist/esm/client/Rootfs.js +234 -0
  166. package/dist/esm/client/Seccomp.js +152 -0
  167. package/dist/esm/client/Spec.js +220 -0
  168. package/dist/esm/client/Volumes.js +73 -0
  169. package/dist/esm/containerd/Containerd.js +923 -0
  170. package/dist/esm/containerd/exceptions/ContainerdConnectionException.js +12 -0
  171. package/dist/esm/containerd/exceptions/ContainerdContainerNameConflictException.js +11 -0
  172. package/dist/esm/containerd/exceptions/ContainerdContainerNotFoundException.js +12 -0
  173. package/dist/esm/containerd/exceptions/ContainerdContainerStateException.js +13 -0
  174. package/dist/esm/containerd/exceptions/ContainerdImageBuildException.js +12 -0
  175. package/dist/esm/containerd/exceptions/ContainerdImageExportException.js +12 -0
  176. package/dist/esm/containerd/exceptions/ContainerdImageImportException.js +12 -0
  177. package/dist/esm/containerd/exceptions/ContainerdImageNotFoundException.js +12 -0
  178. package/dist/esm/containerd/exceptions/ContainerdImagePullException.js +12 -0
  179. package/dist/esm/containerd/exceptions/ContainerdImagePushException.js +11 -0
  180. package/dist/esm/containerd/exceptions/ContainerdNetworkConflictException.js +12 -0
  181. package/dist/esm/containerd/exceptions/ContainerdNetworkNotFoundException.js +12 -0
  182. package/dist/esm/containerd/exceptions/ContainerdPathNotFoundException.js +11 -0
  183. package/dist/esm/containerd/exceptions/ContainerdPlatformException.js +12 -0
  184. package/dist/esm/containerd/exceptions/ContainerdVolumeInUseException.js +11 -0
  185. package/dist/esm/containerd/exceptions/ContainerdVolumeNotFoundException.js +11 -0
  186. package/dist/esm/containerd/lib/ContainerdContainer.js +533 -0
  187. package/dist/esm/containerd/lib/ContainerdContainerTTY.js +175 -0
  188. package/dist/esm/containerd/lib/ContainerdErrors.js +34 -0
  189. package/dist/esm/containerd/lib/ContainerdImage.js +219 -0
  190. package/dist/esm/containerd/options/ContainerdPruneOptions.js +47 -0
  191. package/dist/esm/containerd/options/ContainerdRegistryAuthOptions.js +41 -0
  192. package/dist/esm/containerd/options/container/ContainerCommitOptions.js +62 -0
  193. package/dist/esm/containerd/options/container/ContainerCreateOptions.js +235 -0
  194. package/dist/esm/containerd/options/container/ContainerExecOptions.js +59 -0
  195. package/dist/esm/containerd/options/container/ContainerExportDirectoryOptions.js +41 -0
  196. package/dist/esm/containerd/options/container/ContainerKillOptions.js +37 -0
  197. package/dist/esm/containerd/options/container/ContainerLogsOptions.js +40 -0
  198. package/dist/esm/containerd/options/container/ContainerRemoveOptions.js +30 -0
  199. package/dist/esm/containerd/options/container/ContainerResourceOptions.js +63 -0
  200. package/dist/esm/containerd/options/container/ContainerStopOptions.js +37 -0
  201. package/dist/esm/containerd/options/container/ContainerTTYConsoleSizeOptions.js +36 -0
  202. package/dist/esm/containerd/options/container/ContainerTTYOptions.js +59 -0
  203. package/dist/esm/containerd/options/image/ImageBuildOptions.js +91 -0
  204. package/dist/esm/containerd/options/image/ImageExportOptions.js +35 -0
  205. package/dist/esm/containerd/options/image/ImageImportOptions.js +43 -0
  206. package/dist/esm/containerd/options/image/ImagePullOptions.js +62 -0
  207. package/dist/esm/containerd/options/image/ImagePushOptions.js +54 -0
  208. package/dist/esm/containerd/options/network/NetworkCreateOptions.js +79 -0
  209. package/dist/esm/containerd/options/volume/VolumeCreateOptions.js +36 -0
  210. package/dist/esm/containerd/types/ContainerdBind.js +1 -0
  211. package/dist/esm/containerd/types/ContainerdBuildOutputCallback.js +1 -0
  212. package/dist/esm/containerd/types/ContainerdContainerNetwork.js +1 -0
  213. package/dist/esm/containerd/types/ContainerdContainerPort.js +1 -0
  214. package/dist/esm/containerd/types/ContainerdContainerState.js +1 -0
  215. package/dist/esm/containerd/types/ContainerdContainerStats.js +1 -0
  216. package/dist/esm/containerd/types/ContainerdDevice.js +1 -0
  217. package/dist/esm/containerd/types/ContainerdExecResult.js +1 -0
  218. package/dist/esm/containerd/types/ContainerdImageConfig.js +1 -0
  219. package/dist/esm/containerd/types/ContainerdNetworkInfo.js +1 -0
  220. package/dist/esm/containerd/types/ContainerdProgressCallback.js +1 -0
  221. package/dist/esm/containerd/types/ContainerdPruneResult.js +1 -0
  222. package/dist/esm/containerd/types/ContainerdRestartPolicy.js +1 -0
  223. package/dist/esm/containerd/types/ContainerdTmpfs.js +1 -0
  224. package/dist/esm/containerd/types/ContainerdVolume.js +1 -0
  225. package/dist/esm/containerd/types/ContainerdVolumeInfo.js +1 -0
  226. package/dist/esm/exports/Containerd.js +68 -0
  227. package/dist/types/client/BuildKit.d.ts +176 -0
  228. package/dist/types/client/BuildKitMessages.d.ts +35 -0
  229. package/dist/types/client/ContainerStore.d.ts +558 -0
  230. package/dist/types/client/ContainerdClient.d.ts +244 -0
  231. package/dist/types/client/DockerIgnore.d.ts +44 -0
  232. package/dist/types/client/Fifo.d.ts +31 -0
  233. package/dist/types/client/ImageStore.d.ts +258 -0
  234. package/dist/types/client/Messages.d.ts +103 -0
  235. package/dist/types/client/Networks.d.ts +221 -0
  236. package/dist/types/client/Platforms.d.ts +53 -0
  237. package/dist/types/client/Reference.d.ts +33 -0
  238. package/dist/types/client/Registry.d.ts +145 -0
  239. package/dist/types/client/Rootfs.d.ts +83 -0
  240. package/dist/types/client/Seccomp.d.ts +36 -0
  241. package/dist/types/client/Spec.d.ts +151 -0
  242. package/dist/types/client/Volumes.d.ts +42 -0
  243. package/dist/types/containerd/Containerd.d.ts +442 -0
  244. package/dist/types/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  245. package/dist/types/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  246. package/dist/types/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  247. package/dist/types/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  248. package/dist/types/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  249. package/dist/types/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  250. package/dist/types/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  251. package/dist/types/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  252. package/dist/types/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  253. package/dist/types/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  254. package/dist/types/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  255. package/dist/types/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  256. package/dist/types/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  257. package/dist/types/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  258. package/dist/types/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  259. package/dist/types/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  260. package/dist/types/containerd/lib/ContainerdContainer.d.ts +292 -0
  261. package/dist/types/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  262. package/dist/types/containerd/lib/ContainerdErrors.d.ts +6 -0
  263. package/dist/types/containerd/lib/ContainerdImage.d.ts +149 -0
  264. package/dist/types/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  265. package/dist/types/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  266. package/dist/types/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  267. package/dist/types/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  268. package/dist/types/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  269. package/dist/types/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  270. package/dist/types/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  271. package/dist/types/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  272. package/dist/types/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  273. package/dist/types/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  274. package/dist/types/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  275. package/dist/types/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  276. package/dist/types/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  277. package/dist/types/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  278. package/dist/types/containerd/options/image/ImageExportOptions.d.ts +25 -0
  279. package/dist/types/containerd/options/image/ImageImportOptions.d.ts +38 -0
  280. package/dist/types/containerd/options/image/ImagePullOptions.d.ts +53 -0
  281. package/dist/types/containerd/options/image/ImagePushOptions.d.ts +44 -0
  282. package/dist/types/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  283. package/dist/types/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  284. package/dist/types/containerd/types/ContainerdBind.d.ts +28 -0
  285. package/dist/types/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  286. package/dist/types/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  287. package/dist/types/containerd/types/ContainerdContainerPort.d.ts +22 -0
  288. package/dist/types/containerd/types/ContainerdContainerState.d.ts +42 -0
  289. package/dist/types/containerd/types/ContainerdContainerStats.d.ts +107 -0
  290. package/dist/types/containerd/types/ContainerdDevice.d.ts +25 -0
  291. package/dist/types/containerd/types/ContainerdExecResult.d.ts +18 -0
  292. package/dist/types/containerd/types/ContainerdImageConfig.d.ts +46 -0
  293. package/dist/types/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  294. package/dist/types/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  295. package/dist/types/containerd/types/ContainerdPruneResult.d.ts +21 -0
  296. package/dist/types/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  297. package/dist/types/containerd/types/ContainerdTmpfs.d.ts +20 -0
  298. package/dist/types/containerd/types/ContainerdVolume.d.ts +19 -0
  299. package/dist/types/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  300. package/dist/types/exports/Containerd.d.ts +69 -0
  301. package/package.json +51 -4
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthCheckResponse = exports.HealthCheckRequest = exports.FetchTokenResponse = exports.FetchTokenRequest = exports.CredentialsResponse = exports.CredentialsRequest = exports.Packet = exports.Stat = exports.PacketType = exports.ListWorkersResponse = exports.ListWorkersRequest = exports.WorkerRecord = exports.BuildKitPlatform = exports.InfoResponse = exports.BuildkitVersion = exports.StatusResponse = exports.VertexWarning = exports.VertexLog = exports.VertexStatus = exports.Vertex = exports.StatusRequest = exports.SolveResponse = exports.SolveRequest = exports.ExporterMessage = exports.BytesMessage = void 0;
4
+ const Messages_js_1 = require("./Messages.js");
5
+ /*
6
+ * The messages of the API of BuildKit (github.com/moby/buildkit: api/services/control, session/filesync,
7
+ * session/auth) and of fsutil (github.com/tonistiigi/fsutil: types), the fields read and written
8
+ */
9
+ exports.BytesMessage = { data: { no: 1, type: 'bytes' } };
10
+ exports.ExporterMessage = {
11
+ type: { no: 1, type: 'string' },
12
+ attrs: { no: 2, type: 'string', map: true }
13
+ };
14
+ exports.SolveRequest = {
15
+ ref: { no: 1, type: 'string' },
16
+ exporter: { no: 3, type: 'string' },
17
+ exporterAttrs: { no: 4, type: 'string', map: true },
18
+ session: { no: 5, type: 'string' },
19
+ frontend: { no: 6, type: 'string' },
20
+ frontendAttrs: { no: 7, type: 'string', map: true },
21
+ entitlements: { no: 9, type: 'string', repeated: true },
22
+ exporters: { no: 13, type: exports.ExporterMessage, repeated: true }
23
+ };
24
+ exports.SolveResponse = { exporterResponse: { no: 1, type: 'string', map: true } };
25
+ exports.StatusRequest = { ref: { no: 1, type: 'string' } };
26
+ exports.Vertex = {
27
+ digest: { no: 1, type: 'string' },
28
+ inputs: { no: 2, type: 'string', repeated: true },
29
+ name: { no: 3, type: 'string' },
30
+ cached: { no: 4, type: 'bool' },
31
+ started: { no: 5, type: Messages_js_1.Timestamp },
32
+ completed: { no: 6, type: Messages_js_1.Timestamp },
33
+ error: { no: 7, type: 'string' }
34
+ };
35
+ exports.VertexStatus = {
36
+ id: { no: 1, type: 'string' },
37
+ vertex: { no: 2, type: 'string' },
38
+ name: { no: 3, type: 'string' },
39
+ current: { no: 4, type: 'int64' },
40
+ total: { no: 5, type: 'int64' }
41
+ };
42
+ exports.VertexLog = {
43
+ vertex: { no: 1, type: 'string' },
44
+ stream: { no: 3, type: 'int64' },
45
+ msg: { no: 4, type: 'bytes' }
46
+ };
47
+ exports.VertexWarning = {
48
+ vertex: { no: 1, type: 'string' },
49
+ level: { no: 2, type: 'int64' },
50
+ short: { no: 3, type: 'bytes' },
51
+ url: { no: 5, type: 'string' }
52
+ };
53
+ exports.StatusResponse = {
54
+ vertexes: { no: 1, type: exports.Vertex, repeated: true },
55
+ statuses: { no: 2, type: exports.VertexStatus, repeated: true },
56
+ logs: { no: 3, type: exports.VertexLog, repeated: true },
57
+ warnings: { no: 4, type: exports.VertexWarning, repeated: true }
58
+ };
59
+ exports.BuildkitVersion = {
60
+ package: { no: 1, type: 'string' },
61
+ version: { no: 2, type: 'string' },
62
+ revision: { no: 3, type: 'string' }
63
+ };
64
+ exports.InfoResponse = { buildkitVersion: { no: 1, type: exports.BuildkitVersion } };
65
+ exports.BuildKitPlatform = {
66
+ architecture: { no: 1, type: 'string' },
67
+ os: { no: 2, type: 'string' },
68
+ variant: { no: 3, type: 'string' }
69
+ };
70
+ exports.WorkerRecord = {
71
+ id: { no: 1, type: 'string' },
72
+ labels: { no: 2, type: 'string', map: true },
73
+ platforms: { no: 3, type: exports.BuildKitPlatform, repeated: true }
74
+ };
75
+ exports.ListWorkersRequest = { filter: { no: 1, type: 'string', repeated: true } };
76
+ exports.ListWorkersResponse = { record: { no: 1, type: exports.WorkerRecord, repeated: true } };
77
+ /*
78
+ * The session: the files (fsutil), the credentials of the registries, its health
79
+ */
80
+ /**
81
+ * The types of the packets of fsutil
82
+ */
83
+ var PacketType;
84
+ (function (PacketType) {
85
+ PacketType[PacketType["STAT"] = 0] = "STAT";
86
+ PacketType[PacketType["REQ"] = 1] = "REQ";
87
+ PacketType[PacketType["DATA"] = 2] = "DATA";
88
+ PacketType[PacketType["FIN"] = 3] = "FIN";
89
+ PacketType[PacketType["ERR"] = 4] = "ERR";
90
+ })(PacketType || (exports.PacketType = PacketType = {}));
91
+ exports.Stat = {
92
+ path: { no: 1, type: 'string' },
93
+ mode: { no: 2, type: 'uint32' },
94
+ uid: { no: 3, type: 'uint32' },
95
+ gid: { no: 4, type: 'uint32' },
96
+ size: { no: 5, type: 'int64' },
97
+ modTime: { no: 6, type: 'int64' },
98
+ linkname: { no: 7, type: 'string' },
99
+ devmajor: { no: 8, type: 'int64' },
100
+ devminor: { no: 9, type: 'int64' }
101
+ };
102
+ exports.Packet = {
103
+ type: { no: 1, type: 'enum' },
104
+ stat: { no: 2, type: exports.Stat },
105
+ id: { no: 3, type: 'uint32' },
106
+ data: { no: 4, type: 'bytes' }
107
+ };
108
+ exports.CredentialsRequest = { host: { no: 1, type: 'string' } };
109
+ exports.CredentialsResponse = { username: { no: 1, type: 'string' }, secret: { no: 2, type: 'string' } };
110
+ exports.FetchTokenRequest = {
111
+ clientId: { no: 1, type: 'string' },
112
+ host: { no: 2, type: 'string' },
113
+ realm: { no: 3, type: 'string' },
114
+ service: { no: 4, type: 'string' },
115
+ scopes: { no: 5, type: 'string', repeated: true }
116
+ };
117
+ exports.FetchTokenResponse = {
118
+ token: { no: 1, type: 'string' },
119
+ expiresIn: { no: 2, type: 'int64' },
120
+ issuedAt: { no: 3, type: 'int64' }
121
+ };
122
+ exports.HealthCheckRequest = { service: { no: 1, type: 'string' } };
123
+ exports.HealthCheckResponse = { status: { no: 1, type: 'enum' } };
@@ -0,0 +1,558 @@
1
+ import { type BigIntStats } from 'node:fs';
2
+ import { Readable } from 'node:stream';
3
+ import { ContainerdClient } from './ContainerdClient.js';
4
+ import { type Message } from '@lakutata/grpc';
5
+ import { type Platform } from './Platforms.js';
6
+ import { ImageStore, type ImageConfigChanges, type ResolvedImage } from './ImageStore.js';
7
+ import { VolumeStore } from './Volumes.js';
8
+ import { NetworkStore, type CNINetwork, type ContainerNetworkInterface, type PortMapping } from './Networks.js';
9
+ import { type SpecDevice } from './Spec.js';
10
+ import { type SeccompProfile } from './Seccomp.js';
11
+ /**
12
+ * The labels of the containers: the ones of nerdctl (nerdctl ps, nerdctl logs know them), the ones of the restart
13
+ * monitor of containerd
14
+ */
15
+ export declare const ContainerLabels: {
16
+ readonly NAME: "nerdctl/name";
17
+ readonly HOSTNAME: "nerdctl/hostname";
18
+ readonly PLATFORM: "nerdctl/platform";
19
+ readonly LOG_URI: "nerdctl/log-uri";
20
+ readonly STATE_DIR: "nerdctl/state-dir";
21
+ readonly NETWORKS: "nerdctl/networks";
22
+ readonly PORTS: "nerdctl/ports";
23
+ readonly MOUNTS: "nerdctl/mounts";
24
+ readonly STOP_SIGNAL: "io.containerd.image.config.stop-signal";
25
+ readonly RESTART_POLICY: "containerd.io/restart.policy";
26
+ readonly RESTART_STATUS: "containerd.io/restart.status";
27
+ readonly RESTART_LOG_URI: "containerd.io/restart.loguri";
28
+ };
29
+ /**
30
+ * The restart policies of the containers (the ones of the restart monitor of containerd): no, always,
31
+ * unless-stopped, on-failure (on-failure:N, N restarts at most)
32
+ */
33
+ export type RestartPolicy = 'no' | 'always' | 'unless-stopped' | 'on-failure' | `on-failure:${number}`;
34
+ /**
35
+ * The statuses of the containers
36
+ */
37
+ export type ContainerStatus = 'created' | 'running' | 'paused' | 'pausing' | 'restarting' | 'exited' | 'unknown';
38
+ /**
39
+ * The state of a container: its task (its process), its last exit
40
+ */
41
+ export type ContainerRuntimeState = {
42
+ status: ContainerStatus;
43
+ running: boolean;
44
+ paused: boolean;
45
+ pid: number;
46
+ exitCode: number;
47
+ startedAt: Date | null;
48
+ finishedAt: Date | null;
49
+ };
50
+ /**
51
+ * A mount of a container: a directory or a file of the host (bind), a tmpfs
52
+ */
53
+ export type ContainerMount = {
54
+ type?: 'bind' | 'tmpfs' | 'volume';
55
+ /**
56
+ * The directory (or the file) of the host of a bind, the name of a volume (created when it does not exist)
57
+ */
58
+ source?: string;
59
+ target: string;
60
+ readonly?: boolean;
61
+ /**
62
+ * The options of the mount (size=64m for a tmpfs, the propagation of a bind: rshared…)
63
+ */
64
+ options?: string[];
65
+ };
66
+ /**
67
+ * A device of the host given to a container
68
+ */
69
+ export type ContainerDeviceMapping = {
70
+ hostPath: string;
71
+ containerPath?: string;
72
+ permissions?: string;
73
+ };
74
+ /**
75
+ * The options of the creation of a container
76
+ */
77
+ export type ContainerCreateOptions = {
78
+ image: string;
79
+ name?: string;
80
+ platform?: Platform;
81
+ hostname?: string;
82
+ cmd?: string[];
83
+ entrypoint?: string[];
84
+ env?: Record<string, string>;
85
+ workingDir?: string;
86
+ user?: string;
87
+ labels?: Record<string, string>;
88
+ terminal?: boolean;
89
+ privileged?: boolean;
90
+ readonlyRootfs?: boolean;
91
+ capAdd?: string[];
92
+ capDrop?: string[];
93
+ /**
94
+ * The profile of seccomp: the default one of containerd (and nerdctl), unconfined, or the file of a profile of OCI
95
+ * (the linux.seccomp of its specification); the privileged containers are unconfined
96
+ */
97
+ seccompProfile?: 'default' | 'unconfined' | string;
98
+ mounts?: ContainerMount[];
99
+ devices?: ContainerDeviceMapping[];
100
+ /**
101
+ * The devices the cgroup allows besides the ones given, as Docker writes them ("c 188:* rwm"): the devices plugged
102
+ * after the start, given by a bind mount of /dev (or of /dev/serial, /dev/bus/usb)
103
+ */
104
+ deviceCgroupRules?: string[];
105
+ /**
106
+ * The network of the container: the one of the host, none (its loopback only), or networks of CNI (bridge, the
107
+ * default one of nerdctl), with their addresses
108
+ */
109
+ network?: 'host' | 'none' | {
110
+ name: string;
111
+ ip?: string;
112
+ ipv6?: string;
113
+ }[];
114
+ /**
115
+ * The ports published on the host (on its first network of CNI)
116
+ */
117
+ ports?: PortMapping[];
118
+ pidHost?: boolean;
119
+ ipcHost?: boolean;
120
+ /**
121
+ * The cgroup namespace: a private one (on cgroup v2), or the one of the host
122
+ */
123
+ cgroupns?: 'private' | 'host';
124
+ memory?: number;
125
+ memorySwap?: number;
126
+ cpus?: number;
127
+ cpuShares?: number;
128
+ cpuset?: string;
129
+ pidsLimit?: number;
130
+ oomKillDisable?: boolean;
131
+ sysctls?: Record<string, string>;
132
+ shmSize?: number;
133
+ restart?: RestartPolicy;
134
+ stopSignal?: string;
135
+ extraHosts?: Record<string, string>;
136
+ dns?: string[];
137
+ };
138
+ /**
139
+ * The options of the store of the containers
140
+ */
141
+ export type ContainerStoreOptions = {
142
+ snapshotter: string;
143
+ runtime: string;
144
+ cgroupManager: 'cgroupfs' | 'systemd';
145
+ /**
146
+ * The directory of the states of the containers (their logs, their hosts, resolv.conf and hostname)
147
+ */
148
+ dataRoot: string;
149
+ /**
150
+ * The size of the logs of a container rotated (once): 0 never
151
+ */
152
+ logMaxSize: number;
153
+ };
154
+ /**
155
+ * The result of an execution in a container
156
+ */
157
+ export type ExecResult = {
158
+ exitCode: number;
159
+ stdout: string;
160
+ stderr: string;
161
+ };
162
+ /**
163
+ * The state of a container written by the store (its last exit, its task deleted)
164
+ */
165
+ type StoredState = {
166
+ startedAt?: string;
167
+ finishedAt?: string;
168
+ exitCode?: number;
169
+ };
170
+ /**
171
+ * The resolv.conf of a container: the one of the host, without its local name servers on its own network (the ones of
172
+ * Google when it has no other one, as Docker does)
173
+ * @param content
174
+ * @param ownNetwork
175
+ */
176
+ export declare function resolvConf(content: string, ownNetwork: boolean): string;
177
+ /**
178
+ * An error of the runtime refusing the profile of seccomp of a container (a runc built without seccomp), with what to do
179
+ * @param error
180
+ */
181
+ export declare function seccompHint(error: unknown): unknown;
182
+ /**
183
+ * The resources of a container used (its cgroup, its interfaces of network)
184
+ */
185
+ export type ContainerResourceStats = {
186
+ read: Date;
187
+ pids: {
188
+ current: number;
189
+ limit: number;
190
+ };
191
+ cpu: {
192
+ /**
193
+ * Its time on the CPUs in nanoseconds, in the user mode and in the kernel mode
194
+ */
195
+ usage: number;
196
+ user: number;
197
+ system: number;
198
+ throttledPeriods: number;
199
+ throttledTime: number;
200
+ onlineCpus: number;
201
+ /**
202
+ * Its use of the CPUs during the interval of the sampling (100 is one CPU used all the time)
203
+ */
204
+ percent: number;
205
+ };
206
+ memory: {
207
+ usage: number;
208
+ /**
209
+ * Its usage without the cache which can be freed (the one of docker stats)
210
+ */
211
+ workingSet: number;
212
+ limit: number;
213
+ cache: number;
214
+ swap: number;
215
+ oomKills: number;
216
+ };
217
+ blkio: {
218
+ readBytes: number;
219
+ writeBytes: number;
220
+ readOps: number;
221
+ writeOps: number;
222
+ };
223
+ networks: Record<string, {
224
+ rxBytes: number;
225
+ rxPackets: number;
226
+ rxErrors: number;
227
+ rxDropped: number;
228
+ txBytes: number;
229
+ txPackets: number;
230
+ txErrors: number;
231
+ txDropped: number;
232
+ }>;
233
+ };
234
+ /**
235
+ * A terminal of a process executed in a container: its input, its output, its size, its exit
236
+ */
237
+ export type ContainerTerminal = {
238
+ execId: string;
239
+ input: NodeJS.WritableStream & {
240
+ end(): unknown;
241
+ };
242
+ output: Readable;
243
+ resize(cols: number, rows: number): Promise<void>;
244
+ exited: Promise<number>;
245
+ close(): Promise<void>;
246
+ };
247
+ /**
248
+ * The resources of a running container updated
249
+ */
250
+ export type ContainerResourceUpdate = {
251
+ memory?: number;
252
+ memorySwap?: number;
253
+ cpus?: number;
254
+ cpuShares?: number;
255
+ cpuset?: string;
256
+ pidsLimit?: number;
257
+ oomKillDisable?: boolean;
258
+ restart?: RestartPolicy | '';
259
+ };
260
+ /**
261
+ * The number of a signal (SIGTERM, TERM, 15)
262
+ * @param signal
263
+ */
264
+ export declare function signalNumber(signal: string | number): number;
265
+ /**
266
+ * Whether the kernel limits the swap of the cgroups (Docker discards the swap limits otherwise): the files of the swap
267
+ * limits, in the cgroups below the root on cgroup v2 (the root has none)
268
+ */
269
+ export declare function isSwapLimitSupported(): boolean;
270
+ /**
271
+ * The swap limit of a container (its memory and its swap together), as Docker and nerdctl give it: twice its memory
272
+ * limit by default, -1 unlimited; none without a memory limit, or when the kernel does not limit the swap
273
+ * @param memory
274
+ * @param memorySwap
275
+ */
276
+ export declare function swapLimit(memory: number | undefined, memorySwap: number | undefined): number | undefined;
277
+ /**
278
+ * The containers of containerd: created from the images (their specifications of OCI, their snapshots), their tasks
279
+ * started, stopped, executed in; their logs written by the shims of containerd (file://), kept by the restart monitor
280
+ * of containerd as their restart policies ask
281
+ */
282
+ export declare class ContainerStore {
283
+ protected readonly client: ContainerdClient;
284
+ protected readonly images: ImageStore;
285
+ protected readonly networks: NetworkStore;
286
+ readonly options: ContainerStoreOptions;
287
+ readonly volumes: VolumeStore;
288
+ constructor(client: ContainerdClient, images: ImageStore, networks: NetworkStore, options: ContainerStoreOptions, volumes?: VolumeStore);
289
+ /**
290
+ * The names of the volumes of a container
291
+ * @param container
292
+ */
293
+ static Volumes(container: Message): string[];
294
+ /**
295
+ * The networks of CNI of a container
296
+ * @param network
297
+ * @protected
298
+ */
299
+ protected cniNetworks(network: ContainerCreateOptions['network']): Promise<{
300
+ network: CNINetwork;
301
+ ip?: string;
302
+ ipv6?: string;
303
+ }[]>;
304
+ /**
305
+ * The profile of seccomp of a container, as nerdctl gives it: none for the privileged ones, unconfined ones and when
306
+ * the kernel does not filter the system calls; the default one by its capabilities; the one of a file
307
+ * @param options
308
+ * @protected
309
+ */
310
+ protected seccomp(options: ContainerCreateOptions): Promise<SeccompProfile | undefined>;
311
+ /**
312
+ * The interfaces of a container on its networks of CNI (their addresses while it runs)
313
+ * @param container
314
+ */
315
+ interfaces(container: Message): Promise<ContainerNetworkInterface[]>;
316
+ /**
317
+ * The directory of the state of a container
318
+ * @param id
319
+ */
320
+ stateDir(id: string): string;
321
+ /**
322
+ * The file of the logs of a container
323
+ * @param id
324
+ */
325
+ logFile(id: string): string;
326
+ /**
327
+ * The state written of a container
328
+ * @param id
329
+ */
330
+ protected readState(id: string): Promise<StoredState>;
331
+ protected writeState(id: string, state: StoredState): Promise<void>;
332
+ /**
333
+ * The settings a container was created with by the component (its update creates it again with them)
334
+ * @param id
335
+ */
336
+ readSettings<T = Record<string, any>>(id: string): Promise<T | undefined>;
337
+ writeSettings(id: string, settings: object): Promise<void>;
338
+ /**
339
+ * Name a container again (its label of nerdctl)
340
+ * @param container
341
+ * @param name
342
+ */
343
+ rename(container: Message, name: string): Promise<void>;
344
+ /**
345
+ * Find a container: by its identifier, by its name, by a prefix of its identifier (only one)
346
+ * @param idOrName
347
+ */
348
+ find(idOrName: string): Promise<Message | undefined>;
349
+ /**
350
+ * The containers
351
+ * @param filters the filters of containerd (labels."app"==web)
352
+ */
353
+ list(filters?: string[]): Promise<Message[]>;
354
+ /**
355
+ * The devices of a host path (a device, or the ones of a directory)
356
+ * @param mapping
357
+ */
358
+ protected devices(mapping: ContainerDeviceMapping): Promise<SpecDevice[]>;
359
+ /**
360
+ * A device of the host, by the stats of its node (its major and minor numbers of its rdev, as glibc splits it)
361
+ * @param hostPath
362
+ * @param containerPath
363
+ * @param stats
364
+ * @param permissions
365
+ */
366
+ protected static Device(hostPath: string, containerPath: string, stats: BigIntStats, permissions: string): SpecDevice;
367
+ /**
368
+ * The devices of the host given to a privileged container, as containerd's WithHostDevices gives them: the
369
+ * character and block devices of /dev and of its subdirectories, without the links, the console and the directories
370
+ * of the pseudo terminals, the shared memory, the descriptors and the queues
371
+ * @param directory
372
+ */
373
+ protected hostDevices(directory?: string): Promise<SpecDevice[]>;
374
+ /**
375
+ * The arguments of the process of a container: its entrypoint and its command, as Docker composes them
376
+ * @param resolved
377
+ * @param options
378
+ */
379
+ protected args(resolved: ResolvedImage, options: ContainerCreateOptions): string[];
380
+ /**
381
+ * Create a container of an image: its snapshot (its root file system, the image unpacked), its specification, its
382
+ * state directory (its hosts, resolv.conf, hostname, logs)
383
+ * @param options
384
+ */
385
+ create(options: ContainerCreateOptions): Promise<Message>;
386
+ /**
387
+ * The state of a container: the one of its task, its last exit when it has none
388
+ * @param container
389
+ */
390
+ state(container: Message): Promise<ContainerRuntimeState>;
391
+ /**
392
+ * Rotate the logs of a container once they are larger than the size of the options: copied to the file .1, the
393
+ * file truncated (the shim writes to its end)
394
+ * @param id
395
+ */
396
+ rotateLogs(id: string): Promise<void>;
397
+ /**
398
+ * Delete the task of a container (stopped), its exit kept
399
+ * @param id
400
+ */
401
+ protected deleteTask(id: string): Promise<void>;
402
+ /**
403
+ * Set the labels of a container
404
+ * @param container
405
+ * @param labels
406
+ */
407
+ protected label(container: Message, labels: Record<string, string>): Promise<void>;
408
+ /**
409
+ * Start a container: a new task of its snapshot (the one of its previous run deleted), its output written to its
410
+ * logs
411
+ * @param container
412
+ */
413
+ start(container: Message): Promise<number>;
414
+ /**
415
+ * Wait for the task of a container to exit, at most a time
416
+ * @param id
417
+ * @param timeout milliseconds
418
+ */
419
+ protected waitExit(id: string, timeout: number): Promise<boolean>;
420
+ /**
421
+ * Stop a container: its stop signal (SIGTERM, the one of its image) sent, then SIGKILL to all its processes after a
422
+ * time; its task deleted, its restart monitor told not to restart it
423
+ * @param container
424
+ * @param options
425
+ */
426
+ stop(container: Message, options?: {
427
+ timeout?: number;
428
+ signal?: string | number;
429
+ }): Promise<void>;
430
+ /**
431
+ * Send a signal to a container (its main process, or all its processes)
432
+ * @param container
433
+ * @param signal
434
+ * @param all
435
+ */
436
+ kill(container: Message, signal?: string | number, all?: boolean): Promise<void>;
437
+ pause(container: Message): Promise<void>;
438
+ resume(container: Message): Promise<void>;
439
+ /**
440
+ * Check that a container has a task which did not exit (the shim refuses to pause or resume a stopped one with an
441
+ * error of no code)
442
+ * @param container
443
+ * @protected
444
+ */
445
+ protected running(container: Message): Promise<void>;
446
+ /**
447
+ * The processes of a running container (their identifiers on the host)
448
+ * @param container
449
+ */
450
+ processes(container: Message): Promise<number[]>;
451
+ /**
452
+ * Wait for the main process of a container to exit: its exit code; the last one at once when it has no task (never
453
+ * started: 0, stopped: its task deleted, its exit kept by the store)
454
+ * @param container
455
+ * @param signal
456
+ */
457
+ wait(container: Message, signal?: AbortSignal): Promise<number>;
458
+ /**
459
+ * The error of an operation on the task of a container: the container is not running when it has no task (or its
460
+ * process exited)
461
+ * @param container
462
+ * @param error
463
+ * @protected
464
+ */
465
+ protected taskError(container: Message, error: unknown): unknown;
466
+ /**
467
+ * Remove a container: its task (a running one only when forced), its snapshot, its state directory
468
+ * @param container
469
+ * @param force
470
+ */
471
+ remove(container: Message, force?: boolean): Promise<void>;
472
+ /**
473
+ * Execute a command in a running container, its output captured: its standard output and its error apart (FIFOs,
474
+ * mkfifo of the system), or together in its standard output without mkfifo (the files of the shim)
475
+ * @param container
476
+ * @param options
477
+ */
478
+ exec(container: Message, options: {
479
+ cmd: string[];
480
+ env?: Record<string, string>;
481
+ workingDir?: string;
482
+ user?: string;
483
+ stdin?: string | Buffer;
484
+ timeout?: number;
485
+ }): Promise<ExecResult>;
486
+ /**
487
+ * The logs of a container: its last lines, followed while it runs (until the signal aborts)
488
+ * @param container
489
+ * @param options
490
+ */
491
+ logs(container: Message, options?: {
492
+ tail?: number;
493
+ follow?: boolean;
494
+ signal?: AbortSignal;
495
+ }): Readable;
496
+ /**
497
+ * A sample of the resources a running container uses
498
+ * @param container
499
+ * @protected
500
+ */
501
+ protected sample(container: Message): Promise<Omit<ContainerResourceStats, 'cpu'> & {
502
+ cpu: Omit<ContainerResourceStats['cpu'], 'percent'>;
503
+ }>;
504
+ /**
505
+ * The resources a running container uses: two samples, its use of the CPUs between them
506
+ * @param container
507
+ * @param interval milliseconds between the samples
508
+ */
509
+ stats(container: Message, interval?: number): Promise<ContainerResourceStats>;
510
+ /**
511
+ * Open a terminal in a running container: a process executed with its pseudo terminal, its input and its output by
512
+ * FIFOs (mkfifo of the system)
513
+ * @param container
514
+ * @param options
515
+ */
516
+ terminal(container: Message, options: {
517
+ cmd: string[];
518
+ cols?: number;
519
+ rows?: number;
520
+ env?: Record<string, string>;
521
+ workingDir?: string;
522
+ user?: string;
523
+ }): Promise<ContainerTerminal>;
524
+ /**
525
+ * Update the resources of a container (its specification, the cgroup of its running task) and its restart policy,
526
+ * without restarting it (docker update)
527
+ * @param container
528
+ * @param update
529
+ */
530
+ updateResources(container: Message, update: ContainerResourceUpdate): Promise<void>;
531
+ /**
532
+ * Commit a container: the changes of its file system as a layer on its image, a new image (its container paused
533
+ * meanwhile when it runs, by default)
534
+ * @param container
535
+ * @param options
536
+ */
537
+ commit(container: Message, options: {
538
+ name: string;
539
+ pause?: boolean;
540
+ changes?: ImageConfigChanges;
541
+ comment?: string;
542
+ author?: string;
543
+ }): Promise<string>;
544
+ /**
545
+ * Archive a path of the file system of a container (tar): the one of its running process (its mounts with it), or
546
+ * the one of its snapshot when it is not running; its symbolic links resolved in it
547
+ * @param container
548
+ * @param file an absolute path in the container
549
+ * @param destination
550
+ */
551
+ archive(container: Message, file: string, destination: NodeJS.WritableStream): Promise<void>;
552
+ /**
553
+ * The name of a container
554
+ * @param container
555
+ */
556
+ static Name(container: Message): string;
557
+ }
558
+ export {};