envd
envd copied to clipboard
feat: inherit the runtime graph if the base image was built from envd
Description
We support the custome image now:
def build():
base(language="python", image="python:3.9-slim")
And if the user's envd manifest has a custom base image built from envd such as:
def build():
base(language="python", image="a-company-machine-inf-team-custom-image:latest")
And the base image's envd files may had some runtime configurations as followings:
runtime.command(commands={
"test": "ls /",
})
runtime.environ(env={"ENVD_MODE": "DEV"})
We should support inheritance so that the new container could has these runtime functions automatically. It is related to https://github.com/tensorchord/envd/pull/815 and if this feature prposal was approved by community. I will add this function to #815
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
@kemingy @VoVAllen @zwpaper WDYT?
It seems great to me!
I have some questions, maybe we can discuss or explain them in docs
- https://github.com/tensorchord/envd/pull/815/files proposed
RuntimeCommandsis not saved, if this feature goes, maybeRuntimeCommandsshould also be saved? - should we add an option to disable(or enable) this inherit?
- when inheriting, how would we overwrite if new components(RuntimeCommands, Envs, etc.) written in the new build.envd by users?
Thanks for the proposal! Sounds good to me. Also do you have any specific scenarios for this? So that we can understand the pro/cons when implement it.
It seems great to me!
I have some questions, maybe we can discuss or explain them in docs
- https://github.com/tensorchord/envd/pull/815/files proposed
RuntimeCommandsis not saved, if this feature goes, maybeRuntimeCommandsshould also be saved?- should we add an option to disable(or enable) this inherit?
- when inheriting, how would we overwrite if new components(RuntimeCommands, Envs, etc.) written in the new build.envd by users?
- It was becuase I misunderstood the meaning of
runtime.command, I deleted it now. - I think we should had a option in
basefunction to turn it on/off. - It is the real question I cared about because I was also confused about that in fact all
runtime.xxxfunctions had no overwrite feature. We can treatbaseinheritance as a function contains someruntimeand how to overwrite is decided by theruntime.xxx's overwrite deisgn.
A specific scenarios is as the follows: User Alice is a team member who build a base image for the others especially new commers. He hope the containers could do some followings things automatically:
- update training data to the latest version.
runtime.command("dvc sync") - start the tensorboard and listen on a fixed port.
runtime.exposeandruntime.daemon
Alice don't want the others users include which means it need to rebuild again. Alice want the base could inherit the runtime feature from parent image directly.
@VoVAllen
I see what you mean. And I realized this can also be a way if users want explicit dependency control. Currently, apt install and pip package install happen in parallel, all on base images. If user want explicit dependency such as python depends on apt packages, your proposal can be a solution