You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
area/APIAPI objects and controllerskind/featureWell-understood/specified features, ready for coding.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.triage/needs-user-inputIssues which are waiting on a response from the reporter
KFServing would like to enable data scientists to refer to ML models in a consistent way across ML Inference Hosts (like TFServing and TensorRT) without requiring the build of a derived container.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh by adding the comment /remove-lifecycle stale.
Stale issues rot after an additional 30 days of inactivity and eventually close.
If this issue is safe to close now please do so by adding the comment /close.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh by adding the comment /remove-lifecycle stale.
Stale issues rot after an additional 30 days of inactivity and eventually close.
If this issue is safe to close now please do so by adding the comment /close.
Would be good to have PVCs or any similar possibility to access models/files. Building derived containers seems very cumbersome.
Any feedback if you're working on it?
The most related thing in-flight is support for multiple spec.template.spec.containers, but I see spec.template.spec.initContainers, and expanded volume support as related (e.g. as a medium for passing data between containers). (cc @savitaashture@markusthoemmes )
I think at this point it is mostly a question of bandwidth. I know @JRBANCEL mentioned this on our call Weds, so maybe he is interested in tackling volumes next?
We’d like to chip in here - this is one of the features that we'd love to see in knative at some point.
In the context of ML inference servers having support for init containers would make a lot of sense. Following comment of @evankanderson from stackoverflow.com
Knative deliberately excludes init containers right now because they can induce large (unbounded) amounts of additional latency during cold-start.
If we assume that the workaround is to do the init container’s job on the main container startup (download the model) rather than in the init containers this does not change anything - it is the same download that needs to occur before microservice can serve inference requests.
If kservices would support init containers, however, then after kservice scaled to zero and back to positive number of replicas no download would be required as the same PVC with already downloaded model would be mounted saving us from unnecessary download.
Another argument is that separating this logic out of the main container allows to easier use of specialised microservices.
I agree with the above. init containers don't violate the "statelessness" of a service and I guess the tradeoff with cold start latency is quite obvious. +1 on supporting it.
Another use case we could see here is to enable debugging via dev orchestrators like Skaffold. Skaffold automatically configures debugging for you by transforming a k8s manifest to add an initContainer with debug dependencies, volume mounts the debug dependencies onto the main container, and also modifies the start command and adds a debug port. Since knative does not support volume mounts or initContainers, this doesn't work, but if this feature were enabled, it would be another use case in addition to the one mentioned above.
This is also another use case for supporting multiple ports (see other issue): #8471
Here's a related issue that folks opened on the skaffold repo which suggests other folks may be interested in skaffold debug + knative: GoogleContainerTools/skaffold#4702
1. For the model downloading use case - re-posting my comments from: #4417 (comment)
I'm not really convinced downloading models (via an initContainer) into an emptyDir really makes a lot of sense. It seems really inefficient and you're not benefiting from any caching. Any additional pods that are scaled up (even on the same node) will always download the model? Maybe the better pattern is to bundle them in an OCI image and access them as a sidecar. Then subsequent starts would be much faster since these model images will be cached by Kubernetes
1.1 Downloading models into a PVC
@RafalSkolasinski Is it possible to setup a PVC prior to creating the Knative Service? Then you'd declare the PVC read-only. If not why?
2. For sourcing/injecting secrets on startup
This seems like a practical use case of initContainers - your workloads need a secret/identity on demand. There's external tooling to help fetch said secret.
3. Debugging Containers
@lisamburns curious if skaffold can support debugging via sidecars - since we do support multiple containers. I'd imagine this would then enable debugging in the future using k8s ephemeral containers
I also have a use case for this which is binding config/secrets at runtime that could ideally be handled with an init container and a shared emptyDir volume. I can add the feature flags for these if this is agreed upon. I've done a few times for other settings.
@dprotaso I'm a skaffold user, not a contributor, but that's a good question. I'm not sure if the below discussion is off-topic for this github issue. Tldr I think there is still a valid use case for volume mounts/initContainers for the debug use case.
I think what you're suggesting is a different approach but let me attempt to clarify.
Skaffold approach (requires volume mounts and initContainers)
They are rewriting the start command to be "dlv exec /app", and the web container gets delv because an initContainer mounts it into a shared dir (i.e emptyDir).
Your suggestion? - ephemeral containers and sidecars instead of skaffold
You could debug a knative service with an ephemeral container sidecar, without the need for knative to support initContainers or volume mounts. The sidecar could run "dlv attach pid-of-server", assuming sidecar has delv installed and process namespace sharing. Out of curiosity I tried this but it errors unless I add capabilities (sys_ptrace). The same does not seem to be true of launching the app with dlv to begin with ..."dlv exec /app", but I don't how that would work with the sidecar approach. Ephemeral containers don't have their own securityContext, either. Let me know if I am reading your suggestion correctly or not though.
Hey folks so @skonto added some init container support behind a feature flag.
From the review one topic one topic that I felt required further discussion is the use of ports on the init containers. With the feature gate as its there isn't much restriction.
My pov is that init containers are not part of normal app operation. So I thought users should be more flexible (be closer to K8s initi container's allowed spec) and so to use more stuff than normal Service operation allows. For example port names should be arbitrary at this point and communication protocol can be any because people may want to setup their app in some arbitrary way.
I'm posting here to source some feedback on whether folks require the use of ports in their use cases
area/APIAPI objects and controllerskind/featureWell-understood/specified features, ready for coding.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.triage/needs-user-inputIssues which are waiting on a response from the reporter
Activity
rakelkar commentedon Jun 9, 2019
Not sure if area label is correct
rakelkar commentedon Jun 9, 2019
@mattmoor
knative-housekeeping-robot commentedon Dec 23, 2019
Issues go stale after 90 days of inactivity.
Mark the issue as fresh by adding the comment
/remove-lifecycle stale.Stale issues rot after an additional 30 days of inactivity and eventually close.
If this issue is safe to close now please do so by adding the comment
/close.Send feedback to Knative Productivity Slack channel or file an issue in knative/test-infra.
/lifecycle stale
mattmoor commentedon Dec 23, 2019
/remove-lifecycle stale
This also needs a place to put the model, so some volume work would be needed.
cc @savitaashture @markusthoemmes who are looking at multi-container, as I've mentioned these things as related work a few times.
knative-housekeeping-robot commentedon Mar 23, 2020
Issues go stale after 90 days of inactivity.
Mark the issue as fresh by adding the comment
/remove-lifecycle stale.Stale issues rot after an additional 30 days of inactivity and eventually close.
If this issue is safe to close now please do so by adding the comment
/close.Send feedback to Knative Productivity Slack channel or file an issue in knative/test-infra.
/lifecycle stale
mattmoor commentedon Mar 23, 2020
/remove-lifecycle stale
VonRehberg commentedon Apr 2, 2020
Would be good to have PVCs or any similar possibility to access models/files. Building derived containers seems very cumbersome.
Any feedback if you're working on it?
mattmoor commentedon Apr 2, 2020
The most related thing in-flight is support for multiple
spec.template.spec.containers, but I seespec.template.spec.initContainers, and expanded volume support as related (e.g. as a medium for passing data between containers). (cc @savitaashture @markusthoemmes )I think at this point it is mostly a question of bandwidth. I know @JRBANCEL mentioned this on our call Weds, so maybe he is interested in tackling volumes next?
cc @dprotaso
JRBANCEL commentedon Apr 2, 2020
Definitely, as this has been asked quite a bit already. Let's finish the Downward API work first though🚀 .
18 remaining items
evankanderson commentedon Mar 22, 2021
/area API
@dprotaso -- It looks like multi-container did not enable init containers:
serving/pkg/apis/serving/fieldmask.go
Line 197 in 05f16c6
Thought on priority for this request?
/triage needs-user-input
RafalSkolasinski commentedon May 12, 2021
We’d like to chip in here - this is one of the features that we'd love to see in knative at some point.
In the context of ML inference servers having support for init containers would make a lot of sense. Following comment of @evankanderson from stackoverflow.com
If we assume that the workaround is to do the init container’s job on the main container startup (download the model) rather than in the init containers this does not change anything - it is the same download that needs to occur before microservice can serve inference requests.
If kservices would support init containers, however, then after kservice scaled to zero and back to positive number of replicas no download would be required as the same PVC with already downloaded model would be mounted saving us from unnecessary download.
Another argument is that separating this logic out of the main container allows to easier use of specialised microservices.
markusthoemmes commentedon May 12, 2021
I agree with the above. init containers don't violate the "statelessness" of a service and I guess the tradeoff with cold start latency is quite obvious. +1 on supporting it.
lisamburns commentedon Jun 3, 2021
Another use case we could see here is to enable debugging via dev orchestrators like Skaffold. Skaffold automatically configures debugging for you by transforming a k8s manifest to add an initContainer with debug dependencies, volume mounts the debug dependencies onto the main container, and also modifies the start command and adds a debug port. Since knative does not support volume mounts or initContainers, this doesn't work, but if this feature were enabled, it would be another use case in addition to the one mentioned above.
This is also another use case for supporting multiple ports (see other issue): #8471
Here's a related issue that folks opened on the skaffold repo which suggests other folks may be interested in skaffold debug + knative: GoogleContainerTools/skaffold#4702
dprotaso commentedon Jun 14, 2021
1. For the model downloading use case - re-posting my comments from: #4417 (comment)
1.1 Downloading models into a PVC
@RafalSkolasinski Is it possible to setup a PVC prior to creating the Knative Service? Then you'd declare the PVC read-only. If not why?
2. For sourcing/injecting secrets on startup
This seems like a practical use case of
initContainers- your workloads need a secret/identity on demand. There's external tooling to help fetch said secret.3. Debugging Containers
@lisamburns curious if skaffold can support debugging via sidecars - since we do support multiple containers. I'd imagine this would then enable debugging in the future using k8s ephemeral containers
emaildanwilson commentedon Jun 22, 2021
I also have a use case for this which is binding config/secrets at runtime that could ideally be handled with an init container and a shared emptyDir volume. I can add the feature flags for these if this is agreed upon. I've done a few times for other settings.
lisamburns commentedon Jun 29, 2021
@dprotaso I'm a skaffold user, not a contributor, but that's a good question. I'm not sure if the below discussion is off-topic for this github issue. Tldr I think there is still a valid use case for volume mounts/initContainers for the debug use case.
I think what you're suggesting is a different approach but let me attempt to clarify.
Skaffold approach (requires volume mounts and initContainers)
They are rewriting the start command to be "dlv exec /app", and the web container gets delv because an initContainer mounts it into a shared dir (i.e emptyDir).
Your suggestion? - ephemeral containers and sidecars instead of skaffold
You could debug a knative service with an ephemeral container sidecar, without the need for knative to support initContainers or volume mounts. The sidecar could run "dlv attach pid-of-server", assuming sidecar has delv installed and process namespace sharing. Out of curiosity I tried this but it errors unless I add capabilities (sys_ptrace). The same does not seem to be true of launching the app with dlv to begin with ..."dlv exec /app", but I don't how that would work with the sidecar approach. Ephemeral containers don't have their own securityContext, either. Let me know if I am reading your suggestion correctly or not though.
skonto commentedon Sep 10, 2021
Feature track doc here, please feel free to review.
dprotaso commentedon Oct 6, 2021
Hey folks so @skonto added some init container support behind a feature flag.
From the review one topic one topic that I felt required further discussion is the use of
portson the init containers. With the feature gate as its there isn't much restriction.@skonto's comments were
I'm posting here to source some feedback on whether folks require the use of
portsin their use cases