You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
In case of problems both scripts (create_ro_user.sh and create_psql_user.sh) support DROP=1, NOCREATE=1 env variables.
Leave psql shell, and get newest Kubernetes database dump:
wget https://devstats.cncf.io/gha.dump.
mv gha.dump /tmp.
sudo -u postgres pg_restore -d gha /tmp/gha.dump (restore DB dump)
rm /tmp/gha.dump
Databases installed, you need to test if all works fine, use database test coverage (on cncf/devstats repo):
PG_PASS=your_postgres_pwd make
Tests should pass.
We have both databases running and Go tools installed, let's try to sync database dump from k8s.devstats.cncf.io manually:
We need to prefix call with GHA2DB_LOCAL=1 to enable using tools from "./" directory
To import time-series data for the first time (Postgres database is at the state when Kubernetes SQL dump was made on k8s.devstats.cncf.io):
You need to have GitHub OAuth token, either put this token in /etc/github/oauth file or specify token value via GHA2DB_GITHUB_OAUTH=deadbeef654...10a0 (here you token value)
If you want to use multiple tokens, create /etc/github/oauths file that contain list of comma separated OAuth keys or specify token values via GHA2DB_GITHUB_OAUTH=key1,key2,...,keyN
If you really don't want to use GitHub OAuth2 token, specify GHA2DB_GITHUB_OAUTH=- - this will force tokenless operation (via public API), it is a lot more rate limited than OAuth2 which gives 5000 API points/h
PG_PASS=pwd ONLY=kubernetes ./devel/reinit.sh
This can take a while (depending how old is psql dump gha.sql.xz on k8s.devstats.cncf.io. It is generated daily at 3:00 AM UTC.
Command should be successfull.
We need to setup cron job that will call sync every hour (10 minutes after 1:00, 2:00, ...)
You need to open crontab.entry file, it looks like this for single project setup (this is obsolete, please use devstats mode instead):
Second crontab entry is for automatic daily backup of GHA database.
Third crontab entry is for Continuous Deployment - this a Travis Web Hook listener server, it deploys project when specific conditions are met, details here.
You need to change "..." PG_PASS to the real postgres password value and copy this line.
You need to change "/path/to/your/GOPATH/bin" to the value of "$GOPATH/bin", you cannot use $GOPATH in crontab directly.
Run crontab -e and put this line at the end of file and save.
Cron job will update Postgres database at 0:10, 1:10, ... 23:10 every day.
It outputs logs to /tmp/gha2db_sync.out and /tmp/gha2db_sync.err and also to gha Postgres database: into table gha_logs.
Check database values and logs about 15 minutes after full hours, like 14:15:
Check max event created date: select max(created_at) from gha_events and logs select * from gha_logs order by dt desc limit 20.
Go to Grafana UI (localhost:3000), choose sign out, and then access localhost:3000 again. You should be able to view dashboards as a guest. To login again use http://localhost:3000/login.