kurtosis-tech / kurtosis

A platform for packaging and launching ephemeral backend stacks with a focus on approachability for the average developer.
https://docs.kurtosistech.com/
Apache License 2.0
352 stars 47 forks source link

Entrypoint and CMD in ServiceConfig are confusing + difficult to understand #1294

Open galenmarchetti opened 1 year ago

galenmarchetti commented 1 year ago

Background & motivation

I'm trying to mount a python application to a blank python container, install the requirements via pip, and run the server. I'd like to modify the start command of the container but it's quite hard to understand how to do that. My first attempts involved many combinations of:

entrypoint=["pip install -r /app/requirements.txt; streamlit run /app/dashboard_home.py"]

cmd=["-c", "pip install -r /app/requirements.txt;", "streamlit run /app/dashboard_home.py"]

cmd=["-c", "pip", "install", "-r", "/app/requirements.txt;", "streamlit", "run", "/app/dashboard_home.py"]

etc etc.

I debugged these by shelling into the service without a starting command via kurtosis service shell and running the desired commands in the shell...which is an intuitive way, to me, to figure out what will work and won't work.

At the end, @leeederek showed me that in the ExecRecipe section of the docs here (https://docs.kurtosis.com/starlark-reference/exec-recipe/) there's a tip to wrap all these commands in a prefix ["/bin/sh", "-c"...] in order to make them work. I used that trick and it worked as it expected, how I wanted it to work - a string that looks and feels like it does on the command line, as the first command that gets run on my container.

Desired behaviour

I want to be able to just give a string to kurtosis, which starts a service, and behaves exactly like it does with kurtosis service shell ... making starting a service and debugging my starlark definitions much easier. I don't want to have to understand the difference between docker CMD and docker ENTRYPOINT, and how lists of string args get passed to different unix commands in each case.

How important is this to you?

Painful; the lack of this feature makes using Kurtosis frictionful.

mieubrisse commented 1 year ago

Prototype: https://www.notion.so/kurtosistech/Better-Container-Commands-ITERATION-0-b15658a4c88e4433a2906e539840457e?pvs=4

leeederek commented 1 year ago

@barnabasbusa hit a similar issue as well

mieubrisse commented 1 year ago

latest iteration here: https://www.notion.so/kurtosistech/Better-Container-Commands-8e6905615334405aae1af796596277ac?pvs=4