forked from kserve/kserve
-
Notifications
You must be signed in to change notification settings - Fork 40
chore: simplifies llm-d setup script #882
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
Open
bartoszmajsak
wants to merge
3
commits into
opendatahub-io:release-v0.15
Choose a base branch
from
bartoszmajsak:llm-d/chore/simplifies-llm-d-setup-script
base: release-v0.15
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| source "$SCRIPT_DIR/common.sh" | ||
| source "$SCRIPT_DIR/version.sh" | ||
| PROJECT_ROOT="$(find_project_root "$SCRIPT_DIR")" | ||
|
|
||
| WITH_KSERVE="true" | ||
| WITH_KUADRANT="false" | ||
|
|
||
| show_usage() { | ||
| cat <<EOF | ||
| Sets up llm-d pre-requisites on OpenShift: | ||
| - Cert Manager | ||
| - Leader Worker Set | ||
| - Gateway API configuration for Cluster Ingress Operator | ||
| - KServe | ||
| - Kuadrant/Red Hat Connectivity Link (optional) | ||
|
|
||
| Usage: $0 [OPTIONS] | ||
|
|
||
| Options: | ||
| --with-kserve[=true|false] Enable/disable KServe installation (default: ✅ true) | ||
| --with-kuadrant[=true|false] Enable/disable Kuadrant installation (default: ❌ false) | ||
| -h, --help Show this help message | ||
| EOF | ||
| } | ||
|
|
||
| parse_bool() { | ||
| case "$1" in | ||
| true|false) printf %s "$1" ;; | ||
| *) echo "Error: expected true|false, got '$1'" >&2; exit 1 ;; | ||
| esac | ||
| } | ||
|
|
||
| for arg in "$@"; do | ||
| case "$arg" in | ||
| --with-kserve) WITH_KSERVE=true ;; | ||
| --with-kserve=*) WITH_KSERVE="$(parse_bool "${arg#*=}")" ;; | ||
| --with-kuadrant) WITH_KUADRANT=true ;; | ||
| --with-kuadrant=*) WITH_KUADRANT="$(parse_bool "${arg#*=}")" ;; | ||
| -h|--help) show_usage; exit 0 ;; | ||
| *) echo "Error: Unknown option '$arg'"; show_usage; exit 1 ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "🔧 Configuration:" | ||
| echo " KServe deployment: $([ "$WITH_KSERVE" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" | ||
| echo " Kuadrant deployment: $([ "$WITH_KUADRANT" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" | ||
| echo "" | ||
|
|
||
| server_version=$(get_openshift_server_version) | ||
| min_version="4.19.9" | ||
| if is_version_newer "${server_version}" "${min_version}"; then | ||
| echo "✅ OpenShift version (${server_version}) is newer than ${min_version} - installing components..." | ||
| else | ||
| echo "❌ OpenShift version (${server_version}) older than ${min_version}. This is not supported environment." | ||
| exit 1 | ||
| fi | ||
|
|
||
| exit 0 | ||
bartoszmajsak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| $SCRIPT_DIR/infra/deploy.cert-manager.sh | ||
| $SCRIPT_DIR/infra/deploy.lws.sh | ||
|
|
||
| if [ "${WITH_KSERVE}" == "true" ]; then | ||
| kubectl create ns opendatahub || true | ||
|
|
||
| kubectl kustomize config/crd/ | kubectl apply --server-side=true -f - | ||
| wait_for_crd llminferenceserviceconfigs.serving.kserve.io 90s | ||
|
|
||
| kustomize build config/overlays/odh | kubectl apply --server-side=true --force-conflicts -f - | ||
| wait_for_pod_ready "opendatahub" "control-plane=kserve-controller-manager" 300s | ||
| fi | ||
|
|
||
| $SCRIPT_DIR/infra/deploy.gateway.ingress.sh | ||
|
|
||
| if [ "${WITH_KUADRANT}" == "true" ]; then | ||
| $SCRIPT_DIR/infra/deploy.kuadrant.sh | ||
| fi | ||
bartoszmajsak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, kserve will be installed so why we need to
Enablethe option?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kuadrant has the same behavior, but we need an option that does the reverse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to have consistent flags to avoid confusion. Before it was
--skip-kserve--deploy-kuadrant. Maybe having this flags aligned makes it more natural? WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should set Kuadrant’s default value to true, with the option to disable it using
--skip-kserveand--skip-kuadrant. While Kuadrant may not be necessary for LLMD development installations, having it enabled by default would be more useful for other scenarios.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the original behavior brought in #876. I "refactored" the flags logic, but kept it.
Are you suggesting to keep them both enabled instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. My suggestion is to have both enabled by default, and let users disable them with --skip-kserve and --skip-kuadrant if needed.