Dockerfile 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. # Package logic:
  2. # 1. base target:
  3. # - Install tools.
  4. # - Upgrade GCC if needed.
  5. # - Install C buildkit.
  6. # - Upgrade Python if needed.
  7. # - Install Python buildkit.
  8. # - Install Platform toolkit.
  9. # - Install S6-overlay.
  10. # 2. gpustack target.
  11. # - Install PostgreSQL.
  12. # - Install Higress standalone components.
  13. # - Install gpustack package from the mounted source code.
  14. # - Setup entrypoint to gpustack command.
  15. # Argument usage:
  16. # - PYTHON_VERSION: Version of Python to use.
  17. # - GPUSTACK_BASE_IMAGE: Base image for the gpustack stage.
  18. # - GPUSTACK_RUNTIME_ROCM_VERSION: Version of ROCm detection library for gpustack-runtime, update this if project dependencies has changed.
  19. # - GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS: Semicolon-separated list of labels to filter mirrored images when deploying mirrored deployment.
  20. # - HIGRESS_VERSION: Version of Higress to use.
  21. # - HIGRESS_APISERVER_VERSION: Version of Higress API server to use.
  22. ARG PYTHON_VERSION=3.12
  23. ARG REGISTRY_MIRROR=docker.1panel.live
  24. ARG HIGRESS_REGISTRY=docker.1panel.live
  25. ARG GPUSTACK_BASE_IMAGE=base
  26. ARG ROCM_REGISTRY=docker.1panel.live
  27. ARG GPUSTACK_RUNTIME_ROCM_VERSION=7.0.2
  28. ARG GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS
  29. ARG HIGRESS_VERSION=2.1.9
  30. ARG HIGRESS_APISERVER_VERSION=0.0.26
  31. ARG PROMETHEUS_VERSION=3.5.1
  32. ARG GRAFANA_VERSION=12.2.4
  33. # Stage Base
  34. #
  35. # Example build command:
  36. # docker build --tag=gpustack/gpustack:base --file=pack/Dockerfile --target=base --progress=plain .
  37. #
  38. FROM ${HIGRESS_REGISTRY}/gpustack/mirrored-higress-api-server:${HIGRESS_APISERVER_VERSION} AS apiserver
  39. FROM ${HIGRESS_REGISTRY}/gpustack/mirrored-higress-higress:${HIGRESS_VERSION} AS controller
  40. FROM ${HIGRESS_REGISTRY}/gpustack/mirrored-higress-pilot:${HIGRESS_VERSION} AS pilot
  41. FROM ${HIGRESS_REGISTRY}/gpustack/mirrored-higress-gateway:${HIGRESS_VERSION} AS gateway
  42. FROM ${REGISTRY_MIRROR}/library/ubuntu:24.04@sha256:d1e2e92c075e5ca139d51a140fff46f84315c0fdce203eab2807c7e495eff4f9 AS base
  43. SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
  44. ARG TARGETPLATFORM
  45. ARG TARGETOS
  46. ARG TARGETARCH
  47. ## Install Tools
  48. ENV DEBIAN_FRONTEND=noninteractive \
  49. LANG='en_US.UTF-8' \
  50. LANGUAGE='en_US:en' \
  51. LC_ALL='en_US.UTF-8'
  52. RUN <<EOF
  53. # Tools
  54. # Use Tsinghua mirrors for Ubuntu
  55. sed -i 's|//archive.ubuntu.com|//mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
  56. sed -i 's|//security.ubuntu.com|//mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
  57. sed -i 's|//ppa.launchpadcontent.net|//launchpad.proxy.ustclug.org|g' /etc/apt/sources.list
  58. # Refresh
  59. apt-get update -y && apt-get install -y --no-install-recommends \
  60. software-properties-common apt-transport-https \
  61. ca-certificates gnupg2 lsb-release gnupg-agent \
  62. && apt-get update -y
  63. # Install
  64. apt-get install -y --no-install-recommends \
  65. ca-certificates build-essential binutils bash openssl \
  66. curl wget aria2 \
  67. git git-lfs \
  68. unzip xz-utils \
  69. tzdata locales \
  70. iproute2 iputils-ping ifstat net-tools dnsutils pciutils ipmitool \
  71. procps sysstat htop \
  72. vim jq bc tree \
  73. logrotate cron netcat-openbsd \
  74. python3-pip python3-venv
  75. # Update locale
  76. localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  77. # Update timezone
  78. rm -f /etc/localtime \
  79. && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  80. && echo "Asia/Shanghai" > /etc/timezone \
  81. && dpkg-reconfigure --frontend noninteractive tzdata
  82. # Cleanup
  83. rm -rf /var/tmp/* \
  84. && rm -rf /tmp/* \
  85. && rm -rf /var/cache/apt
  86. EOF
  87. ## Upgrade GCC if needed
  88. RUN <<EOF
  89. # GCC
  90. # Upgrade GCC if the Ubuntu version is lower than 21.04.
  91. source /etc/os-release
  92. if (( $(echo "${VERSION_ID} >= 21.04" | bc -l) )); then
  93. echo "Skipping GCC upgrade for ${VERSION_ID}..."
  94. exit 0
  95. fi
  96. # Install
  97. apt-get install -y --no-install-recommends \
  98. gcc-11 g++-11 gfortran-11 gfortran
  99. # Update alternatives
  100. if [[ -f /etc/alternatives/gcov-dump ]]; then update-alternatives --remove-all gcov-dump; fi; update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-11 10
  101. if [[ -f /etc/alternatives/lto-dump ]]; then update-alternatives --remove-all lto-dump; fi; update-alternatives --install /usr/bin/lto-dump lto-dump /usr/bin/lto-dump-11 10
  102. if [[ -f /etc/alternatives/gcov ]]; then update-alternatives --remove-all gcov; fi; update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 10
  103. if [[ -f /etc/alternatives/gcc ]]; then update-alternatives --remove-all gcc; fi; update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10
  104. if [[ -f /etc/alternatives/gcc-nm ]]; then update-alternatives --remove-all gcc-nm; fi; update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-11 10
  105. if [[ -f /etc/alternatives/cpp ]]; then update-alternatives --remove-all cpp; fi; update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 10
  106. if [[ -f /etc/alternatives/g++ ]]; then update-alternatives --remove-all g++; fi; update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 10
  107. if [[ -f /etc/alternatives/gcc-ar ]]; then update-alternatives --remove-all gcc-ar; fi; update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 10
  108. if [[ -f /etc/alternatives/gcov-tool ]]; then update-alternatives --remove-all gcov-tool; fi; update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-11 10
  109. if [[ -f /etc/alternatives/gcc-ranlib ]]; then update-alternatives --remove-all gcc-ranlib; fi; update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 10
  110. if [[ -f /etc/alternatives/gfortran ]]; then update-alternatives --remove-all gfortran; fi; update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-11 10
  111. # Cleanup
  112. rm -rf /var/tmp/* \
  113. && rm -rf /tmp/* \
  114. && rm -rf /var/cache/apt
  115. EOF
  116. ## Install C buildkit
  117. RUN <<EOF
  118. # C buildkit
  119. # Install
  120. apt-get install -y --no-install-recommends \
  121. make ninja-build pkg-config ccache
  122. curl --retry 3 --retry-connrefused -fL "https://gh-proxy.com/https://github.com/Kitware/CMake/releases/download/v3.31.7/cmake-3.31.7-linux-$(uname -m).tar.gz" | tar -zx -C /usr --strip-components 1
  123. # Install dependencies
  124. apt-get install -y --no-install-recommends \
  125. openssl libssl-dev \
  126. zlib1g zlib1g-dev libbz2-dev libffi-dev \
  127. lzma lzma-dev uuid-dev liblzma-dev \
  128. ffmpeg libjpeg-dev libpng-dev libtiff-dev libwebp-dev \
  129. libsqlite3-dev \
  130. libxml2 libxslt1-dev \
  131. libnuma1 libnuma-dev \
  132. libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev \
  133. libjemalloc-dev
  134. # Cleanup
  135. rm -rf /var/tmp/* \
  136. && rm -rf /tmp/* \
  137. && rm -rf /var/cache/apt
  138. EOF
  139. ## Upgrade Python if needed
  140. ARG PYTHON_VERSION
  141. ENV PYTHON_VERSION=${PYTHON_VERSION}
  142. RUN <<EOF
  143. # Python
  144. if (( $(echo "$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2) == ${PYTHON_VERSION}" | bc -l) )); then
  145. echo "Skipping Python upgrade for ${PYTHON_VERSION}..."
  146. if [[ -z "$(ldconfig -v 2>/dev/null | grep libpython${PYTHON_VERSION})" ]]; then
  147. PYTHON_LIB_PREFIX=$(python3 -c "import sys; print(sys.base_prefix);")
  148. echo "${PYTHON_LIB_PREFIX}/lib" >> /etc/ld.so.conf.d/python3.conf
  149. echo "${PYTHON_LIB_PREFIX}/lib64" >> /etc/ld.so.conf.d/python3.conf
  150. ldconfig -v
  151. fi
  152. exit 0
  153. fi
  154. # Add deadsnakes PPA via USTC mirror (bypass add-apt-repository which connects to launchpad)
  155. CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")
  156. wget -q -O /tmp/deadsnakes.asc https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6c7c47c706f57f28c70139e07965b5db433a593c
  157. gpg --dearmor /tmp/deadsnakes.asc
  158. mv /tmp/deadsnakes.asc.gpg /usr/share/keyrings/deadsnakes.gpg
  159. cat > /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-${CODENAME}.sources <<SRCEOF
  160. Types: deb
  161. URIs: https://launchpad.proxy.ustclug.org/deadsnakes/ppa/ubuntu
  162. Suites: ${CODENAME}
  163. Components: main
  164. Signed-By: /usr/share/keyrings/deadsnakes.gpg
  165. SRCEOF
  166. apt-get update -y
  167. # Install
  168. apt-get install -y --no-install-recommends \
  169. python${PYTHON_VERSION} \
  170. python${PYTHON_VERSION}-dev \
  171. python${PYTHON_VERSION}-venv \
  172. python${PYTHON_VERSION}-lib2to3 \
  173. python${PYTHON_VERSION}-gdbm \
  174. python${PYTHON_VERSION}-tk
  175. if (( $(echo "${PYTHON_VERSION} <= 3.11" | bc -l) )); then
  176. apt-get install -y --no-install-recommends \
  177. python${PYTHON_VERSION}-distutils
  178. fi
  179. # Update alternatives
  180. if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
  181. if [[ -f /etc/alternatives/python ]]; then update-alternatives --remove-all python; fi; update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
  182. curl -sS "https://gh-proxy.com/https://raw.githubusercontent.com/pypa/get-pip/main/get-pip.py" | python${PYTHON_VERSION}
  183. if [[ -f /etc/alternatives/2to3 ]]; then update-alternatives --remove-all 2to3; fi; update-alternatives --install /usr/bin/2to3 2to3 /usr/bin/2to3${PYTHON_VERSION} 1 || true
  184. if [[ -f /etc/alternatives/pydoc3 ]]; then update-alternatives --remove-all pydoc3; fi; update-alternatives --install /usr/bin/pydoc3 pydoc3 /usr/bin/pydoc${PYTHON_VERSION} 1 || true
  185. if [[ -f /etc/alternatives/idle3 ]]; then update-alternatives --remove-all idle3; fi; update-alternatives --install /usr/bin/idle3 idle3 /usr/bin/idle${PYTHON_VERSION} 1 || true
  186. if [[ -f /etc/alternatives/python3-config ]]; then update-alternatives --remove-all python3-config; fi; update-alternatives --install /usr/bin/python3-config python3-config /usr/bin/python${PYTHON_VERSION}-config 1 || true
  187. # Cleanup
  188. rm -rf /var/tmp/* \
  189. && rm -rf /tmp/* \
  190. && rm -rf /var/cache/apt
  191. EOF
  192. ## Install Python buildkit
  193. ENV PIP_NO_CACHE_DIR=1 \
  194. PIP_DISABLE_PIP_VERSION_CHECK=1 \
  195. PIP_ROOT_USER_ACTION=ignore \
  196. PIPX_HOME=/root/.local/share/pipx \
  197. PIPX_LOCAL_VENVS=/root/.local/share/pipx/venvs \
  198. POETRY_NO_CACHE=1 \
  199. UV_NO_CACHE=1 \
  200. UV_HTTP_TIMEOUT=500 \
  201. UV_INDEX_STRATEGY="unsafe-best-match"
  202. RUN <<EOF
  203. # Buildkit
  204. cat <<EOT >/tmp/requirements.txt
  205. build
  206. cmake<4
  207. ninja<1.11
  208. setuptools<80
  209. setuptools-scm
  210. packaging<25
  211. wheel
  212. pybind11<3
  213. Cython
  214. psutil
  215. pipx
  216. uv
  217. yq
  218. hatchling
  219. py-spy
  220. poetry
  221. EOT
  222. python3 -m pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --break-system-packages -r /tmp/requirements.txt
  223. # Cleanup
  224. rm -rf /var/tmp/* \
  225. && rm -rf /tmp/*
  226. EOF
  227. ## Install s6-overlay
  228. ARG S6_OVERLAY_VERSION=3.2.1.0
  229. RUN set -eux; \
  230. case "${TARGETARCH}" in \
  231. amd64) S6_ARCH="x86_64" ;; \
  232. arm64) S6_ARCH="aarch64" ;; \
  233. arm/v7) S6_ARCH="armhf" ;; \
  234. arm/v6) S6_ARCH="arm" ;; \
  235. *) \
  236. echo >&2 "⚠️ Warning: Unknown TARGETARCH='${TARGETARCH}', defaulting to x86_64"; \
  237. S6_ARCH="x86_64"; \
  238. ;; \
  239. esac; \
  240. echo "Installing s6-overlay ${S6_OVERLAY_VERSION} for arch: ${S6_ARCH} (from TARGETARCH=${TARGETARCH})"; \
  241. base_url="https://gh-proxy.com/https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}"; \
  242. for pkg in noarch ${S6_ARCH}; do \
  243. wget -q -O "/tmp/s6-overlay-${pkg}.tar.xz" "${base_url}/s6-overlay-${pkg}.tar.xz"; \
  244. done \
  245. && echo "📦 Extracting s6-overlay ..." \
  246. && tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
  247. && tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz \
  248. && rm -f /tmp/s6-overlay-*.tar.xz \
  249. && echo "Installed s6-overlay ${S6_OVERLAY_VERSION} successfully."
  250. ENV S6_KEEP_ENV=1 \
  251. S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
  252. S6_SERVICES_GRACETIME=3000 \
  253. S6_KILL_GRACETIME=3000 \
  254. S6_VERBOSITY=1 \
  255. S6_CMD_WAIT_FOR_SERVICES=1
  256. #
  257. # Stage GPUStack
  258. #
  259. # Example build command:
  260. # docker build --tag=gpustack/gpustack:main --file=pack/Dockerfile --progress=plain .
  261. #
  262. # Vendor ROCm libraries from ROCm base image,
  263. # now only linux/amd64 is supported.
  264. # Must build on linux/amd64 platform.
  265. FROM --platform=${BUILDPLATFORM} ${ROCM_REGISTRY}/rocm/dev-ubuntu-22.04:${GPUSTACK_RUNTIME_ROCM_VERSION} AS rocm-base
  266. FROM ${GPUSTACK_BASE_IMAGE} AS gpustack
  267. SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
  268. ARG TARGETPLATFORM
  269. ARG TARGETOS
  270. ARG TARGETARCH
  271. ## Configure data volume
  272. VOLUME /var/lib/gpustack
  273. ## Install PostgreSQL
  274. ENV PGCONFIG_FILE=/etc/postgresql/main/postgresql.conf \
  275. POSTGRES_DB=gpustack
  276. RUN set -eux; \
  277. groupadd -r postgres --gid=9999; \
  278. useradd -r -g postgres --uid=9999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
  279. mkdir -p /var/lib/postgresql; \
  280. chown -R postgres:postgres /var/lib/postgresql
  281. RUN <<EOF
  282. set -eux
  283. # Use Tsinghua mirror for PostgreSQL APT repository
  284. wget -O /tmp/ACCC4CF8.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc \
  285. && gpg --dearmor /tmp/ACCC4CF8.asc \
  286. && mv /tmp/ACCC4CF8.asc.gpg /usr/share/keyrings/postgresql-archive-keyring.gpg \
  287. && echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
  288. # Install
  289. apt-get update -y && apt-get install -y --no-install-recommends \
  290. postgresql-17 \
  291. gosu
  292. # Create symlinks for PostgreSQL 17 to simplify usage
  293. ln -s /usr/lib/postgresql/17/bin /usr/lib/postgresql/bin \
  294. && ln -s /etc/postgresql/17/main /etc/postgresql/main \
  295. && ln -s /var/lib/postgresql/17/main /var/lib/postgresql/main \
  296. && ls -1 /usr/lib/postgresql/bin/ | xargs -I @ ln -sf /usr/lib/postgresql/bin/@ /usr/bin/@
  297. gosu postgres echo "listen_addresses='*'" >> "$PGCONFIG_FILE" \
  298. && gosu postgres echo "local all postgres peer" > /etc/postgresql/main/pg_hba.conf \
  299. && gosu postgres echo "host all root 127.0.0.1/32 trust" >> /etc/postgresql/main/pg_hba.conf \
  300. && gosu postgres echo "host all root ::1/128 trust" >> /etc/postgresql/main/pg_hba.conf \
  301. && gosu postgres echo "host all all 0.0.0.0/0 scram-sha-256" >> /etc/postgresql/main/pg_hba.conf
  302. gosu postgres sed -i "s/^data_directory/#data_directory/" "$PGCONFIG_FILE" \
  303. && gosu postgres sed -i "s/^hba_file/#hba_file/" "$PGCONFIG_FILE" \
  304. && gosu postgres sed -i "s/^#log_destination/log_destination/" "$PGCONFIG_FILE" \
  305. && gosu postgres sed -i "s/^#log_min_messages = warning/log_min_messages = info/" "$PGCONFIG_FILE" \
  306. && gosu postgres sed -i "s/^#logging_collector = off/logging_collector = on/" "$PGCONFIG_FILE" \
  307. && gosu postgres sed -i "s/^#log_filename/log_filename/" "$PGCONFIG_FILE" \
  308. && gosu postgres sed -i "s/^#log_rotation_size/log_rotation_size/" "$PGCONFIG_FILE"
  309. # Cleanup
  310. rm -rf /var/tmp/* \
  311. && rm -rf /tmp/* \
  312. && rm -rf /var/cache/apt
  313. EOF
  314. ## Install Higress standalone components
  315. RUN --mount=type=bind,from=apiserver,source=/apiserver,dst=/mnt/apiserver,rw \
  316. --mount=type=bind,from=controller,source=/usr/local/bin/higress,dst=/mnt/higress,rw \
  317. --mount=type=bind,from=pilot,source=/usr/local/bin,dst=/mnt/pilot,rw \
  318. --mount=type=bind,from=gateway,source=/,dst=/mnt/gateway,rw <<EOF
  319. # Prepare Higress standalone components
  320. set -eux;
  321. # Install API server
  322. cp /mnt/apiserver /usr/local/bin/apiserver;
  323. # Install controller
  324. cp /mnt/higress /usr/local/bin/higress;
  325. # Install pilot
  326. cp /mnt/pilot/pilot-discovery /usr/local/bin/pilot-discovery;
  327. cp /mnt/pilot/higress-pilot-start.sh /usr/local/bin/higress-pilot-start.sh;
  328. # Install gateway
  329. mkdir -p /var/lib/istio/envoy/
  330. cp /mnt/gateway/var/lib/istio/envoy/*.json /var/lib/istio/envoy/;
  331. cp /mnt/gateway/var/lib/istio/envoy/*.so /var/lib/istio/envoy/;
  332. cp /mnt/gateway/usr/local/bin/pilot-agent /usr/local/bin/pilot-agent;
  333. cp /mnt/gateway/usr/local/bin/envoy /usr/local/bin/envoy;
  334. cp /mnt/gateway/usr/local/bin/supercronic-linux-${TARGETARCH} /usr/local/bin/;
  335. ln -s supercronic-linux-${TARGETARCH} supercronic && mv supercronic /usr/local/bin/;
  336. EOF
  337. # Initialize configurations
  338. COPY pack/rootfs/ /
  339. COPY docker-compose/grafana/grafana_dashboards/ /etc/dashboards/
  340. # Fix execute permissions for scripts (lost on Windows bind mount)
  341. RUN find /etc/s6-overlay -name '*.sh' -exec chmod +x {} + \
  342. && find /etc/s6-overlay/scripts -type f ! -name '*.sh' -exec chmod +x {} +
  343. ## END Install Higress standalone components
  344. ## Install Skopeo
  345. ARG GOPROXY="https://goproxy.cn,direct"
  346. RUN <<EOF
  347. # Skopeo
  348. # Install Go
  349. curl --retry 3 --retry-connrefused -fL "https://golang.google.cn/dl/go1.23.3.${TARGETOS}-${TARGETARCH}.tar.gz" | tar -zx -C /usr/local
  350. export PATH="/usr/local/go/bin:${PATH}"
  351. export GOPROXY="${GOPROXY}"
  352. export
  353. # Download
  354. git -C /tmp clone --recursive --shallow-submodules \
  355. --depth 1 --branch v1.20.0 --single-branch \
  356. https://gh-proxy.com/https://github.com/containers/skopeo.git skopeo
  357. # Build and install
  358. pushd /tmp/skopeo \
  359. && sed -i "/export GOPROXY=.*/d" Makefile \
  360. && make vendor \
  361. && DISABLE_DOCS=1 PREFIX=/usr make install-binary
  362. # Configure Skopeo to allow insecure registries.
  363. mkdir -p /etc/containers
  364. cat<<EOT > /etc/containers/policy.json
  365. {
  366. "default": [
  367. {
  368. "type": "insecureAcceptAnything"
  369. }
  370. ]
  371. }
  372. EOT
  373. # Review
  374. skopeo --version
  375. # Cleanup go
  376. go clean -cache -modcache -testcache \
  377. && rm -rf /usr/local/go \
  378. && rm -rf /root/.cache/go-build
  379. # Cleanup
  380. rm -rf /var/tmp/* \
  381. && rm -rf /tmp/* \
  382. && rm -rf /var/cache/apt
  383. EOF
  384. ## Install Prometheus and Grafana
  385. ARG PROMETHEUS_VERSION
  386. ARG GRAFANA_VERSION
  387. RUN <<EOF
  388. set -eux
  389. apt-get update -y && apt-get install -y --no-install-recommends \
  390. fontconfig
  391. case "${TARGETARCH}" in
  392. amd64)
  393. PROM_ARCH="amd64"
  394. GRAFANA_ARCH="amd64"
  395. ;;
  396. arm64)
  397. PROM_ARCH="arm64"
  398. GRAFANA_ARCH="arm64"
  399. ;;
  400. *)
  401. echo "Unsupported TARGETARCH: ${TARGETARCH}"
  402. exit 1
  403. ;;
  404. esac
  405. curl --retry 3 --retry-connrefused -fL \
  406. "https://gh-proxy.com/https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}.tar.gz" \
  407. | tar -zx -C /opt
  408. mv "/opt/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}" /opt/prometheus
  409. ln -s /opt/prometheus/prometheus /usr/local/bin/prometheus
  410. ln -s /opt/prometheus/promtool /usr/local/bin/promtool
  411. curl --retry 3 --retry-connrefused -fL \
  412. "https://dl.grafana.com/oss/release/grafana-${GRAFANA_VERSION}.linux-${GRAFANA_ARCH}.tar.gz" \
  413. | tar -zx -C /opt
  414. mv "/opt/grafana-${GRAFANA_VERSION}" /opt/grafana
  415. ln -s /opt/grafana/bin/grafana-server /usr/local/bin/grafana-server
  416. ln -s /opt/grafana/bin/grafana-cli /usr/local/bin/grafana-cli
  417. mkdir -p /etc/grafana
  418. cp /opt/grafana/conf/sample.ini /etc/grafana/grafana.ini.sample
  419. rm -rf /var/tmp/* \
  420. && rm -rf /tmp/* \
  421. && rm -rf /var/cache/apt
  422. EOF
  423. ## Install GPUStack
  424. ARG GPUSTACK_VERSION=latest
  425. RUN --mount=type=cache,target=/root/.cache \
  426. --mount=type=bind,target=/workspace/gpustack,rw <<EOF
  427. # Install GPUStack
  428. export POETRY_NO_CACHE=0
  429. export UV_NO_CACHE=0
  430. export UV_SYSTEM_PYTHON=1
  431. export UV_LINK_MODE=copy
  432. # Remove PEP 668 EXTERNALLY-MANAGED marker to allow system-wide pip installs
  433. rm -f /usr/lib/python*/EXTERNALLY-MANAGED
  434. # Build GPUStack
  435. cd /workspace/gpustack \
  436. && git config --global --add safe.directory /workspace/gpustack \
  437. && chmod +x hack/*.sh hack/lib/*.sh \
  438. && make build
  439. # Install GPUStack.
  440. # FIXME: There is no linux/arm64 vLLM prebuilt wheel,
  441. # so we only install the all wheel for linux/amd64.
  442. if [ "${TARGETARCH}" == "amd64" ]; then
  443. WHEEL_PACKAGE="$(ls /workspace/gpustack/dist/*.whl)[all]";
  444. else
  445. WHEEL_PACKAGE="$(ls /workspace/gpustack/dist/*.whl)[audio]";
  446. fi
  447. uv pip install --no-build-isolation --extra-index-url https://download.pytorch.org/whl/cpu/ --index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple \
  448. ${WHEEL_PACKAGE}
  449. # Download tools
  450. gpustack download-tools
  451. tree -hs "$(pip show gpustack | grep Location: | head -n 1 | cut -d" " -f 2)/gpustack/third_party"
  452. # Set up environment
  453. mkdir -p /var/lib/gpustack \
  454. && chmod -R 0755 /var/lib/gpustack
  455. # Review
  456. uv pip tree \
  457. --package gpustack
  458. gpustack version
  459. # Try to update PCI IDs
  460. if ! update-pciids; then
  461. curl -o /usr/share/misc/pci.ids https://mirrors.tuna.tsinghua.edu.cn/misc/pci.ids || true
  462. fi
  463. # Cleanup
  464. rm -rf /var/tmp/* \
  465. && rm -rf /tmp/* \
  466. && rm -rf /workspace/gpustack/dist
  467. EOF
  468. ## Entrypoint
  469. ## Active all AMD devices detection,
  470. ## works with (default) ROCm container runtime and privileged mode.
  471. ## See https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-py-api.html.
  472. ## Runs:
  473. ## - With container runtime installed:
  474. ## + If installed AMD contaienr runtime as default runtime, try with:
  475. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged ...
  476. ## + If there are mulitple container runtimes installed, try with:
  477. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged --runtime amd ...
  478. ## + If failed to detect devices' name, try with:
  479. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /usr/share:/usr/share:ro ...
  480. ## + If want to detect the correct host ROCm version, try with:
  481. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /opt/rocm:/opt/rocm:ro ...
  482. ## + Disallowing privileged, try with:
  483. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ...
  484. ## - Without container runtime installed:
  485. ## + Allowing privileged, try with:
  486. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /opt/rocm:/opt/rocm:ro ...
  487. ## + Disallowing privileged, try with:
  488. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro --group-add video -v /opt/rocm:/opt/rocm:ro ...
  489. RUN --mount=type=bind,from=rocm-base,source=/opt/rocm/share,target=/opt/rocm/share,rw <<EOF
  490. # Reinstall amd-smi
  491. export UV_SYSTEM_PYTHON=1
  492. export UV_PRERELEASE=allow
  493. uv pip install --no-build-isolation \
  494. /opt/rocm/share/amd_smi
  495. uv pip tree
  496. # Hack to avoid: Fail to open libdrm_amdgpu.so: libdrm_amdgpu.so: cannot open shared object file: No such file or directory
  497. TARGET_DIR="/usr/lib/$(uname -m)-linux-gnu"
  498. TARGET_LIB="libdrm_amdgpu.so.1"
  499. TARGET_LINK="libdrm_amdgpu.so"
  500. TARGET_LIB_EXISTED="true"
  501. if [[ ! -e "${TARGET_DIR}/${TARGET_LIB}" ]]; then
  502. TARGET_LIB_EXISTED="false"
  503. touch "${TARGET_DIR}/${TARGET_LIB}"
  504. fi
  505. pushd "${TARGET_DIR}" \
  506. && ln -sf "${TARGET_LIB}" "${TARGET_LINK}"
  507. if [[ "${TARGET_LIB_EXISTED}" == "false" ]]; then
  508. rm -f "${TARGET_DIR}/${TARGET_LIB}"
  509. fi
  510. EOF
  511. ENV AMD_VISIBLE_DEVICES="all" \
  512. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/opt/rocm"
  513. ## Active all Ascend devices detection,
  514. ## works with (default) Ascend container runtime and privileged mode.
  515. ## See https://gitcode.com/Ascend/mind-cluster/blob/master/component/ascend-common/devmanager/dcmi/dcmi_interface_api.h.
  516. ## Runs:
  517. ## - With container runtime installed:
  518. ## + If installed Ascend container runtime as default runtime, try with:
  519. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -e "ASCEND_VISIBLE_DEVICES=$(npu-smi info -m | tail -n 1 | awk '{print $1}')" ...
  520. ## + If there are mulitple container runtimes installed, try with:
  521. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -e "ASCEND_VISIBLE_DEVICES=$(npu-smi info -m | tail -n 1 | awk '{print $1}')" --runtime ascend ...
  522. ## + If want to detect the correct host CANN version and SoC name, try with:
  523. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -e "ASCEND_VISIBLE_DEVICES=$(npu-smi info -m | tail -n 1 | awk '{print $1}')" -v /usr/local/Ascend/ascend-toolkit:/usr/local/Ascend/ascend-toolkit:ro ...
  524. ## + Disallowing privileged, try with:
  525. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e "ASCEND_VISIBLE_DEVICES=$(npu-smi info -m | grep -v mcu | awk '{if(NR>1){print $1}}' | uniq | paste -sd ',')" ...
  526. ## - Without container runtime installed:
  527. ## + Allowing privileged, try with:
  528. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /usr/local/dcmi:/usr/local/dcmi:ro -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro -v /etc/hccn.conf:/etc/hccn.conf:ro -v /etc/ascend_install.info:/etc/ascend_install.info:ro ...
  529. ## + Disallowing privileged, try with:
  530. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro -v /usr/local/dcmi:/usr/local/dcmi:ro -v /usr/local/Ascend/driver:/usr/local/Ascend/driver:ro -v /etc/hccn.conf:/etc/hccn.conf:ro -v /etc/ascend_install.info:/etc/ascend_install.info:ro ...
  531. ENV ASCEND_HOME_PATH="/usr/local/Ascend/ascend-toolkit/latest" \
  532. LD_LIBRARY_PATH="/usr/local/Ascend/driver/lib64/common:/usr/local/Ascend/driver/lib64/driver:/usr/local/Ascend/ascend-toolkit/latest/runtime/lib64:${LD_LIBRARY_PATH}" \
  533. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/usr/local/Ascend/ascend-toolkit;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  534. ## Active all Cambricon devices detection,
  535. ## works with (default) Cambricon container runtime and privileged mode.
  536. ## See https://github.com/Cambricon/cambricon-k8s-device-plugin/blob/master/device-plugin/pkg/cndev/include/cndev.h,
  537. ## https://github.com/Cambricon/cambricon-k8s-device-plugin/blob/master/device-plugin/pkg/cntopo/include/cntopo.h.
  538. ## Runs:
  539. ## - With container runtime installed:
  540. ## [TODO, TBD]
  541. ## - Without container runtime installed:
  542. ## + Allowing privileged, try with:
  543. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /usr/local/neuware:/usr/local/neuware:ro -v /usr/bin/cnmon:/usr/bin/cnmon ...
  544. ## + Disallowing privileged, try with:
  545. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro -v /usr/local/neuware:/usr/local/neuware:ro -v /usr/bin/cnmon:/usr/bin/cnmon ...
  546. ENV CAMBRICON_VISIBLE_DEVICES="all" \
  547. NEUWARE_HOME="/usr/local/neuware" \
  548. LD_LIBRARY_PATH="/usr/local/neuware/lib64:${LD_LIBRARY_PATH}" \
  549. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/usr/local/neuware;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  550. ## Active all Hygon devices detection,
  551. ## works with (default) Hygon container runtime and privileged mode.
  552. ## See https://github.com/Project-HAMi/dcu-dcgm/blob/master/pkg/dcgm/include/rocm_smi.h.
  553. ## Runs:
  554. ## - With container runtime installed:
  555. ## [TODO, TBD]
  556. ## - Without container runtime installed:
  557. ## + Allowing privileged, try with:
  558. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /opt/hyhal:/opt/hyhal:ro -v /opt/dtk:/opt/dtk:ro -e ROCM_SMI_LIB_PATH=/opt/hyhal/lib -e ROCM_PATH=/opt/dtk ...
  559. ## + Disallowing privileged, try with:
  560. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro --group-add video -v /opt/hyhal:/opt/hyhal:ro -v /opt/dtk:/opt/dtk:ro -e ROCM_SMI_LIB_PATH=/opt/hyhal/lib -e ROCM_PATH=/opt/dtk ...
  561. ENV HYGON_VISIBLE_DEVICES="all" \
  562. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/opt/dtk;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  563. ## Active all Iluvatar devices detection,
  564. ## works with (default) Iluvatar container runtime and privileged mode.
  565. ## See https://github.com/Deep-Spark/ix-container-toolkit.
  566. ## Runs:
  567. ## - With container runtime installed:
  568. ## + If installed Iluvatar container runtime as default runtime, try with:
  569. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /usr/local/corex:/usr/local/corex:ro ...
  570. ## + If there are mulitple container runtimes installed, try with:
  571. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged --runtime iluvatar -v /usr/local/corex:/usr/local/corex:ro ...
  572. ## + Disallowing privileged, try with:
  573. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/corex:/usr/local/corex:ro ...
  574. ## - Without container runtime installed:
  575. ## + Allowing privileged, try with:
  576. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /usr/local/corex:/usr/local/corex:ro ...
  577. ## + Disallowing privileged, try with:
  578. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro -v /usr/local/corex:/usr/local/corex:ro ...
  579. ENV IX_VISIBLE_DEVICES="all" \
  580. COREX_HOME="/usr/local/corex" \
  581. LD_LIBRARY_PATH="/usr/local/corex/lib64:${LD_LIBRARY_PATH}" \
  582. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/usr/local/corex;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  583. ## Active all MetaX devices detection,
  584. ## works with (default) MetaX container runtime and privileged mode.
  585. ## See https://developer.metax-tech.com/api/client/document/preview/626/k8s/03_component.html#container-runtime.
  586. ## Runs:
  587. ## - With container runtime installed:
  588. ## [TODO, TBD]
  589. ## - Without container runtime installed:
  590. ## + Allowing privileged, try with:
  591. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged -v /opt/mxdriver:/opt/mxdriver:ro -v /opt/maca:/opt/maca:ro ...
  592. ## + Disallowing privileged, try with:
  593. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --security-opt seccomp=unconfined -v /dev:/dev:ro -v /opt/mxdriver:/opt/mxdriver:ro -v /opt/maca:/opt/maca:ro ...
  594. ENV LD_LIBRARY_PATH="/opt/maca/lib:/opt/mxdriver/lib:${LD_LIBRARY_PATH}" \
  595. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/opt/maca;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  596. ## Active all MThreads devices detection,
  597. ## works with (default) MThreads container runtime and privileged mode.
  598. ## See https://docs.mthreads.com/cloud-native/cloud-native-doc-online/install_guide.
  599. ## Runs:
  600. ## - With container runtime installed:
  601. ## + If installed MThreads container runtime as default runtime, try with:
  602. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged ...
  603. ## + If there are mulitple container runtimes installed, try with:
  604. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged --runtime mthreads ...
  605. ## + Disallowing privileged, try with:
  606. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ...
  607. ## - Without container runtime installed:
  608. ## [TODO, TBD]
  609. ENV MTHREADS_VISIBLE_DEVICES="all" \
  610. MTHREADS_DRIVER_CAPABILITIES="compute,utility"
  611. ## Active all NVIDIA devices detection,
  612. ## works with (default) NVIDIA container runtime and privileged mode.
  613. ## See https://docs.nvidia.com/deploy/nvml-api/nvml-api-reference.html#nvml-api-reference.
  614. ## Runs:
  615. ## - With container runtime installed:
  616. ## + If installed NVIDIA container runtime as default runtime, try with:
  617. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged ...
  618. ## + If there are mulitple container runtimes installed, try with:
  619. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --privileged --runtime nvidia ...
  620. ## + Disallowing privileged, try with:
  621. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ...
  622. ## - Without container runtime installed:
  623. ## [TODO, TBD]
  624. ENV NVIDIA_DISABLE_REQUIRE="true" \
  625. NVIDIA_VISIBLE_DEVICES="all" \
  626. NVIDIA_DRIVER_CAPABILITIES="compute,utility"
  627. ## Active all T-Head devices detection,
  628. ## works with (default) T-Head container runtime and privileged mode.
  629. ## See https://help.aliyun.com/document_detail/2996754.html.
  630. ## Runs:
  631. ## - With container runtime installed:
  632. ## [TODO, TBD]
  633. ## - Without container runtime installed:
  634. ## + Allowing privileged, try with:
  635. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e GPUSTACK_RUNTIME_DOCKER_RESOURCE_INJECTION_POLICY=CDI -v /var/run/cdi:/var/run/cdi --privileged -v /usr/local/PPU_SDK:/usr/local/PPU_SDK:ro ...
  636. ## + Disallowing privileged, try with:
  637. ## docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e GPUSTACK_RUNTIME_DOCKER_RESOURCE_INJECTION_POLICY=CDI -v /var/run/cdi:/var/run/cdi --security-opt seccomp=unconfined -v /dev:/dev:ro -v /usr/local/PPU_SDK:/usr/local/PPU_SDK:ro ...
  638. ENV PPU_HOME="/usr/local/PPU_SDK" \
  639. LD_LIBRARY_PATH="/usr/local/PPU_SDK/CUDA_SDK/lib64:/usr/local/PPU_SDK/lib:${LD_LIBRARY_PATH}" \
  640. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/usr/local/PPU_SDK;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}"
  641. ## Active GPUStack runtime mirrored deployment mode,
  642. ## if getting an error like, "Found multiple Containers with the same hostname ...",
  643. ## please use `--env GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME=...` to specify the exact container name.
  644. ##
  645. ARG GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS
  646. ## GPUSTACK_RUNTIME_LOG_EXCEPTION=false: Disable logging exceptions from gpustack-runtime.
  647. ## GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY=/var/run/cdi: Set CDI specs directory.
  648. ## GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT=true: Enable mirrored deployment mode.
  649. ## GPUSTACK_RUNTIME_DEPLOY_CORRECT_RUNNER_IMAGE=false: Disable auto correction of runner images.
  650. ## GPUSTACK_RUNTIME_DOCKER_IMAGE_NO_PULL_VISUALIZATION=true: Disable visualizating image pull progress, instead using simple logs.
  651. ## GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS: Configure filter labels for mirrored deployment.
  652. ## GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES: Declare volumes to be ignored during mirrored deployment.
  653. ENV GPUSTACK_RUNTIME_LOG_EXCEPTION="false" \
  654. GPUSTACK_RUNTIME_DEPLOY_CDI_SPECS_DIRECTORY="/var/run/cdi" \
  655. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT="true" \
  656. GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES="/var/run/cdi;${GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_VOLUMES}" \
  657. GPUSTACK_RUNTIME_DEPLOY_CORRECT_RUNNER_IMAGE="false" \
  658. GPUSTACK_RUNTIME_DOCKER_IMAGE_NO_PULL_VISUALIZATION="true" \
  659. GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS="${GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS}"
  660. COPY --chmod=755 pack/entrypoint.sh /usr/bin/entrypoint.sh
  661. WORKDIR /
  662. ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]