cambridge-cares / TheWorldAvatar

A knowledge-graph-based digital twin of the world.
https://theworldavatar.io/
MIT License
84 stars 25 forks source link

Replace Superset with Grafana as stack built-in #944

Closed cmclscourtney closed 1 day ago

cmclscourtney commented 1 year ago

Grafana has proved more useful in projects than Superset. The following should be a good start for this. Ideally need to add uploading of dashboard configs too so will likely need a service type.

{
    "ServiceSpec": {
        "Name": "grafana",
        "TaskTemplate": {
            "ContainerSpec": {
                "Image": "grafana/grafana-oss:9.5.2",
                "Env": [
                    "GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/dashboard/",
                    "GF_SERVER_SERVE_FROM_SUB_PATH=true",
                    "GF_AUTH_ANONYMOUS_ENABLED=true",
                    "GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/grafana_password",
                    "GF_INSTALL_PLUGINS=volkovlabs-echarts-panel",
                    "GF_PATHS_CONFIG=/usr/share/grafana/custom/grafana-config.ini",
                    "GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer"
                ],
                "Secrets": [
                    {
                        "SecretName": "grafana_password"
                    }
                ],
                "Mounts": [
                    {
                        "Type": "volume",
                        "Source": "grafana-data",
                        "Target": "/var/lib/grafana",
                        "ReadOnly": false
                    },
                    {
                        "Type": "volume",
                        "Source": "grafana-conf",
                        "Target": "/usr/share/grafana/custom",
                        "ReadOnly": false
                    }
                ]
            }
        }
    },
    "endpoints": {
        "ui": {
            "url": "http://localhost:3000/",
            "externalPath": "/dashboard/"
        }
    }
}
mdhillman commented 1 year ago

I have tinkered with uploading dashboards via the Grafana API (there are some pre-upload steps that the stack uploader may need to do), happy to help if I can.

sm453 commented 10 months ago

Note #1017.