apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
978 stars 307 forks source link

[Bug report] Hugo Site does note compile correctly #878

Closed lisancao closed 10 months ago

lisancao commented 10 months ago

Describe what's wrong

When trying to build the hugo site in the docs using instructions on the docs/readme, the instructions are unclear in some parts and the hugo site does not compile correctly/generate the required configuration files. Seems to hangup on the file paths for the images. After running I can verify that the .md files do populate in /gravitino/docs/build/web/content/docs/. If you try running hugo server anyways it will throw a "no config file found" error since there is no config.toml file.

Error message and/or stacktrace

(base) lnc@LNC-ASUS-GL553VD:~/Documents/repos/gravitino$ ./docs/launch-docs-website.sh
++ dirname ./docs/launch-docs-website.sh
+ bin=./docs
++ cd ./docs
++ pwd
+ bin=/home/lnc/Documents/repos/gravitino/docs
+ USAGE='Usage: launch-docs-website.sh [update]'
++ uname -s
+ OS=Linux
+ '[' Linux == Darwin ']'
+ [[ Linux == \L\i\n\u\x ]]
+ HUGO_OS_NAME=linux-amd64
+ HUGO_VERSION=0.119.0
+ HUGO_PACKAGE_NAME=hugo_0.119.0_linux-amd64.tar.gz
+ HUGO_DOWNLOAD_URL=https://github.com/gohugoio/hugo/releases/download/v0.119.0/hugo_0.119.0_linux-amd64.tar.gz
+ [[ '' == \u\p\d\a\t\e ]]
+ [[ '' != '' ]]
+ launch_website
+ [[ ! -d /home/lnc/Documents/repos/gravitino/docs/build ]]
+ mkdir -p /home/lnc/Documents/repos/gravitino/docs/build
+ '[' '!' -f /home/lnc/Documents/repos/gravitino/docs/build/hugo ']'
+ wget -q -P /home/lnc/Documents/repos/gravitino/docs/build https://github.com/gohugoio/hugo/releases/download/v0.119.0/hugo_0.119.0_linux-amd64.tar.gz
+ tar -xzf /home/lnc/Documents/repos/gravitino/docs/build/hugo_0.119.0_linux-amd64.tar.gz -C /home/lnc/Documents/repos/gravitino/docs/build
+ rm -rf /home/lnc/Documents/repos/gravitino/docs/build/hugo_0.119.0_linux-amd64.tar.gz
+ cd /home/lnc/Documents/repos/gravitino/docs/build
+ rm -rf /home/lnc/Documents/repos/gravitino/docs/build/web
+ /home/lnc/Documents/repos/gravitino/docs/build/hugo new site web
Congratulations! Your new Hugo site was created in /home/lnc/Documents/repos/gravitino/docs/build/web.

Just a few more steps...

1. Change the current directory to /home/lnc/Documents/repos/gravitino/docs/build/web.
2. Create or install a theme:
   - Create a new theme with the command "hugo new theme <THEMENAME>"
   - Install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".

See documentation at https://gohugo.io/.
+ cd /home/lnc/Documents/repos/gravitino/docs/build/web
+ git clone https://github.com/datastratolabs/gohugo-theme-ananke.git themes/ananke
Cloning into 'themes/ananke'...
remote: Enumerating objects: 2335, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 2335 (delta 34), reused 77 (delta 31), pack-reused 2243
Receiving objects: 100% (2335/2335), 4.45 MiB | 5.77 MiB/s, done.
Resolving deltas: 100% (1285/1285), done.
+ echo 'languageCode = '\''en-us'\''
  title = '\''Gravitino Docs'\''
  theme = '\''ananke'\'''
