-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest-docker.sh
More file actions
67 lines (53 loc) · 1.84 KB
/
Copy pathtest-docker.sh
File metadata and controls
67 lines (53 loc) · 1.84 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
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Test script for TealTiger Python SDK Docker images
set -e
echo "🐳 Testing TealTiger Python SDK Docker Images"
echo "=============================================="
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Test function
test_image() {
local variant=$1
local dockerfile=$2
echo ""
echo "Testing $variant variant..."
# Build image
echo " Building image..."
docker build -t tealtiger/python-sdk:test-$variant -f $dockerfile . > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e " ${GREEN}✓${NC} Build successful"
else
echo -e " ${RED}✗${NC} Build failed"
return 1
fi
# Test import
echo " Testing imports..."
docker run --rm tealtiger/python-sdk:test-$variant \
python -c "import tealtiger; from tealtiger import TealOpenAI, GuardrailEngine; print('OK')" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e " ${GREEN}✓${NC} Imports successful"
else
echo -e " ${RED}✗${NC} Import failed"
return 1
fi
# Check image size
local size=$(docker images tealtiger/python-sdk:test-$variant --format "{{.Size}}")
echo " Image size: $size"
# Cleanup
docker rmi tealtiger/python-sdk:test-$variant > /dev/null 2>&1
echo -e " ${GREEN}✓${NC} $variant variant passed all tests"
}
# Run tests
test_image "production" "Dockerfile"
test_image "dev" "Dockerfile.dev"
test_image "alpine" "Dockerfile.alpine"
test_image "jupyter" "Dockerfile.jupyter"
echo ""
echo -e "${GREEN}✓${NC} All Docker images tested successfully!"
echo ""
echo "Next steps:"
echo " 1. Push images to registry: docker-compose push"
echo " 2. Test with examples: docker run tealtiger/python-sdk:latest python /app/examples/gemini_basic.py"
echo " 3. See DOCKER.md for more usage examples"