1
0
Fork 0

fix(build): add launcher script and use for API images

This commit is contained in:
Sean Sube 2023-01-21 22:34:41 -06:00
parent dddadfc9a2
commit 88f9b624ec
5 changed files with 21 additions and 4 deletions

View File

@ -22,10 +22,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
COPY onnx_web/ /onnx-web/api/onnx_web/ COPY onnx_web/ /onnx-web/api/onnx_web/
COPY launch.sh /onnx-web/launch.sh
COPY params.json /onnx-web/api/params.json COPY params.json /onnx-web/api/params.json
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui" ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
COPY gui/ /onnx-web/gui/ COPY gui/ /onnx-web/gui/
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ] CMD [ "sh", "-c", "/onnx-web/launch.sh" ]

View File

@ -26,10 +26,12 @@ RUN pip3 install onnxruntime-gpu --no-cache-dir
COPY onnx_web/ /onnx-web/api/onnx_web/ COPY onnx_web/ /onnx-web/api/onnx_web/
COPY launch.sh /onnx-web/launch.sh
COPY params.json /onnx-web/api/params.json COPY params.json /onnx-web/api/params.json
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui" ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
COPY gui/ /onnx-web/gui/ COPY gui/ /onnx-web/gui/
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ] CMD [ "sh", "-c", "/onnx-web/launch.sh" ]

View File

@ -22,10 +22,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
COPY onnx_web/ /onnx-web/api/onnx_web/ COPY onnx_web/ /onnx-web/api/onnx_web/
COPY launch.sh /onnx-web/launch.sh
COPY params.json /onnx-web/api/params.json COPY params.json /onnx-web/api/params.json
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui" ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
COPY gui/ /onnx-web/gui/ COPY gui/ /onnx-web/gui/
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ] CMD [ "sh", "-c", "/onnx-web/launch.sh" ]

View File

@ -20,10 +20,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
COPY onnx_web/ /onnx-web/api/onnx_web/ COPY onnx_web/ /onnx-web/api/onnx_web/
COPY launch.sh /onnx-web/launch.sh
COPY params.json /onnx-web/api/params.json COPY params.json /onnx-web/api/params.json
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui" ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
COPY gui/ /onnx-web/gui/ COPY gui/ /onnx-web/gui/
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ] CMD [ "sh", "-c", "/onnx-web/launch.sh" ]

9
api/launch.sh Executable file
View File

@ -0,0 +1,9 @@
#! /bin/sh
set -eu
echo "Downloading and converting models to ONNX format..."
python3 -m onnx_web.convert --diffusion --upscaling --correction --extras --token=${HF_TOKEN:-}
echo "Launching API server..."
flask --app=onnx_web.serve run --host=0.0.0.0