Skip to content

Commit

Permalink
feat(build): add DirectML and ROCm images
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 19, 2023
1 parent 88385b3 commit b18567c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ package-api-oci:
IMAGE_FILE: Containerfile.cpu.buster
- IMAGE_ARCH: cuda-ubuntu
IMAGE_FILE: Containerfile.cuda.ubuntu
- IMAGE_ARCH: directml-buster
IMAGE_FILE: Containerfile.directml.buster
- IMAGE_ARCH: rocm-ubuntu
IMAGE_FILE: Containerfile.rocm.ubuntu

package-gui-oci:
extends:
Expand Down
29 changes: 29 additions & 0 deletions api/Containerfile.directml.buster
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM docker.io/python:3.10-buster

WORKDIR /onnx-web/api

RUN pip3 install virtualenv --upgrade

RUN python3 -m venv onnx_env

ENV PATH="/onnx-web/api/onnx_web/bin:$PATH"

RUN pip3 install pip --upgrade

RUN pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu --no-cache-dir --ignore-installed

RUN pip3 install onnxruntime-directml --force-reinstall

RUN pip3 install --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ ort-nightly-directml --force-reinstall

COPY requirements.txt /onnx-web/api/requirements.txt

RUN pip3 install -r requirements.txt --no-cache-dir

COPY onnx_web/ /onnx-web/api/onnx_web/

ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"

COPY gui/ /onnx-web/gui/

CMD [ "flask", "--app=onnx_web.serve", "run", "--host=0.0.0.0" ]
23 changes: 23 additions & 0 deletions api/Containerfile.rocm.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM docker.io/rocm/pytorch:rocm5.4_ubuntu20.04_py3.8_pytorch_1.12.1

WORKDIR /onnx-web/api

RUN pip3 install virtualenv --upgrade

RUN python3 -m venv onnx_env

ENV PATH="/onnx-web/api/onnx_web/bin:$PATH"

RUN pip3 install pip --upgrade

COPY requirements.txt /onnx-web/api/requirements.txt

RUN pip3 install -r requirements.txt --no-cache-dir

COPY onnx_web/ /onnx-web/api/onnx_web/

ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"

COPY gui/ /onnx-web/gui/

CMD [ "flask", "--app=onnx_web.serve", "run", "--host=0.0.0.0" ]

0 comments on commit b18567c

Please sign in to comment.