Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an empty config file to produce docs #6092

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ docs/examples
docs/_src
docs/_projects
docs/tests
empty-config.yaml
39 changes: 22 additions & 17 deletions script/generate_config_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,30 +17,35 @@
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.

Check failure on line 21 in script/generate_config_docs.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

re-use ==> reuse
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
Expand Down
Loading