-
Notifications
You must be signed in to change notification settings - Fork 14
/
check-deps.sh
executable file
·143 lines (133 loc) · 4.13 KB
/
check-deps.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
# Function to check if Java is installed and print its version
check_java() {
echo "============================"
echo "Checking Java installation:"
echo "============================"
if command -v java &> /dev/null
then
echo "Java is installed. Version details:"
java -version
else
echo "Java is not installed."
fi
echo ""
}
# Function to check if Ollama is installed and print its version
check_ollama() {
echo "==============================="
echo "Checking Ollama installation:"
echo "==============================="
if command -v ollama &> /dev/null
then
echo "Ollama is installed. Version details:"
ollama --version
else
echo "Ollama is not installed."
fi
echo ""
}
# Function to check if the llama3.1 model is pulled for Ollama
check_llama3_model() {
echo "========================================"
echo "Checking if llama3.1 model is pulled:"
echo "========================================"
if command -v ollama &> /dev/null
then
if ollama list | grep -q "llama3.1"
then
echo "llama3.1 model is pulled and available."
else
echo "llama3.1 model is not pulled. Please pull it using 'ollama pull llama3.1'."
fi
else
echo "Ollama is not installed, so the llama3.1 model cannot be checked."
fi
echo ""
}
# Function to check if the mxbai-embed-large model is pulled for Ollama
check_mxbai_embed_large_model() {
echo "========================================"
echo "Checking if mxbai-embed-large model is pulled:"
echo "========================================"
if command -v ollama &> /dev/null
then
if ollama list | grep -q "mxbai-embed-large"
then
echo "mxbai-embed-large model is pulled and available."
else
echo "mxbai-embed-large model is not pulled. Please pull it using 'ollama pull mxbai-embed-large'."
fi
else
echo "Ollama is not installed, so the mxbai-embed-large model cannot be checked."
fi
echo ""
}
# Function to check if the llava model is pulled for Ollama
check_llava_model() {
echo "========================================"
echo "Checking if llava model is pulled:"
echo "========================================"
if command -v ollama &> /dev/null
then
if ollama list | grep -q "llava"
then
echo "llava model is pulled and available."
else
echo "llava model is not pulled. Please pull it using 'ollama pull llava'."
fi
else
echo "Ollama is not installed, so the llava model cannot be checked."
fi
echo ""
}
# Function to check if Docker is installed and print its version
check_docker() {
echo "=============================="
echo "Checking Docker installation:"
echo "=============================="
if command -v docker &> /dev/null
then
echo "Docker is installed. Version details:"
docker --version
else
echo "Docker is not installed."
fi
echo ""
}
# Function to check if a Docker image is pulled
check_docker_image() {
local image=$1
echo "Checking Docker image: $image"
if docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "$image"
then
echo "Docker image $image is pulled."
else
echo "Docker image $image is not pulled. Please pull it using 'docker pull $image'."
fi
echo ""
}
# Function to check if HTTPie is installed and print its version
check_httpie() {
echo "==============================="
echo "Checking HTTPie installation:"
echo "==============================="
if command -v http &> /dev/null
then
echo "HTTPie is installed. Version details:"
http --version
else
echo "HTTPie is not installed."
fi
echo ""
}
# Run the functions to check for each software, the llama3 model, and Docker images
check_java
check_ollama
check_llama3_model
check_mxbai_embed_large_model
check_llava_model
check_docker
check_docker_image "pgvector/pgvector:pg16"
check_docker_image "dpage/pgadmin4:8.6"
check_httpie