Dockerfile 34 KB

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