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

update for daily build doc: bug fix and review comments #203

Merged
merged 1 commit into from
Oct 14, 2024
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
21 changes: 15 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pwd
source $ENV_NAME/bin/activate

#clone repos
for repo_name in GenAIComps GenAIEval GenAIExamples GenAIInfra opea-project.github.io; do
for repo_name in docs GenAIComps GenAIEval GenAIExamples GenAIInfra opea-project.github.io; do
echo "prepare for $repo_name"

if [[ "$1" == "f" ]]; then
Expand All @@ -22,7 +22,6 @@ for repo_name in GenAIComps GenAIEval GenAIExamples GenAIInfra opea-project.gith

if [ ! -d ${repo_name} ]; then
URL=https://github.com/opea-project/${repo_name}.git

echo "git clone $URL"
git clone $URL
retval=$?
Expand All @@ -33,26 +32,36 @@ for repo_name in GenAIComps GenAIEval GenAIExamples GenAIInfra opea-project.gith
fi
sleep 10
else
echo "found existed repo folder ${repo_name}, skip to clone"
echo "repo ${repo_name} exists, skipping cloning"
fi
done

echo "Build HTML"
cd docs
make clean
make html
echo "Build online doc done!"

echo "update github.io"
if [ ! -d _build/html ]; then
echo "Build online doc is wrong!"
exit 1
else
echo "Build online doc done!"
fi

echo "Update github.io"

RELEASE_FOLDER=../opea-project.github.io
BUILDDIR=_build
PUBLISHDIR=${RELEASE_FOLDER}/latest

echo "Clear all content in ${PUBLISHDIR}"
rm -rf ${PUBLISHDIR}/*

echo "Copy html content to ${PUBLISHDIR}"
cp -r ${BUILDDIR}/html/* ${PUBLISHDIR}
cp scripts/publish-README.md ${PUBLISHDIR}/../README.md
bash scripts/publish-redirect.sh ${PUBLISHDIR}/../index.html latest/index.html
sed 's/<head>/<head>\n <base href="https:\/\/opea-project.github.io\/latest\/">/' ${BUILDDIR}/html/404.html > ${PUBLISHDIR}/../404.html

echo "CP html to ${PUBLISHDIR}"
echo "Copied html content to ${PUBLISHDIR}"

7 changes: 4 additions & 3 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sphinx_rtd_theme==2.0
sphinx-tabs==3.4.5
myst-parser>=3.0
sphinx-md==0.0.3
sphinxcontrib-mermaid
pymarkdownlnt
sphinx-design
sphinxcontrib-mermaid==0.9.2
pymarkdownlnt==0.9.24
sphinx-design==0.6.1
requirements-parser==0.11.0
2 changes: 1 addition & 1 deletion scripts/setup_env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

sudo apt install git doxygen graphviz -y
sudo apt install git graphviz -y

ENV_NAME=env_sphinx
deactivate
Expand Down
13 changes: 6 additions & 7 deletions scripts/show-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import os.path
import sys
import pkg_resources
import requirements
import subprocess

class color:
Expand All @@ -28,15 +28,14 @@ class color:

rf = open(reqfile, "r")

for reqs in pkg_resources.parse_requirements(rf):
for req in requirements.parse(rf):
try:
ver = pkg_resources.get_distribution(reqs.project_name).version
print (" " + reqs.project_name.ljust(25," ") + " version: " + ver)
if not reqs.__contains__(ver):
print(" {} version: {}".format(req.name.ljust(25," "), req.specs))
if len(req.specs) == 0:
print (color.RED + color.BOLD + " >>> Warning: Expected version " +
reqs.__str__() + " Python module from scripts/requirements.text." + color.END)
req.name + " Python module from scripts/requirements.text." + color.END)
except:
print (color.RED + color.BOLD + reqs.project_name + " is missing." + color.END +
print (color.RED + color.BOLD + req.name + " is missing." + color.END +
" (Hint: install all dependencies with " + color.YELLOW +
"\"pip3 install --user -r scripts/requirements.txt\"" + color.END + ")")

Expand Down