Skip to content
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

Inherit Binary/Command from K8s Pod/Deployment #2245

Open
bradschwartz opened this issue Feb 16, 2024 · 3 comments
Open

Inherit Binary/Command from K8s Pod/Deployment #2245

bradschwartz opened this issue Feb 16, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@bradschwartz
Copy link
Contributor

I'm deploying many deployments with different commands out of a single repository. Specifically using mix with different custom tasks, but this should be applicable to anything really. I don't want to have to remember which command I'm running when I target a specific deployment, as all that information is already in the pod spec. Is there any way to have mirrord automatically run that combined Command + args as my local executable?

I like the current behavior as the default, and this could potentially be a new flag like:

mirrord exec --target deploy/my-task-1 --use-pod-command

Where no binary/args would be provided at the command line. I don't know if it's worthwhile to split it up into two flags to keep command and args separate, or if it should be all or nothing. If they are separated, I'd imagine it would look like:

mirrord exec --target deploy/my-task-1 --use-pod-command --use-pod-args
# or if the args flag isn't passed, allow them to be specified manually
mirrord exec --target deploy/my-task-1 --use-pod-command -- --my-arg-1 a --my-arg-2 b

I'm happy to implement this myself, I'd most likely implement as a new flag that queries the target resource and joins the pod spec command and arg and passes to the current run command, although I haven't looked in detail.

@bradschwartz bradschwartz added the enhancement New feature or request label Feb 16, 2024
@aviramha
Copy link
Member

Hey, thanks for the suggestion - we have already a tracking issue for this. tbh it didn't include the use case of the command itself but can be easily supported as part of it.
#772

@bradschwartz
Copy link
Contributor Author

ah yeah I saw that issue, but was thrown off by your recommendation for the regex/indexed usage, I was thinking direct copies just to keep things simple. Do you think the simple and naive solution would work to start, and could be improved in the future with the regex solution? Or is it something that needs to be done right the first way? If you're onboard with the simple copy solution, I'm happy to take a stab at it.

@aviramha
Copy link
Member

I think in many cases users would want to control the arguments rather the binary. I think I'm okay with accepting a naive solution for now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants