Requires
- macOS
- homebrew
- conda
git clone https://github.com/n-wbrown/archiver-datasource-backend
cd archiver-datasource-backend
git checkout release-share
TODO: Alternative may be to use nvm
in place of conda
brew install grafana go
conda create -n env python=3.8 nodejs=12.19.0 yarn
yarn install
yarn dev
yarn build
Add to ~/.bashrc:
cat >> ~/.bashrc <<'EOF'
export GOPATH="${HOME}/.go"
## export GOROOT="$(brew --prefix golang)/libexec"
export GOROOT=/usr/local/opt/go/libexec
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
test -d "${GOPATH}" || mkdir "${GOPATH}"
test -d "${GOPATH}/src/github.com" || mkdir -p "${GOPATH}/src/github.com"
EOF
go get -u -d github.com/magefile/mage
cd $GOPATH/src/github.com/magefile/mage
go run bootstrap.go
$ which mage
/Users/klauer/.go/bin/mage
go get -u github.com/grafana/grafana-plugin-sdk-go
mage -v
mage -l
## ls dist/gpx*
## set plugin directory, allow unsigned loading
sed -i -e 's#^;plugins =.*$#plugins = /usr/local/var/lib/grafana/plugins/#' /usr/local/etc/grafana/grafana.ini
sed -i -e 's/;allow_loading_unsigned_plugins =.*$/allow_loading_unsigned_plugins = slac-national-accelerator-laboratory-archiver-datasource-backend/' /usr/local/etc/grafana/grafana.ini
## ll /usr/local/var/lib/grafana/plugins/
Using the development version by way of a soft link:
ln -sf $PWD/dist /usr/local/var/lib/grafana/plugins/gpx_archiver
Add to ~/.ssh/config
:
Host pslogin-arch
HostName pslogin.slac.stanford.edu
# Archiver API:
LocalForward 17668 pscaa02:17668
SSH to forward 17668:
ssh pslogin-arch
grafana-osx
If using SSH settings above, set as URL:
http://localhost:17668/retrieval
If you checked out the wrong branch or need to rebuild after doing the above:
yarn install
yarn build
Remove the above soft link, if necessary:
rm -f /usr/local/var/lib/grafana/plugins/gpx_archiver
VERSION=0.0.5
wget https://github.com/n-wbrown/archiver-datasource-backend/releases/download/${VERSION}/archiver-datasource-backend.zip
unzip archiver-datasource-backend.zip -d /usr/local/var/lib/grafana/plugins/gpx_archiver