Summary
The user wants to create a Flyte workflow triggered by parameters from a Kubernetes job but faces challenges due to the lack of a local Docker daemon in their Kubernetes cluster. They previously used Kaniko for Docker builds but are unsure about its integration with Flyte or Flytekit. The user is exploring the option of allowing Kaniko to build the image while Flyte consumes it and is interested in using multiple images in a workflow. They also inquire about the availability of a Python library client equivalent to the pyflyte run
command.
yuan.wang
I saw that we can use <https://docs.flyte.org/en/latest/user_guide/customizing_dependencies/multiple_images_in_a_workflow.html|multiple images in workflow>. This looks a good option to me. Does flyte provide any python library client which is equivalent to the pyflyte run
command?
pyflyte run --remote --image mindmeld="<http://ghcr.io/flyteorg/flytecookbook:core-latest|ghcr.io/flyteorg/flytecookbook:core-latest>" --image borebuster="<http://ghcr.io/flyteorg/flytekit:py3.9-latest|ghcr.io/flyteorg/flytekit:py3.9-latest>" multi_images.py multi_images_wf
david.espejo
I'm thinking what if you don't use ImageSpec? I mean, if you let Kaniko build the image and Flyte just consumes it
yuan.wang
Thanks, <@U04H6UUE78B>.
According to the <https://docs.flyte.org/en/latest/user_guide/customizing_dependencies/imagespec.html|ImageSpec document>, it seems that flyte uses clients like flytectl
or pyflyte
to build the docker images defined in the ImageSpec in the local environment where the flyte client is executed. And this local environment requires docker daemon.
In our scenario, we would like to do an integration between flyte and our application. Our application is running on a k8s cluster, and we want our users to upload the python files that contain flyte imagespec, tasks, and workflows to our application, and we use a k8s job to call flyte client to build docker images and create flyte workflow. K8s cluster normally does not have docker daemon installed, so it does not fulfill the requirement of flytectl
or pyflyte
. So do you have any recommendation on this kind of integration?
david.espejo
If Kaniko builds an OCI-compliant image, Flyte should be able to use it
david.espejo
I think <@U07BYBQDZBK> has worked on a https://github.com/krishnaps7/flytekit/tree/feature/krishnaps7/k8s-job/plugins/flytekit-k8s-job/flytekitplugins/job|plugin to integrate K8s Jobs
yuan.wang
Hi, we would like to create flyte workflow from a k8s job, and later trigger the workflow with some parameters from another k8s job. Based on the ImageSpec document, it seems that the image build and push is done by flytekit on the local environment, which requires docker daemon. By default, there is no docker daemon running in my k8s cluster nodes. We used to use kaniko for docker build and push in the cluster, but I think it is not integrated with flyte or flytekit directly. What would be your recommendation for this scenario? How to build flyte workflow from a k8s cluster?