+ copy_docs
+ [[ ! -d /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs ]]
+ mkdir -p /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs
+ rsync -av --exclude=README.md /home/lnc/Documents/repos/gravitino/docs/glossary.md /home/lnc/Documents/repos/gravitino/docs/gravitino-manage-hive.md /home/lnc/Documents/repos/gravitino/docs/gravitino-server-config.md /home/lnc/Documents/repos/gravitino/docs/gravitino-use-iceberg.md /home/lnc/Documents/repos/gravitino/docs/how-to-build.md /home/lnc/Documents/repos/gravitino/docs/how-to-sign-releases.md /home/lnc/Documents/repos/gravitino/docs/iceberg-rest-service.md /home/lnc/Documents/repos/gravitino/docs/integration-test.md /home/lnc/Documents/repos/gravitino/docs/overview.md /home/lnc/Documents/repos/gravitino/docs/publish-docker-images.md /home/lnc/Documents/repos/gravitino/docs/quick_start.md /home/lnc/Documents/repos/gravitino/docs/README.md /home/lnc/Documents/repos/gravitino/docs/security.md /home/lnc/Documents/repos/gravitino/docs/trino-gravitino-connector.md /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs
sending incremental file list
glossary.md
gravitino-manage-hive.md
gravitino-server-config.md
gravitino-use-iceberg.md
how-to-build.md
how-to-sign-releases.md
iceberg-rest-service.md
integration-test.md
overview.md
publish-docker-images.md
quick_start.md
security.md
trino-gravitino-connector.md

sent 79,221 bytes  received 263 bytes  158,968.00 bytes/sec
total size is 78,243  speedup is 0.98
++ find /home/lnc/Documents/repos/gravitino/docs -type d -mindepth 1 -maxdepth 1
find: warning: you have specified the global option -mindepth after the argument -type, but global options are not positional, i.e., -mindepth affects tests specified before it as well as those specified after it.  Please specify global options before other arguments.
find: warning: you have specified the global option -maxdepth after the argument -type, but global options are not positional, i.e., -maxdepth affects tests specified before it as well as those specified after it.  Please specify global options before other arguments.
+ subDirs='/home/lnc/Documents/repos/gravitino/docs/build
/home/lnc/Documents/repos/gravitino/docs/assets'
+ for subDir in ${subDirs}
+ [[ /home/lnc/Documents/repos/gravitino/docs/build != /home/lnc/Documents/repos/gravitino/docs/build ]]
+ for subDir in ${subDirs}
+ [[ /home/lnc/Documents/repos/gravitino/docs/assets != /home/lnc/Documents/repos/gravitino/docs/build ]]
+ [[ /home/lnc/Documents/repos/gravitino/docs/assets != /home/lnc/Documents/repos/gravitino/docs/assets ]]
+ cp -r /home/lnc/Documents/repos/gravitino/docs/assets /home/lnc/Documents/repos/gravitino/docs/build/web/static
+ hugo_image_path_process /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs
+ for file in ${1}/*
+ [[ -d /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs/glossary.md ]]
+ [[ -f /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs/glossary.md ]]
+ sed -i '' 's/!\[\](assets\//!\[\](\/assets\//g' /home/lnc/Documents/repos/gravitino/docs/build/web/content/docs/glossary.md
sed: can't read s/!\[\](assets\//!\[\](\/assets\//g: No such file or directory
(base) lnc@LNC-ASUS-GL553VD:~/Documents/repos/gravitino$ ls /docs/build/web/context/docs/
ls: cannot access '/docs/build/web/context/docs/': No such file or directory

How to reproduce

  1. Clone Gravitino repository from the main/default branch
  2. Navigate to docs/ folder
  3. Run ./launch-docs-website.sh

Specs:


OS: Ubuntu 22.04.3 LTS x86_64 Kernel: 5.15.0-89-generic
Shell: bash 5.1.16 DE: GNOME 42.9
Terminal: gnome-terminal CPU: Intel i5-7300HQ (4) @ 3.500GHz GPU: NVIDIA GeForce GTX 1050 Mobile GPU: Intel HD Graphics 630 Memory: 7930MiB / 11842MiB

Additional context

No response

jerryshao commented 10 months ago

This is mainly because macOS's sed is not GNU's sed, and we only make it work under macOS, so running this script under Linux will meet sed issue. I will fix it.