-
Notifications
You must be signed in to change notification settings - Fork 690
/
Copy pathgenerate_config_docs.sh
executable file
·54 lines (43 loc) · 1.59 KB
/
generate_config_docs.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
#!/usr/bin/env bash
set -e
echo "Generating Flyte Configuration Documents"
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
ROOT_DIR=${CUR_DIR}/..
OUTPUT_DIR="${ROOT_DIR}"/docs/deployment/configuration/generated
GOBIN=${GOPATH:-~/go}/bin
make -C datacatalog compile
mv datacatalog/bin/datacatalog ${GOBIN}/datacatalog
make -C flyteadmin compile
mv flyteadmin/bin/flyteadmin ${GOBIN}/flyteadmin
make -C flyteadmin compile_scheduler
mv flyteadmin/bin/flytescheduler ${GOBIN}/scheduler
make -C flytepropeller compile_flytepropeller
mv flytepropeller/bin/flytepropeller ${GOBIN}/flytepropeller
# Config files are needed to generate docs, so we generate an empty
# file and reuse it to invoke the docs command in all components.
EMPTY_CONFIG_FILE=empty-config.yaml
touch empty-config.yaml
output_config() {
CONFIG_NAME=$1
COMPONENT=$2
COMMAND=$3
OUTPUT_PATH=${OUTPUT_DIR}/${COMMAND}_config.rst
if [ -z "$CONFIG_NAME" ]; then
log_err "output_config CONFIG_NAME value not specified in arg1"
return 1
fi
if [ -z "$COMPONENT" ]; then
log_err "output_config COMPONENT value not specified in arg2"
return 1
fi
echo ".. _$COMPONENT-config-specification:
#########################################
Flyte $CONFIG_NAME Configuration
#########################################
" >"${OUTPUT_PATH}"
$GOBIN/$COMMAND config --config $EMPTY_CONFIG_FILE docs >>"${OUTPUT_PATH}"
}
output_config "Admin" flyteadmin flyteadmin
output_config "Propeller" flytepropeller flytepropeller
output_config "Datacatalog" flytedatacatalog datacatalog
output_config "Scheduler" flytescheduler scheduler