-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·57 lines (46 loc) · 1.66 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.66 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
if [[ "$CT_TOOL" == "" ]]; then
podman=$(podman -v 2>/dev/null | grep -c -i podman)
if [ "$podman" == "1" ]; then
CT_TOOL=podman
else
CT_TOOL=docker
echo "You are NOT using podman! Good luck!"
fi
fi
set -e
if [[ "$CT_TOOL" == "podman " ]]; then
extra_args="--pull=newer"
else
if [[ "$1" == "pull" ]]; then
echo "Force pulling new base images..."
extra_args="--pull"
fi
fi
export rocm_version="7.2.4"
export llama_build=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | jq -r '.tag_name')
export stable_diffusion_tag=$(curl -s https://api.github.com/repos/leejet/stable-diffusion.cpp/releases/latest | jq -r '.tag_name') && \
export llama_swap_version=$(curl -s https://api.github.com/repos/mostlygeek/llama-swap/releases/latest | jq -r '.tag_name')
echo $rocm_version > rocm_version.txt
echo $llama_build > llama_version.txt
echo $stable_diffusion_tag > sd_version.txt
echo $llama_swap_version > llama_swap_version.txt
llama_swap_build="${llama_swap_version//[[:alpha:]]}"
echo llama_build=$llama_build
echo stable_diffusion_tag=$stable_diffusion_tag
echo llama_swap_build=$llama_swap_build
if [[ "$llama_build" == "" || "$llama_build" == "stable_diffusion_tag" ]]; then
echo "ERROR: Unable to get the latest builds info!"
exit 1
fi
if [[ "$GPU_TARGETS" ]];then
extra_args="$extra_args --build-arg GPU_TARGETS=$GPU_TARGETS"
fi
DOCKER_BUILDKIT=1 PODMAN_BUILDKIT=1 ${CT_TOOL} build $extra_args \
--target llama-lxc \
--build-arg llama_build=$llama_build \
--build-arg stable_diffusion_tag=$stable_diffusion_tag \
--build-arg llama_swap_build=$llama_swap_build \
--build-arg ROCM_VERSION=$rocm_version \
-t llama-lxc:latest .
set +e