-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add runtime graph to image label (#815)
* feat: add proposal for runtime graph image label Signed-off-by: nullday <aseaday@hotmail.com> * docs: Add running context Signed-off-by: nullday <aseaday@hotmail.com> * Add design details for proposal Signed-off-by: nullday <aseaday@hotmail.com> * Add implementation Signed-off-by: nullday <aseaday@hotmail.com> * Fix lint Signed-off-by: nullday <aseaday@hotmail.com> * Fix proposal Signed-off-by: nullday <aseaday@hotmail.com> * Refact the method name of dump and load Signed-off-by: nullday <aseaday@hotmail.com> * Move msgpack to json Signed-off-by: nullday <aseaday@hotmail.com> * Remove msgpack in proposal Signed-off-by: nullday <aseaday@hotmail.com> * Fix go.mod and go.sum Signed-off-by: nullday <aseaday@hotmail.com> Signed-off-by: nullday <aseaday@hotmail.com>
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
docs/proposals/20220826-image-runtime-redistributed-metadata.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Add Runtime Configuration to Image for Envd Image Redistribution | ||
Authors: | ||
- [nullday](https://github.com/aseaday) | ||
|
||
## Summary | ||
|
||
The `envd` would add (runing graph metadata)[https://github.com/tensorchord/envd/blob/630ada172bdf876c3b749329fdbe284c108051f2/pkg/lang/ir/types.go#L70] would be encoded into a ASCII string and added to be image(OCI Spec) as a config. | ||
|
||
we named the above mentioned encoded config `Envd Runtime Graph Label` | ||
|
||
## Motivation | ||
|
||
This proposal is part of effort to define what the artifact `envd` delivery and decoupling the phases of build and runing. It will be friendly for running a envd environment even at the absence of `build.env`. | ||
|
||
the concept of `running context` is a also needed as addition of `build contxt` for example: | ||
|
||
- An engineer build a easy-to-use env for his/her interns for the quick use of company tools. | ||
- Kubernetes remote runtime support in the future. | ||
|
||
## Goals | ||
- Provide internal API: | ||
- read runtime metadata | ||
- write runtime metadata | ||
- `up` and `run` command doesn't need to interpret the `build.env`. `run` command can run a built env image with attachment of current working directory as `running context`. | ||
|
||
## Implementations | ||
|
||
There are two parts of runtime configuration that can be used in envd. | ||
- OCI sepecifications specific: | ||
- ExposedPort | ||
- Entrypoint | ||
- Env | ||
- Cmd | ||
- Custome Labels | ||
|
||
For some parts of runtime configuration, we could use the OCI part such as environment variables. We still need to deal with extra parts such as port bindings which not covered by the OCI spec. | ||
|
||
```golang | ||
type RuntimeGraph struct { | ||
RuntimeCommands map[string]string | ||
RuntimeDaemon [][]string | ||
RuntimeEnviron map[string]string | ||
RuntimeExpose []ExposeItem | ||
} | ||
``` | ||
|
||
- *RuntimeEnviron* is completely in accordance with the OCI defined configuration `Env`. So we don't need to add it to the runtime label. | ||
- *RuntimeDaemon* and *RuntimeExpose* will be added to the runtime label and we also should update the config the OCI configuration's Entrypoint and ExposedPort accordingly. | ||
|
||
we use the following labels: | ||
|
||
- ai.tensorchord.envd.runtimeGraph.version | ||
- ai.tensorchord.envd.runtimeGraph.Daemon | ||
- ai.tensorchord.envd.runtimeGraph.Expose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters