File size: 3,536 Bytes
b110593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

set -e

# Jump to root directory
cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. || exit 1

DOCKER_COMPOSE_FILE=docker-compose.yml
ADDITIONAL_SERVICES=()
if [[ "$*" == *--keycloak* ]]; then
  ADDITIONAL_SERVICES+=('keycloak')
fi
if [[ "$*" == *--transformers-passage-query* ]]; then
  ADDITIONAL_SERVICES+=('t2v-transformers-passage')
  ADDITIONAL_SERVICES+=('t2v-transformers-query')
elif [[ "$*" == *--transformers* ]]; then
  ADDITIONAL_SERVICES+=('t2v-transformers')
else 
  ADDITIONAL_SERVICES+=('contextionary')
fi
if [[ "$*" == *--contextionary* ]]; then
  ADDITIONAL_SERVICES+=('contextionary')
fi
if [[ "$*" == *--qna* ]]; then
  ADDITIONAL_SERVICES+=('qna-transformers')
fi
if [[ "$*" == *--sum* ]]; then
  ADDITIONAL_SERVICES+=('sum-transformers')
fi
if [[ "$*" == *--image* ]]; then
  ADDITIONAL_SERVICES+=('i2v-neural')
fi
if [[ "$*" == *--ner* ]]; then
  ADDITIONAL_SERVICES+=('ner-transformers')
fi
if [[ "$*" == *--spellcheck* ]]; then
  ADDITIONAL_SERVICES+=('text-spellcheck')
fi
if [[ "$*" == *--clip* ]]; then
  ADDITIONAL_SERVICES+=('multi2vec-clip')
fi
if [[ "$*" == *--bind* ]]; then
  ADDITIONAL_SERVICES+=('multi2vec-bind')
fi
if [[ "$*" == *--reranker* ]]; then
  ADDITIONAL_SERVICES+=('reranker-transformers')
fi
if [[ "$*" == *--gpt4all* ]]; then
  ADDITIONAL_SERVICES+=('t2v-gpt4all')
fi
if [[ "$*" == *--prometheus* ]]; then
  ADDITIONAL_SERVICES+=('prometheus')
  ADDITIONAL_SERVICES+=('grafana')
fi
if [[ "$*" == *--s3* ]]; then
  ADDITIONAL_SERVICES+=('backup-s3')
fi
if [[ "$*" == *--gcs* ]]; then
  ADDITIONAL_SERVICES+=('backup-gcs')
fi
if [[ "$*" == *--azure* ]]; then
  ADDITIONAL_SERVICES+=('backup-azure')
fi

docker compose -f $DOCKER_COMPOSE_FILE down --remove-orphans

rm -rf data data-node2 connector_state.json schema_state.json

docker compose -f $DOCKER_COMPOSE_FILE up -d "${ADDITIONAL_SERVICES[@]}"

if [[ "$*" == *--keycloak* ]]; then
  echo "Since you have specified the --keycloak option, we must now wait for"
  echo "keycloak to spin up, so that we can add some demo users"

  echo -n "Waiting "
  until curl --fail -s localhost:9090/auth; do
    echo -n .
    sleep 1
  done
  echo
  echo Keycloak is ready, now importing some users.
  ./tools/dev/keycloak/import_users.sh
fi

if [[ "$*" == *--transformers-passage-query* ]]; then
  echo "You have specified the --transformers-passage-query option. Starting up"
  echo "the t2v-transformers-passage and t2v-transformers-query model containers"
elif [[ "$*" == *--transformers* ]]; then
  echo "You have specified the --transformers option. Starting up"
  echo "the text2vec-transformers model container"
fi

if [[ "$*" == *--image* ]]; then
  echo "You have specified the --image option. Starting up"
  echo "the text2vec-contextionary model container with img2vec-image module"
fi

if [[ "$*" == *--s3* ]]; then
  echo "You have specified the --s3 option. Starting up"
  echo "the text2vec-contextionary model container with backup-s3 module"
fi

if [[ "$*" == *--gcs* ]]; then
  echo "You have specified the --gcs option. Starting up"
  echo "the text2vec-contextionary model container with backup-gcs module"
fi

if [[ "$*" == *--azure* ]]; then
  echo "You have specified the --azure option. Starting up"
  echo "the text2vec-contextionary model container with backup-azure module"
fi

echo "You can now run the dev version with: ./tools/dev/run_dev_server.sh or ./tools/dev/run_dev_server_no_network.sh"