From 616dbdd86f7dd2cfcc43b9adeb5cd932ae8f7032 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Fri, 6 Dec 2024 17:05:42 -0500 Subject: [PATCH 1/2] Use an empty config file to produce docs Signed-off-by: Eduardo Apolinario --- .gitignore | 1 + script/generate_config_docs.sh | 39 +++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 6b280884f9..80120c5095 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ docs/examples docs/_src docs/_projects docs/tests +empty-config.yaml diff --git a/script/generate_config_docs.sh b/script/generate_config_docs.sh index 2a1485aed8..152c359211 100755 --- a/script/generate_config_docs.sh +++ b/script/generate_config_docs.sh @@ -3,7 +3,7 @@ set -e echo "Generating Flyte Configuration Documents" -CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +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 @@ -17,30 +17,35 @@ mv flyteadmin/bin/flytescheduler ${GOBIN}/scheduler make -C flytepropeller compile_flytepropeller mv flytepropeller/bin/flytepropeller ${GOBIN}/flytepropeller -output_config () { -CONFIG_NAME=$1 -COMPONENT=$2 -COMMAND=$3 -OUTPUT_PATH=${OUTPUT_DIR}/${COMMAND}_config.rst +# Config files are needed to generate docs, so we generate an empty +# file and re-use it to invoke the docs command in all components. +EMPTY_CONFIG_FILE=empty-config.yaml +touch empty-config.yaml -if [ -z "$CONFIG_NAME" ]; then - log_err "output_config CONFIG_NAME value not specified in arg1" - return 1 -fi +output_config() { + CONFIG_NAME=$1 + COMPONENT=$2 + COMMAND=$3 + OUTPUT_PATH=${OUTPUT_DIR}/${COMMAND}_config.rst -if [ -z "$COMPONENT" ]; then - log_err "output_config COMPONENT value not specified in arg2" - return 1 -fi + if [ -z "$CONFIG_NAME" ]; then + log_err "output_config CONFIG_NAME value not specified in arg1" + return 1 + fi -echo ".. _$COMPONENT-config-specification: + 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}" +" >"${OUTPUT_PATH}" -$GOBIN/$COMMAND config docs >> "${OUTPUT_PATH}" + $GOBIN/$COMMAND config --config $EMPTY_CONFIG_FILE docs >>"${OUTPUT_PATH}" } output_config "Admin" flyteadmin flyteadmin From 7df4eb748b8c344e3a0fc560037d456c615b8f96 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Fri, 6 Dec 2024 17:21:45 -0500 Subject: [PATCH 2/2] Fix typo Signed-off-by: Eduardo Apolinario --- script/generate_config_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/generate_config_docs.sh b/script/generate_config_docs.sh index 152c359211..e7358d9057 100755 --- a/script/generate_config_docs.sh +++ b/script/generate_config_docs.sh @@ -18,7 +18,7 @@ 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 re-use it to invoke the docs command in all components. +# file and reuse it to invoke the docs command in all components. EMPTY_CONFIG_FILE=empty-config.yaml touch empty-config.yaml