-
Notifications
You must be signed in to change notification settings - Fork 245
Expand file tree
/
Copy pathstart_local.sh
More file actions
80 lines (68 loc) · 2.99 KB
/
Copy pathstart_local.sh
File metadata and controls
80 lines (68 loc) · 2.99 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
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Generate static env.config.js for UI app
envfile=/usr/share/nginx/html/env-config.js
echo "window.environment = {" > $envfile
if [[ -z "${REACT_APP_AZURE_CLIENT_ID}" ]]; then
echo "Environment variable REACT_APP_AZURE_CLIENT_ID is not defined, skipping"
else
echo " \"azureClientId\": \"${REACT_APP_AZURE_CLIENT_ID}\"," >> $envfile
fi
if [[ -z "${REACT_APP_AZURE_TENANT_ID}" ]]; then
echo "Environment variable REACT_APP_AZURE_TENANT_ID is not defined, skipping"
else
echo " \"azureTenantId\": \"${REACT_APP_AZURE_TENANT_ID}\"," >> $envfile
fi
if [[ -z "${REACT_APP_ENABLE_RBAC}" ]]; then
echo "Environment variable REACT_APP_ENABLE_RBAC is not defined, skipping"
else
echo " \"enableRBAC\": \"${REACT_APP_ENABLE_RBAC}\"," >> $envfile
fi
echo "}" >> $envfile
echo "Successfully generated ${envfile} with following content"
cat $envfile
# Start nginx
nginx
# Start API app
LISTENING_PORT="8000"
if [ "$REACT_APP_ENABLE_RBAC" == "true" ]; then
echo "RBAC flag configured and set to true, launch both rbac and reigstry apps"
if [ "x$PURVIEW_NAME" == "x" ]; then
echo "Purview flag is not configured, run SQL registry"
cd sql-registry
nohup uvicorn main:app --host 0.0.0.0 --port 18000 &
else
echo "Purview flag is configured, run Purview registry"
cd purview-registry
nohup uvicorn main:app --host 0.0.0.0 --port 18000 &
fi
echo "Run rbac app"
cd ../access_control
export RBAC_REGISTRY_URL="http://127.0.0.1:18000/api/v1"
export RBAC_API_BASE="${API_BASE}"
export RBAC_AAD_INSTANCE="https://login.microsoftonline.com"
export RBAC_API_CLIENT_ID="${REACT_APP_AZURE_CLIENT_ID}"
export RBAC_AAD_TENANT_ID="${REACT_APP_AZURE_TENANT_ID}"
export RBAC_API_AUDIENCE="${REACT_APP_AZURE_CLIENT_ID}"
export RBAC_CONNECTION_STR="${CONNECTION_STR}"
uvicorn main:app --host 0.0.0.0 --port $LISTENING_PORT
else
echo "RBAC flag not configured or not equal to true, only launch registry app"
if [ "x$PURVIEW_NAME" == "x" ]; then
echo "Purview flag is not configured, run SQL registry"
cd /usr/src/registry/sql-registry
# start redis with password, since Feathr requires Redis to have a password for now
nohup redis-server --requirepass foobared &
# nohup code-server --auth none &
nohup uvicorn main:app --host 0.0.0.0 --port $LISTENING_PORT &
# nohup /usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties &
# nohup /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties &
# TODO: move this to a more neutural folder since Redis doesn't have anything to do with Feathr
cd -
else
echo "Purview flag is configured, run Purview registry"
cd purview-registry
nohup uvicorn main:app --host 0.0.0.0 --port $LISTENING_PORT &
fi
fi
# start the notebooks
start-notebook.sh --ip='*' --NotebookApp.password='' --NotebookApp.token='' --no-browser