-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev_local.sh
executable file
·64 lines (50 loc) · 1.55 KB
/
dev_local.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
#!/bin/bash
# Run docker container containing DC2 ingest tools
# @author Fabrice Jammes
set -euo pipefail
DIR=$(cd "$(dirname "$0")"; pwd -P)
. "$DIR/env.sh"
usage() {
cat << EOD
Usage: $(basename "$0") [options]
Available options:
-h This message
Run docker container containing k8s management tools (helm,
kubectl, ...) and scripts.
EOD
}
# Get the options
while getopts h c ; do
case $c in
h) usage ; exit 0 ;;
\?) usage ; exit 2 ;;
esac
done
shift "$((OPTIND-1))"
if [ $# -ne 0 ] ; then
usage
exit 2
fi
TELEPRESENCE_VERSION="v2"
if telepresence version | grep "Client: $TELEPRESENCE_VERSION\." > /dev/null
then
echo "Check telepresence version==$TELEPRESENCE_VERSION"
else
>&2 echo "ERROR: telepresence v2 is required"
exit 3
fi
telepresence quit
telepresence connect
DEV_IMAGE="qserv/ingest-deps"
docker build --target ingest-deps -t "$DEV_IMAGE" "$DIR"
echo "Running in development mode"
MOUNTS="-v $DIR/rootfs/ingest:/ingest"
MOUNTS="$MOUNTS --volume $DIR:$HOME"
NAMESPACE=$(kubectl get sa -o=jsonpath='{.items[0]..metadata.namespace}')
echo "oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO"
echo " Welcome in qserv-ingest developement container"
echo " Setup for using Qserv in namespace $NAMESPACE"
echo "oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO"
echo "Example command:"
echo "replctl -vvv --config manifests/case01/configmap/ingest.yaml ingest --chunk-queue-fraction 5"
docker run --net=host --name qserv-ingest --dns-search $NAMESPACE -it $MOUNTS --rm -w "$HOME" "$DEV_IMAGE" bash