PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Add support for submitting a prebuilt image

Open kiendang opened this issue 1 year ago • 2 comments

  • [x] Rename submit_dockerfile to submit_container_image.
  • [x] submit_container_image now accepts a docker_config of a more generic WorkerConfig type which could be DockerWorkerConfig or PrebuiltWorkerConfig
  • [x] Add unit tests

Works with (modified) notebook 11. Only need to

  • [ ] Add integration test

kiendang avatar May 13 '24 07:05 kiendang

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

We might also have to generalize the get_by_docker_config stash method to get both Prebuilt and DockerConfig

shubham3121 avatar May 14 '24 06:05 shubham3121

@yashgorana @shubham3121 keep getting TimeOut exception running test_pool_launch with a prebuilt image even though I used a tiny image and increased timeout to 3 mins

https://github.com/OpenMined/PySyft/blob/33aef2718f9e430aaf98f91ce3f64489bc90b60a/packages/syft/src/syft/custom_worker/runner_k8s.py#L48-L62

This just raised a TimeOut error with no other information. Do you know what might caused it or how to find out more?

kiendang avatar May 20 '24 09:05 kiendang

Ok I think I might know what the problem is. I think it's because we set the registry to the local k3d registry so k8s wouldn't be able to pull from docker.io.

kiendang avatar May 20 '24 16:05 kiendang

~hmm after looking into the k8s json file generation I don't think that's the issue.~

I think it might be lol.

kiendang avatar May 21 '24 03:05 kiendang

Nice catch @kiendang . Your right its the registry. What we need to do is create a image registry object during submission of pre built config file and indicate the same registry during image pull. I think you're correct that its using k3d registry by default dueing worker spawn

shubham3121 avatar May 21 '24 03:05 shubham3121

@yashgorana @shubham3121 May I use this opportunity to correct some inconsistencies in arg names of various API endpoints?

  • worker_image_service.push(image: UID =) where everywhere else uses image_uid
  • worker_image_service.build(pull: bool =), worker_pool_service.create_image_and_pool_request(pull_image: bool =)
  • worker_pool_service.launch(name: str = ) where everywhere else uses pool_name
  • reg in reg_username and reg_password is very ambiguous. We should change to registry_username and registry_password. They're not much longer and we already use registry_uid.

kiendang avatar May 22 '24 05:05 kiendang

We also use tag in a lot of places where it should be image name instead. python:3-slim is not the image tag, it's the image name. 3-slim is the tag.

kiendang avatar May 22 '24 05:05 kiendang

We also use tag in a lot of places where it should be image name instead. python:3-slim is not the image tag, it's the image name. 3-slim is the tag.

Yes although, a tag by itself and an image by itself arent really useful, we can extract the image and repo from the tag, but not the other way around.

I would call this image_tag or something where image and tag are mandatory but but repo is optional.

madhavajay avatar May 23 '24 01:05 madhavajay

@yashgorana @shubham3121 May I use this opportunity to correct some inconsistencies in arg names of various API endpoints?

* `worker_image_service.push(image: UID =)` where everywhere else uses `image_uid`

* `worker_image_service.build(pull: bool =)`, `worker_pool_service.create_image_and_pool_request(pull_image: bool =)`

* `worker_pool_service.launch(name: str = )` where everywhere else uses `pool_name`

* `reg` in `reg_username` and `reg_password` is very ambiguous. We should change to `registry_username` and `registry_password`. They're not much longer and we already use `registry_uid`.

Will put these in a separate PR.

kiendang avatar May 24 '24 05:05 kiendang