-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathDockerfile.cuda
45 lines (30 loc) · 1.36 KB
/
Dockerfile.cuda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# --------------------------------------------------------------
# Copyright (c) AutoDeployAI. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License").
# --------------------------------------------------------------
FROM nvcr.io/nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
MAINTAINER AutoDeployAI "[email protected]"
ADD . /code
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
wget \
openjdk-11-jdk \
ca-certificates-java
ARG SBT_VERSION=1.6.2
RUN wget -q -O /tmp/sbt-${SBT_VERSION}.tgz https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.tgz &&\
tar -zxf /tmp/sbt-${SBT_VERSION}.tgz --strip=1 -C /usr
# Harvest both PMML4S and ONNXRuntime(GPU) from maven central
RUN cd /code &&\
sbt -Dgpu=true assembly
FROM nvcr.io/nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
WORKDIR /ai-serving
ENV \
LANG=C.UTF-8 \
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN apt-get update &&\
apt-get install -y libgomp1 openjdk-11-jdk ca-certificates-java &&\
rm -rf /var/lib/apt/lists/*
COPY --from=0 /code/target/scala-2.13/*.jar .
RUN ln -s ai-serving-cuda-assembly-*.jar ai-serving-cuda-assembly.jar
ENTRYPOINT exec java $JAVA_OPTS --add-exports java.base/jdk.internal.math=ALL-UNNAMED -Donnxruntime.backend=cuda -jar ai-serving-cuda-assembly.jar