backend.ai icon indicating copy to clipboard operation
backend.ai copied to clipboard

Commit running session and push image to dedicated registry

Open kyujin-cho opened this issue 1 year ago • 0 comments

Let's create a new API to automatically commit running session and publish built artifact to designated docker registry.
Rules:

  • Container must be paused during the commit process. Technically it is not impossible to commit active container - but this will cause lots of integrity problems.
  • To remove complexity, committing & publishing can be only initiated from a single container session.
  • During the execution, both target session and its child (the actual kernel) should fell into a new COMMITTING status.
  • After every procedures are completed (even if there is an error on either processes) we need to roll back committed session to stable RUNNING state.
  • User should be able to publish committed container only to non-global container registry.
  • Before making an RPC call to the agent to perform commit & push, the manager should check the availability of the target container registry (e.g., permissions, quota, etc.) first to report the expected failure earlier.
  • Every progress should be reported to API caller. For this objective we can utilize our bgtask library.
  • (Optional) Update user/project_resource_policy to limit maximum container size possible to publish. Querying size of files in a container can be possible by looking up SizeRw value of container info (API Reference).

kyujin-cho avatar Feb 15 '24 11:02 kyujin-cho