Closed etsyamitra closed 6 months ago
@chensun Hello Chen, would you like to help looking at this issue? Thank you!
cc @lynnmatrix
Do it make sens to add it to the entrypoint if you want to change it for different use cases? Could you drop the entrypoint and instead incoporate it as part of the command @etsyamitra ?
That would be ideal, however it seems like it's not parameterized at the moment. could you please clarify how could we provide the entrypoint as a part of the command?
kfp local runner is contributed by a community contributor, and is supported as an Alpha feature. Feel free to send PRs for feature requests like this.
parameterized
TheENTRYPOINT
specifies a command that will always be executed when the container starts while the CMD
specifies arguments that will be fed to the ENTRYPOINT(if left empty the default entrypoint for docker /bin/sh -c
will be used. ) Thus could you skip the ENTRYPOINT
in your use cases and rely on the CMD
to include the differences in terms of ENTRYPOINT
?
An example pipelines would be:
import kfp.components as comp
from kfp import LocalClient, run_pipeline_func_locally
# Create a simple component using only bash commands. The output of this component
# can be passed to a downstream component that accepts an input with the same type.
create_step_write_lines = comp.load_component_from_text("""
name: write_lines
description: Writes text to a file.
inputs:
- {name: text, type: String}
outputs:
- {name: data, type: Data}
implementation:
container:
image: busybox
command:
- sh
- -c
- |
mkdir -p "$(dirname "$1")"
echo "$0" > "$1"
args:
- {inputValue: text}
- {outputPath: data}
""")
def pipeline():
write_lines_step = create_step_write_lines(
text='one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\nten')
if __name__ == "__main__":
out = run_pipeline_func_locally(
pipeline,
{},
execution_mode=LocalClient.ExecutionMode("docker"),
)
print(out.get_output_file("write-lines"))
where you could change the command to account for different entrypoints
to the container, https://www.kubeflow.org/docs/components/pipelines/reference/component-spec/#implementation. Maybe you could give an example on how you like to use this feature @etsyamitra. I would be happy to work on the implementation when I understand the use case better.
Does this solve your problem @etsyamitra otherwise please add an example so I better understand what you like to achieve.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing this issue. No activity for more than a year.
/close
@rimolive: Closing this issue.
Feature Area
kfp local runner through docker exec environment
What feature would you like to see?
Being able to set docker --entrypoint which running the component.
What is the use case or pain point?
Removing the inconsistencies between running through docker and kfp locally with more powerful features. Creating different images just for having separate entrypoint seems like too much overhead, it would be ideal to pass the entrypoint to the docker itself for each component.
Is there a workaround currently?
Bake it into the image
Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.