-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathstart
More file actions
executable file
·59 lines (48 loc) · 1.78 KB
/
start
File metadata and controls
executable file
·59 lines (48 loc) · 1.78 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
#!/usr/bin/env bash
if ! docker info &> /dev/null; then
echo "Docker must be running to start services"
exit 1
fi
help_function()
{
echo "
Usage: $0 [OPTIONS]
This script downloads the docker compose of a given release and merges it with \`docker-compose.override.yml\`
Options:
-s services. Space separated list of services to boot from the compose file. Options: [jupyter, dwh, ingestion, openmetadata-server] Default: none.
-v OpenMetadata version: Default [1.10.4]
-d Download: [true, false]. Forces downloading the OM docker compose if already downloaded. Default [false]
-h For usage help
"
exit 1 # Exit script after printing help
}
while getopts "v:d:s:h" opt
do
case "$opt" in
s ) services="$OPTARG" ;;
v ) version="$OPTARG" ;;
d ) download="$OPTARG" ;;
h ) help_function ;;
? ) help_function ;;
esac
done
version="${version:=1.10.4}"
download="${download:=false}"
if [[ ! -f openmetadata-compose.yml ]] || [[ "$download" == "true" ]]; then
source="https://github.com/open-metadata/OpenMetadata/releases/download/${version}-release/docker-compose.yml"
echo "Downloading openmetadata-compose.yml from $source"
curl -fsSL $source -o openmetadata-compose.yml
fi
docker compose -f openmetadata-compose.yml -f docker-compose.yml up $services -d
if [[ "$services" != "*jupyter*" ]] && [[ "$services" != "" ]]; then
exit 0
fi
while ! grep jupyter <(docker ps) &> /dev/null; do
echo "Waiting for jupyter container to be running"
sleep 1
done
url=""
while [[ "$url" == "" ]]; do
url="$(docker compose -f openmetadata-compose.yml -f docker-compose.yml exec jupyter bash -c "jupyter server list | grep /home/jovyan | sed \"s/\$(hostname)/localhost/g\" | awk 'NR==1 { print \$1 }'")"
done
echo "You can access \`jupyter\` instance at $url"