backend.ai
backend.ai copied to clipboard
Commit running session and push image to dedicated registry
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 upSizeRw
value of container info (API Reference).