-
Notifications
You must be signed in to change notification settings - Fork 476
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
Use entrypoint style for end-user app #310
base: dev
Are you sure you want to change the base?
Conversation
Out of topic: GitHub and my local editor warn that many files don't have end-file-new-line. Do you accept style PR? Or run |
@dusty-nv is there any way to auto-test all containers? now I tested what I modified and looks good |
Thanks @jasl, in an effort to understand ENTRYPOINT vs CMD I mapped out these common usages: (a) starting the enduser app (server) with different args and (b) running a different process all together (model downloader) A. Start server with arguments
./run.sh --workdir /opt/text-generation-webui $(./autotag text-generation-webui) \
python3 server.py --listen --verbose --api \
--model-dir=/data/models/text-generation-webui \
--model=llama-2-13b-chat.ggmlv3.q4_0.bin \
--loader=llamacpp \
--n-gpu-layers=128 \
--n_ctx=4096 \
--n_batch=4096
./run.sh $(./autotag text-generation-webui) \
--model=llama-2-13b-chat.ggmlv3.q4_0.bin \
--loader=llamacpp \
--n-gpu-layers=128 \
--n_ctx=4096 \
--n_batch=4096 B. Start different process
./run.sh --workdir=/opt/text-generation-webui $(./autotag text-generation-webui) /bin/bash -c \
'python3 download-model.py --output=/data/models/text-generation-webui TheBloke/Llama-2-7b-Chat-GPTQ'
./run.sh --workdir=/opt/text-generation-webui --entrypoint 'python3 download-model.py' \
$(./autotag text-generation-webui) \
--output=/data/models/text-generation-webui TheBloke/Llama-2-7b-Chat-GPTQ I agree that if user is only adding args, ENTRYPOINT is nicer. What I don't prefer is doing more complicated invocations with it, without needing another bash script that you mount in, then run. But in general I am leaning towards ENTRYPOINT for these. Can you confirm that my last example actually works? |
It seems the Dockerfile is broken
I do a workaround (just let it not block me) You can do this if you want to call ./run.sh --workdir=/opt/text-generation-webui --entrypoint /usr/bin/env $(./autotag text-generation-webui) python3 download-model.py --output=/data/models/text-generation-webui TheBloke/Llama-2-7b-Chat-GPTQ The entry point should be Here's the proof Does this look good to you? |
friendly ping @dusty-nv |
I want to add extra arg
--api
to thesd-webui
, then I found the current Dockerfile not easy to make.With the entry point style, I could add extra args by
./run.sh $(./autotag stable-diffusion-webui) --api
which convenient for people.I also checked other images and made the same change.
In addition, I set
WORKDIR
to the app folder.What do you think?