-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourceOp to support pvolumes #1345
Comments
Hello Ryan, I will first answer to the main question of this issue. I believe what you mean is to create a resource, and make that resource mount some volumes. I don't have much experience with I guess I'll need more context, but what would you say if there was a These thoughts have also been expressed by @jlewi and @hongye-sun A This issue could actually be the design document of this subclass, and your feedback using it can help us a lot. |
/assign @elikatsis |
ResourceOp is different from ContainerOp. It starts with a "launcher" pod which calls k8s API to create another custom resource like TFJob. When you add a pvolumes to ResourceOp, usually you mean adding a volume to the custom resource but not the "launcher". The PipelineVolume derives from k8s volume, so you can directly use it in your code when building k8s custom resource. For example, you can build a pod spec for a TFJob: pod_spec = V1PodSpec(...,
volumes=[vop.volume],
containers=[V1Container(...,
volume_mounts=[V1VolumeMount(name=vop.volume.name, mount_path='...')]
)
tf_job = TFJob(worker=V1PodTemplate(spec=pod_spec))
tf_job_op = ResourceOp(k8s_resource=tf_job, ...) |
I probably shouldn't have used TFJob as my example in this issue. I do want to be able to mount volumes to a TFJob but I intended to cover that with #1344. A TFJobOp seems to me a good way to address that concern. What I had in mind when raising particular issue was other types of resource, though the only concrete example I have immediately is a vanilla kubernetes Job. I am not sure whether there is a way to create Jobs other than ResourceOp (CreateJobOp looks related but I think that might be CMLE-specific). I should also clarify that I am able to add a volume to the resource that is created by the ResourceOp. But that alone doesn't give me a way to say that the resource step should come after some other volume-related step. |
Yes, that's my opinion as well. A What you could do is to use the
(TODO: I will modify |
Thanks @elikatsis ! Adding .after does indeed do what I need for this case. I agree about JobOp not being necessary. If I really need to create a plain Job rather than use a ContainerOp (and I'm not sure I do) then I can use ResourceOp and if the Job has dependencies I can use .after (thanks again!). I share the sense that a TFJobOp would be useful, if for no other reason then because it would be more intuitive than creating TFJobs through ContainerOps or ResourceOps. |
That's nice, you are welcome! |
Yep, cool |
ResourceOp currently doesn't have a way to depend upon a volume. If I try to add pvolumes I get
got an unexpected keyword argument 'pvolumes'
The ResourceOp supports creating a resource or even deploying a Custom Resource such as a TFJob (just using TFJob for illustration here - it's really other kinds of training jobs I'd like to use this for). But what I don't see a way to do right now is make sure the custom resource depends on a volume created or modified in a previous step.
I don't think the modification needed here would have to do anything to mount a volume. The resource definition itself could do that. It would just need to force the step to depend on the one that created or modified the volume. Another approach might be support the dependency through
inputs
but that isn't presently available either.@elikatsis , @vkoukis - any thoughts on this?
The text was updated successfully, but these errors were encountered: