Skip to content

Update paths to GenAIInfra scripts #378

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

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 9 additions & 8 deletions .github/workflows/pr-path-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ jobs:
- name: Check the Validity of Hyperlinks
run: |
cd ${{github.workspace}}
timeout=15 # max connect timeout
fail="FALSE"
retry="FALSE"
# url_lines=$(grep -Eo '\]\(http[s]?://[^)]+\)' --include='*.md' -r .|grep -Ev 'linkedin')
merged_commit=$(git log -1 --format='%H')
changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')"
if [ -n "$changed_files" ]; then
for changed_file in $changed_files; do
url_lines=$(grep -H -Eo '\]\(http[s]?://[^)]+\)' "$changed_file" | grep -Ev 'linkedin') || true
url_lines=$(grep -H -Eo '\]\(http[s]?://[^)]+\)' "$changed_file" | sort -u | grep -Ev 'linkedin') || true
if [ -n "$url_lines" ]; then
for url_line in $url_lines; do
url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//')
Expand All @@ -39,10 +40,10 @@ jobs:
echo "Link "$url" from ${{github.workspace}}/$path need to be verified by a real person."
retry="FALSE"
else
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")
response=$(curl --connect-timeout $timeout -L -s -o /dev/null -w "%{http_code}" "$url")
if [ "$response" -ne 200 ]; then
echo "**********Validation failed, status code: $response, try again**********"
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
response_retry=$(curl --connect-timeout $timeout -s -o /dev/null -w "%{http_code}" "$url")
if [ "$response_retry" -eq 200 ]; then
echo "*****Retry successful*****"
else
Expand Down Expand Up @@ -105,15 +106,15 @@ jobs:
fail="FALSE"
repo_name=${{ github.event.pull_request.head.repo.full_name }}
if [ "$(echo "$repo_name"|cut -d'/' -f1)" != "opea-project" ]; then
owner=$(echo "${{ github.event.pull_request.head.repo.full_name }}" |cut -d'/' -f1)
branch="https://github.com/$owner/docs/tree/${{ github.event.pull_request.head.ref }}"
repo_fork=$(echo "${{ github.event.pull_request.head.repo.full_name }}" |cut -d/ -f-2)
branch="https://github.com/$repo_fork/tree/${{ github.event.pull_request.head.ref }}"
else
branch="https://github.com/opea-project/docs/blob/${{ github.event.pull_request.head.ref }}"
fi
link_head="https://github.com/opea-project/docs/blob/main"
merged_commit=$(git log -1 --format='%H')
changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')"
png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|grep -Ev 'http'|grep -Ev 'mailto'|grep -Ev 'portal.azure.com')
png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|sort -u|grep -Ev 'http'|grep -Ev 'mailto'|grep -Ev 'portal.azure.com')
if [ -n "$png_lines" ]; then
for png_line in $png_lines; do
refer_path=$(echo "$png_line"|cut -d':' -f1 | cut -d'/' -f2-)
Expand All @@ -138,12 +139,12 @@ jobs:
url_dev=$branch$(echo "$real_path" | sed 's|.*/docs||')$png_path
response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev")
if [ "$response" -ne 200 ]; then
echo "**********Validation failed, try again**********"
echo "**********Validation failed, status code: $response, try again**********"
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url_dev")
if [ "$response_retry" -eq 200 ]; then
echo "*****Retry successfully*****"
else
echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path, link: $url_dev"
echo "Status code: $response_retry => invalid path from ${{github.workspace}}/$refer_path: $png_path, link: $url_dev"
fail="TRUE"
fi
else
Expand Down
4 changes: 2 additions & 2 deletions tutorial/ChatQnA/deploy/k8s_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Some commonly used kubectl commands and their functions, assuming that you have

**Update Dependencies:**

- A script called **./update_dependency.sh** is provided which is used to update chart dependencies, ensuring all nested charts are at their latest versions.
- The command helm dependency update <chart-directory> updates the dependencies for the chart located in the specified directory (e.g., chatqna) based on the versions specified in its Chart.yaml file.
- `scripts/update_dependency.sh` script can be used to ensure that dependencies for `common/` charts are up to date.
- `helm dependency update <chart-directory>` command updates the dependencies for the specified chart directory (e.g., `chatqna`) based on the versions specified in its `Chart.yaml` file.

**Helm Install Command:**

Expand Down
2 changes: 1 addition & 1 deletion tutorial/ChatQnA/deploy/k8s_helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Next, we will update the dependencies for all Helm charts in the specified direc
```bash
# All Helm charts in the specified directory have their
# dependencies up-to-date, facilitating consistent deployments.
./update_dependency.sh
scripts/update_dependency.sh

# "chatqna" here refers to the directory name that contains the Helm
# chart for the ChatQnA application
Expand Down