images: avoid huge image deltas

Multiple deltas are uploaded/downloaded in parallel.

PiperOrigin-RevId: 613592397
This commit is contained in:
Andrei Vagin
2024-03-07 08:29:51 -08:00
committed by gVisor bot
parent 4266145bad
commit 02000395de
2 changed files with 37 additions and 17 deletions
+13 -17
View File
@@ -5,24 +5,20 @@ ENV PATH=$PATH:/usr/local/nvidia/bin:/bin/nvidia/bin
ENV OLLAMA_ORIGINS=*
ENV OLLAMA_HOST=0.0.0.0:11434
COPY pull.sh /tmp
# Pre-install models useful for benchmarking.
# These are huge (total ~120 GiB), but necessary to benchmark
# models of various sizes. They are in their own image file to
# keep the test-only image lighter by comparison.
RUN bash -c ' \
( ollama serve ) & serverpid="$!"; \
sleep 5; \
ollama pull codellama:7b-instruct && \
ollama pull codellama:34b-instruct && \
ollama pull llama2-chinese:7b-chat && \
ollama pull llama2:13b-chat && \
ollama pull llama2:70b-chat && \
ollama pull mistral:7b-instruct && \
ollama pull mixtral:instruct && \
ollama pull gemma:2b-instruct && \
ollama pull gemma:7b-instruct && \
ollama pull llava:7b-v1.6 && \
ollama pull llava:34b-v1.6 && \
kill "$serverpid" && \
wait "$serverpid" \
'
RUN /tmp/pull.sh codellama:7b-instruct
RUN /tmp/pull.sh codellama:34b-instruct
RUN /tmp/pull.sh llama2-chinese:7b-chat
RUN /tmp/pull.sh llama2:13b-chat
RUN /tmp/pull.sh llama2:70b-chat
RUN /tmp/pull.sh mistral:7b-instruct
RUN /tmp/pull.sh mixtral:instruct
RUN /tmp/pull.sh gemma:2b-instruct
RUN /tmp/pull.sh gemma:7b-instruct
RUN /tmp/pull.sh llava:7b-v1.6
RUN /tmp/pull.sh llava:34b-v1.6
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# Copyright 2024 The gVisor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -xe
ollama serve &
serverpid="$!"
sleep 5
ollama pull "$1"
kill "${serverpid}"
wait "${serverpid}"