ROCm / rocprofiler-compute

Advanced Profiling and Analytics for AMD Hardware
https://rocm.docs.amd.com/projects/omniperf/en/latest/
MIT License
135 stars 49 forks source link

Grafana Build Error: SWC module #186

Closed coleramos425 closed 1 year ago

coleramos425 commented 1 year ago

Describe the bug Upon attempting to build Grafana from the newest release, we received

....
ERROR in ./module.ts
Module build failed (from ../node_modules/swc-loader/src/index.js):
Error: failed to handle: base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other works, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.

webpack 5.88.2 compiled with 1 error in 5613 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c apt-get update &&     apt-get install -y apt-transport-https software-properties-common  adduser libfontconfig1 wget curl &&     wget https://dl.grafana.com/enterprise/release/grafana-enterprise_8.3.4_amd64.deb &&    dpkg -i grafana-enterprise_8.3.4_amd64.deb &&    echo "deb https://packages.grafana.com/enterprise/deb stable main" | tee -a /etc/apt/sources.list.d/grafana.list &&     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list &&     apt-get install gnupg &&     wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc -O server-5.0.asc &&    apt-key add server-5.0.asc &&     echo "deb [trusted=yes arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org.list &&     wget -q -O - https://packages.grafana.com/gpg.key | apt-key add - &&     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg > /dev/null &&     apt-get update &&     apt-get install -y mongodb-org                                      &&     apt-get install -y tzdata systemd apt-utils npm vim net-tools      &&     mkdir -p /nonexistent                                               &&     /usr/sbin/grafana-cli plugins install michaeldmoore-multistat-panel &&     /usr/sbin/grafana-cli plugins install ae3e-plotly-panel             &&     /usr/sbin/grafana-cli plugins install natel-plotly-panel            &&     /usr/sbin/grafana-cli plugins install grafana-image-renderer        &&     curl -fsSL https://deb.nodesource.com/setup_16.x | bash -           &&     apt-get install -y yarn nodejs                                      &&     chown root:grafana /etc/grafana                                     &&     cd /var/lib/grafana/plugins/omniperfData_plugin                       &&     npm install                                                         &&     npm run build                                                       &&     apt-get autoremove -y                                               &&     apt-get autoclean -y                                                &&     cd /var/lib/grafana/plugins/custom-svg                              &&     yarn install                                                        &&     yarn build                                                          &&     yarn autoclean                                                      &&     sed -i "s/  bindIp.*/  bindIp: 0.0.0.0/" /etc/mongod.conf           &&     mkdir -p /var/lib/grafana                        &&     touch /var/lib/grafana/grafana.lib                   &&     chown grafana:grafana /var/lib/grafana/grafana.lib           &&     rm /app/grafana-enterprise_8.3.4_amd64.deb /app/server-5.0.asc' returned a non-zero code: 1
Service 'web' failed to build : Build failed

Development Environment:

To Reproduce Steps to reproduce the behavior:

$ wget https://github.com/AMDResearch/omniperf/releases/download/v1.0.10/omniperf-v1.0.10.tar.gz
$ tar -zxvf <download>
$ sudo docker build

Additional context See attached log docker-compose.txt

CC: @jakurzak

coleramos425 commented 1 year ago

Credit to @JoseSantosAMD for discovering the issue:

It appears this is related to a known issue with Grafana's @swc/core module bugged in version 1.3.76 https://stackoverflow.com/questions/76884057/grafana-build-a-panel-plugin-from-template-error

We're trying a suggested downgrade to a stable version to fix the issue

coleramos425 commented 1 year ago

We've confirmed this fix with the customer. The patch is available in dev and will be pushed out next release.