diff --git a/.github/workflows/update-citation.yml b/.github/workflows/update-citation.yml index 9211721c..30281d8d 100644 --- a/.github/workflows/update-citation.yml +++ b/.github/workflows/update-citation.yml @@ -41,13 +41,13 @@ jobs: # to push the changes to remote - uses: actions/create-github-app-token@v3 id: app-token - if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref == 'refs/heads/main' + if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref_type == 'tag' with: client-id: 4221824 private-key: ${{ secrets.APP_UPDATE_README_HELPER_PRIVATE_KEY }} - name: Commit changes - if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref == 'refs/heads/main' + if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref_type == 'tag' run: | git config --local user.email "bot@ceems.com" git config --local user.name "CEEMS bot" @@ -55,7 +55,7 @@ jobs: git commit -m "chore: Update version in CITATION.cff" -s - name: Push changes - if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref == 'refs/heads/main' + if: steps.verify-changed-files.outputs.files_changed == 'true' && github.ref_type == 'tag' uses: ad-m/github-push-action@master with: github_token: ${{ steps.app-token.outputs.token }} diff --git a/README.md b/README.md index 450bc5c6..20df60cb 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Installation instructions of CEEMS components can be found in ## 📽️ Demo -

+

Access Demo

@@ -70,12 +70,12 @@ consumption is estimated by assuming a Thermal Design Power (TDP) value and curr usage of the instance. Several dashboards have been created in Grafana for visualizing metrics which are listed below. -- [Overall usage of cluster](https://ceems-demo.myaddr.tools/d/adrenju36n2tcb/cluster-status?orgId=1&from=now-1h&to=now&timezone=browser&var-job=slurm&var-provider=rte&var-country_code=FR&refresh=15m) -- [Usage of different Projects/Accounts by SLURM and Openstack](https://ceems-demo.myaddr.tools/d/cdreu45pp9erkd/user-and-project-stats?orgId=1&from=now-90d&to=now&timezone=browser&refresh=15m) -- [Usage of Openstack resources by a given user and project](https://ceems-demo.myaddr.tools/d/be5x3it7gpx4wf/user-openstack-vm-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=pebbles&var-account=bedrock&var-provider=rte) -- [Usage of k8s resources by a given user and project](https://ceems-demo.myaddr.tools/d/eethlvcs613wgf/user-k8s-pods-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=bedrock:unknown&var-account=bedrock&var-provider=rte) -- [Usage of SLURM resources by a given user and project](https://ceems-demo.myaddr.tools/d/slurm-job-summary/user-slurm-job-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=arnold&var-account=bedrock&var-provider=rte) -- [Usage of LSF resources by a given user and project](https://ceems-demo.myaddr.tools/d/lsf-job-summary/user-lsf-job-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=barney&var-account=bedrock&var-provider=owid) +- [Overall usage of cluster](https://demo.ceems.dev/grafana/d/adrenju36n2tcb/cluster-status?orgId=1&from=now-1h&to=now&timezone=browser&var-job=slurm&var-provider=rte&var-country_code=FR&refresh=15m) +- [Usage of different Projects/Accounts by SLURM and Openstack](https://demo.ceems.dev/grafana/d/cdreu45pp9erkd/user-and-project-stats?orgId=1&from=now-90d&to=now&timezone=browser&refresh=15m) +- [Usage of Openstack resources by a given user and project](https://demo.ceems.dev/grafana/d/be5x3it7gpx4wf/user-openstack-vm-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=pebbles&var-account=bedrock&var-provider=rte) +- [Usage of k8s resources by a given user and project](https://demo.ceems.dev/grafana/d/eethlvcs613wgf/user-k8s-pods-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=bedrock:unknown&var-account=bedrock&var-provider=rte) +- [Usage of SLURM resources by a given user and project](https://demo.ceems.dev/grafana/d/slurm-job-summary/user-slurm-job-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=arnold&var-account=bedrock&var-provider=rte) +- [Usage of LSF resources by a given user and project](https://demo.ceems.dev/grafana/d/lsf-job-summary/user-lsf-job-summary?orgId=1&from=now-90d&to=now&timezone=browser&var-user=barney&var-account=bedrock&var-provider=owid) > [!WARNING] > All the dashboards provided in the demo instance are only meant to be for demonstrative diff --git a/go.mod b/go.mod index 486d46ee..b7689b5c 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/ceems-dev/perf-utils v0.0.0-20250716113832-99ba71e88ef4 github.com/cilium/ebpf v0.22.0 github.com/containerd/cgroups/v3 v3.1.3 + github.com/felixge/fgprof v0.9.5 github.com/go-chi/chi/v5 v5.5.0 github.com/go-chi/httprate v0.16.1 github.com/go-kit/log v0.2.1 diff --git a/go.sum b/go.sum index d28820d6..c22c31cc 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,12 @@ github.com/ceems-dev/pyroscope/ebpf v0.4.12-0.20260907155142-b0d0b2f6973b h1:vvo github.com/ceems-dev/pyroscope/ebpf v0.4.12-0.20260907155142-b0d0b2f6973b/go.mod h1:6D5qcb97IPmyOAB8DOS58WMTTEI/g9Qw/AZlWoVaBHw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs= +github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs= +github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/ebpf v0.22.0 h1:v2ktp0roffpMOj2MMf3idtCQZOsAoC4BJbAJN+ke2bY= github.com/cilium/ebpf v0.22.0/go.mod h1:CDzZbe2hC5JjlDC+CY3KFCzlYwN4gbxppYM+Z10bQt4= github.com/containerd/cgroups/v3 v3.1.3 h1:eUNflyMddm18+yrDmZPn3jI7C5hJ9ahABE5q6dyLYXQ= @@ -36,6 +42,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/felixge/fgprof v0.9.5 h1:8+vR6yu2vvSKn08urWyEuxx75NWPEvybbkBirEpsbVY= +github.com/felixge/fgprof v0.9.5/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= github.com/fxamacker/cbor/v2 v2.9.1 h1:2rWm8B193Ll4VdjsJY28jxs70IdDsHRWgQYAI80+rMQ= github.com/fxamacker/cbor/v2 v2.9.1/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/go-chi/chi/v5 v5.5.0 h1:xdKQ1dJmVJsmgahrXSKhUx8NyVPzpwdlyrrQFpMPJgg= @@ -86,6 +94,9 @@ github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAg github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6 h1:teYtXy9B7y5lHTp8V9KPxpYRAVA7dozigQcMiBust1s= github.com/go-quicktest/qt v1.101.1-0.20240301121107-c6c8733fa1e6/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= @@ -101,6 +112,7 @@ github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7O github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe h1:QAinXoAFJdGQYztXn3VpFey7KCwpedbZ/EkzbplQ0cY= github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -117,12 +129,14 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/ianlancetaylor/demangle v0.0.0-20251118225945-96ee0021ea0f h1:Fnl4pzx8SR7k7JuzyW8lEtSFH6EQ8xgcypgIn8pcGIE= github.com/ianlancetaylor/demangle v0.0.0-20251118225945-96ee0021ea0f/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/jedib0t/go-pretty/v6 v6.8.3 h1:yVSk5aemoYHCvcrtqyXklwqcgHQIQzmy/oUzFlmffSQ= github.com/jedib0t/go-pretty/v6 v6.8.3/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/jellydator/ttlcache/v3 v3.4.1 h1:bOdXmXiycyK6E6Qjyuj5vl+/vU3SCOoDs8a86NbHjAQ= github.com/jellydator/ttlcache/v3 v3.4.1/go.mod h1:j7LO12PNghFg5+0v9budMAT4rDK4JY969jb9vOdOBBk= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= @@ -141,8 +155,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U= @@ -169,6 +185,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/opencontainers/runtime-spec v1.3.0 h1:YZupQUdctfhpZy3TM39nN9Ika5CBWT5diQ8ibYCRkxg= github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25 h1:S1hI5JiKP7883xBzZAr1ydcxrKNSVNm7+3+JwjxZEsg= @@ -255,6 +272,8 @@ golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/5 golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= diff --git a/internal/security/manager.go b/internal/security/manager.go index dc91905d..652215f8 100644 --- a/internal/security/manager.go +++ b/internal/security/manager.go @@ -9,10 +9,12 @@ import ( "os" "os/user" "path/filepath" + "regexp" "slices" "strconv" "syscall" + "github.com/ceems-dev/ceems/internal/osexec" "github.com/steiler/acls" "github.com/wneessen/go-fileperm" "kernel.org/pub/linux/libs/security/libcap/cap" @@ -22,6 +24,9 @@ const ( deleteACLCtx = "delete_acl_entries" ) +// Systemd regex matcher. +var systemdVersionRegex = regexp.MustCompile(`(?m)systemd\s(\d+)`) + type deleteACLEntriesCtxData struct { acls []acl } @@ -46,6 +51,7 @@ type Manager struct { caps []cap.Value acls []acl securityContexts map[string]*SecurityContext + systemctlBinPath string } // NewManager returns a new instance of security manager. @@ -54,8 +60,9 @@ func NewManager(c *Config, logger *slog.Logger) (*Manager, error) { // Start a new instance of manager manager := &Manager{ - logger: logger, - caps: c.Caps, + logger: logger, + caps: c.Caps, + systemctlBinPath: "systemctl", } // Get current user @@ -221,7 +228,7 @@ func (m *Manager) DropPrivileges(enableEffective bool) error { // Get if the current process has any capabilities at all // by comparing against a new capability set // If no capabilities found, nothing to do, return - isPriv, err := existing.Cf(cap.NewSet()) + isPriv, err := existing.Cf(m.defaultCaps()) if err == nil && isPriv == 0 { return nil } @@ -368,6 +375,47 @@ func (m *Manager) pathsReachable() error { return nil } +// defaultCaps returns default capabilities a process should have. As of systemd >= 254, +// desktop environments will have cap_wake_alarm=i by default. +// Ref: https://github.com/systemd/systemd/issues/41386 +func (m *Manager) defaultCaps() *cap.Set { + // Get systemd version + output, err := osexec.ExecuteWithTimeout(m.systemctlBinPath, []string{"--version"}, 2, nil) + if err != nil { + m.logger.Warn("Failed to get systemd version", "err", err) + + return cap.NewSet() + } + + // Find matches + matches := systemdVersionRegex.FindStringSubmatch(string(output)) + if len(matches) == 2 { + // Convert version string to int + val, err := strconv.ParseInt(matches[1], 10, 64) + if err == nil { + // If systemd version is >= 254 and if we are in desktop environment, there + // will be cap_wake_alaram by default. + // This can happen when running with systemctl --user mode. But this is a + // edge case and there is no reason for people to run ceems_api_server + // in that mode. + // To detect if we are in headless or Desktop mode, use XDG_SESSION_DESKTOP + // which is more realiable than DISPLAY. + // Ref: https://superuser.com/questions/1074068/what-is-the-difference-between-desktop-session-xdg-session-desktop-and-xdg-cur/1643180#1643180 + // Ref: https://www.freedesktop.org/software/systemd/man/latest/pam_systemd.html + if val >= 254 && os.Getenv("XDG_SESSION_DESKTOP") != "" { + capSet, err := cap.FromText("cap_wake_alarm=i") + if err == nil { + return capSet + } + + return cap.NewSet() + } + } + } + + return cap.NewSet() +} + // DropCapabilities drops any existing capabilities on the process. func DropCapabilities() error { return setCapabilities(nil, false) diff --git a/internal/security/manager_test.go b/internal/security/manager_test.go index 57e5b9c1..abe5df9d 100644 --- a/internal/security/manager_test.go +++ b/internal/security/manager_test.go @@ -1,6 +1,7 @@ package security import ( + "fmt" "os" "os/user" "path/filepath" @@ -10,6 +11,7 @@ import ( "github.com/steiler/acls" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "kernel.org/pub/linux/libs/security/libcap/cap" ) func skipUnprivileged(t *testing.T) { @@ -98,6 +100,110 @@ func TestNewManager(t *testing.T) { require.Error(t, err) } +func TestDefaultCaps(t *testing.T) { + tmpDir := t.TempDir() + + // Expected in case of systemd >= 254 and in desktop env + capSet, err := cap.FromText("cap_wake_alarm=i") + require.NoError(t, err) + + // Empty capset + emptyCapSet := cap.NewSet() + + tests := []struct { + name string + cmdOut string + desktopEnv bool + expected *cap.Set + }{ + { + name: "systemd > 254 in Desktop env", + cmdOut: `systemd 259 (259.9-0ubuntu0.1) ++PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: true, + expected: capSet, + }, + { + name: "systemd = 254 in Desktop env", + cmdOut: `systemd 254 (254.9-0ubuntu0.1) ++PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: true, + expected: capSet, + }, + { + name: "systemd < 254 in Desktop env", + cmdOut: `systemd 252 (252.9-0ubuntu0.1) + +PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: true, + expected: emptyCapSet, + }, + { + name: "systemd > 254 in headless env", + cmdOut: `systemd 259 (259.9-0ubuntu0.1) + +PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: false, + expected: emptyCapSet, + }, + { + name: "systemd = 254 in headless env", + cmdOut: `systemd 254 (254.9-0ubuntu0.1) + +PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: false, + expected: emptyCapSet, + }, + { + name: "systemd < 254 in headless env", + cmdOut: `systemd 252 (252.9-0ubuntu0.1) + +PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: false, + expected: emptyCapSet, + }, + { + name: "no systemctl output", + desktopEnv: true, + expected: emptyCapSet, + }, + { + name: "illegal systemctl output", + cmdOut: `systemd sdfsd (254.9-0ubuntu0.1) + +PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE`, + desktopEnv: true, + expected: emptyCapSet, + }, + } + + // Make a new test config + c, err := testConfig(tmpDir) + require.NoError(t, err) + + // Make a new manager + m, err := NewManager(c, noOpLogger) + require.NoError(t, err) + + // Override systemctl path + m.systemctlBinPath = filepath.Join(tmpDir, "systemctl") + + for _, test := range tests { + // Write content of systemctl --version to file + content := fmt.Sprintf(`#!/bin/bash + +echo """%s"""`, test.cmdOut) + err = os.WriteFile(m.systemctlBinPath, []byte(content), 0o700) + require.NoError(t, err, test.name) + + // Set/Unset display env var + if test.desktopEnv { + t.Setenv("XDG_SESSION_DESKTOP", "KDE") + } else { + t.Setenv("XDG_SESSION_DESKTOP", "") + } + + // Get default caps + got := m.defaultCaps() + assert.Equal(t, test.expected, got, test.name) + } +} + func TestACLs(t *testing.T) { skipUnprivileged(t) diff --git a/pkg/api/base/base.go b/pkg/api/base/base.go index 1aa8f91d..cf4e4313 100644 --- a/pkg/api/base/base.go +++ b/pkg/api/base/base.go @@ -20,7 +20,7 @@ const CEEMSDBName = "ceems.db" // CEEMSServerApp is kinpin app. var CEEMSServerApp = *kingpin.New( CEEMSServerAppName, - "API server for reporting usage statistics for batchjobs/VMs/Pods.", + "API server for reporting usage statistics for SLURM, LSF, Openstack and Kubernetes workloads.", ) // DB table names. diff --git a/pkg/api/cli/cli.go b/pkg/api/cli/cli.go index cb4ddfa3..7e95fcad 100644 --- a/pkg/api/cli/cli.go +++ b/pkg/api/cli/cli.go @@ -13,6 +13,7 @@ import ( "path/filepath" "regexp" "runtime" + "strconv" "sync" "syscall" "time" @@ -97,7 +98,7 @@ func NewCEEMSServer() (*CEEMSServer, error) { // @description must send a user-agent header. // @description // @description A demo instance of CEEMS API server is provided for the users to test. This -// @description instance is running at `https://ceems-demo.myaddr.tools:6443` and it is the +// @description instance is running at `https://demo.ceems.dev/ceems/` and it is the // @description default server that will serve the requests originating from current OAS client. // @description // @description Some of the valid users for this demo instance are: @@ -124,26 +125,26 @@ func NewCEEMSServer() (*CEEMSServer, error) { // // @contact.name Mahendra Paipuri // @contact.url https://github.com/ceems-dev/ceems/issues -// @contact.email mahendra.paipuri@gmail.com +// @contact.email git@paipuri.com // // @license.name GPL-3.0 license // @license.url https://www.gnu.org/licenses/gpl-3.0.en.html // // @securityDefinitions.basic BasicAuth // -// @servers.url https://ceems-demo.myaddr.tools:6443/api/v1 +// @servers.url https://demo.ceems.dev/ceems/api/v1 // @servers.description Demo CEEMS API server URL. // -// @servers.url {scheme}://{host}:{port}{basepath} +// @servers.url {scheme}://{host}{port}{basepath} // @servers.description Current CEEMS API server URL. // @servers.variables.enum scheme http // @servers.variables.enum scheme https // @servers.variables.default scheme http // @servers.variables.default host localhost -// @servers.variables.default port 9020 +// @servers.variables.default port :9020 // @servers.variables.default basepath /api/v1 // -// @externalDocs.url https://ceems-dev.github.io/ceems/ +// @externalDocs.url https://ceems.dev/ // // @x-logo {"url": "https://raw.githubusercontent.com/ceems-dev/ceems/refs/heads/main/website/static/img/logo.png", "altText": "CEEMS logo"} func (b *CEEMSServer) Main() error { @@ -182,7 +183,7 @@ func (b *CEEMSServer) Main() error { b.App.Flag( "web.route-prefix", "Prefix for the internal routes of web endpoints.", - ).Default("/").StringVar(&routePrefix) + ).Default("").StringVar(&routePrefix) b.App.Flag( "web.max-requests", "Maximum number of requests allowed in 1 minute period per client identified by Real IP address. "+ @@ -226,7 +227,7 @@ func (b *CEEMSServer) Main() error { b.App.Flag( "web.external-url", "External URL at which CEEMS API server is reachable.", - ).Hidden().Default("").URLVar(&externalURL) + ).Hidden().URLVar(&externalURL) b.App.Flag( "web.user-header-name", "Username will be fetched from these headers. (default: X-Grafana-User).", @@ -375,6 +376,7 @@ func (b *CEEMSServer) Main() error { Text: "Health Status", }, }, + Profiling: strconv.FormatBool(enableDebugServer), }, }, DB: *dbConfig, diff --git a/pkg/api/docs/docs.go b/pkg/api/docs/docs.go index b775f9d8..85e69521 100644 --- a/pkg/api/docs/docs.go +++ b/pkg/api/docs/docs.go @@ -914,7 +914,7 @@ const docTemplate = `{ }, "info": { "contact": { - "email": "mahendra.paipuri@gmail.com", + "email": "git@paipuri.com", "name": "Mahendra Paipuri", "url": "https://github.com/ceems-dev/ceems/issues" }, @@ -932,7 +932,7 @@ const docTemplate = `{ }, "externalDocs": { "description": "", - "url": "https://ceems-dev.github.io/ceems/" + "url": "https://ceems.dev/" }, "paths": { "/clusters/admin": { @@ -1055,62 +1055,6 @@ const docTemplate = `{ ] } }, - "/health": { - "get": { - "description": "This health endpoint can be used to check on the health of the API server\nin containerised and Kubernetes environments.\n\nThis endpoint does not need any user header. However, if basic auth\nis enabled, authentication header must be provided to get status.", - "responses": { - "200": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "OK" - }, - "401": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "Unauthorized" - }, - "503": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "KO" - } - }, - "security": [ - { - "BasicAuth": [] - } - ], - "servers": [ - { - "description": "Demo CEEMS API server URL for health, swagger and debug endpoints only.", - "url": "https://ceems-demo.myaddr.tools:6443" - }, - { - "description": "Current CEEMS API server URL for health, swagger and debug endpoints only.", - "url": "{scheme}://{host}:{port}{basepath}" - } - ], - "summary": "Health check endpoint for API server.", - "tags": [ - "health" - ] - } - }, "/projects": { "get": { "description": "This endpoint will show details of the queried project of current user. The\ncurrent user is always identified by the header ` + "`" + `X-Grafana-User` + "`" + ` in\nthe request.\n\nThe details include list of users in that project. If current user\nattempts to query a project that they are not part of, empty response\nwill be returned\n", @@ -2226,11 +2170,11 @@ const docTemplate = `{ "servers": [ { "description": "Demo CEEMS API server URL.", - "url": "https://ceems-demo.myaddr.tools:6443/api/v1" + "url": "https://demo.ceems.dev/ceems/api/v1" }, { "description": "Current CEEMS API server URL.", - "url": "{scheme}://{host}:{port}{basepath}", + "url": "{scheme}://{host}{port}{basepath}", "variables": { "basepath": { "default": "/api/v1" @@ -2239,7 +2183,7 @@ const docTemplate = `{ "default": "localhost" }, "port": { - "default": "9020" + "default": ":9020" }, "scheme": { "default": "http", @@ -2257,7 +2201,7 @@ const docTemplate = `{ var SwaggerInfo = &swag.Spec{ Version: "1.0", Title: "CEEMS API", - Description: "OpenAPI specification (OAS) for the CEEMS REST API.\n\nSee the Interactive Docs to try CEEMS API methods without writing code, and get\nthe complete schema of resources exposed by the API.\n\nIf basic auth is enabled, all the endpoints require authentication.\n\nAll the endpoints, except `health`, `swagger`, `debug` and `demo`,\nmust send a user-agent header.\n\nA demo instance of CEEMS API server is provided for the users to test. This\ninstance is running at `https://ceems-demo.myaddr.tools:6443` and it is the\ndefault server that will serve the requests originating from current OAS client.\n\nSome of the valid users for this demo instance are:\n- arnold\n- betty\n- edna\n- gazoo\n- wilma\n\nEvery request must contain a `X-Grafana-User` header with one of the usernames\nabove as the value to the header. This is how CEEMS API server recognise the user.\n\nSome of the valid projects for this demo instance are:\n- bedrock\n- cornerstone\n\nDemo instance have CORS enabled to allow cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and\naccessible to everyone, including any code on any site.\n\nTo test admin resources, users can use `admin` as `X-Grafana-User`.\n\nTimestamps must be specified in milliseconds, unless otherwise specified.", + Description: "OpenAPI specification (OAS) for the CEEMS REST API.\n\nSee the Interactive Docs to try CEEMS API methods without writing code, and get\nthe complete schema of resources exposed by the API.\n\nIf basic auth is enabled, all the endpoints require authentication.\n\nAll the endpoints, except `health`, `swagger`, `debug` and `demo`,\nmust send a user-agent header.\n\nA demo instance of CEEMS API server is provided for the users to test. This\ninstance is running at `https://demo.ceems.dev/ceems/` and it is the\ndefault server that will serve the requests originating from current OAS client.\n\nSome of the valid users for this demo instance are:\n- arnold\n- betty\n- edna\n- gazoo\n- wilma\n\nEvery request must contain a `X-Grafana-User` header with one of the usernames\nabove as the value to the header. This is how CEEMS API server recognise the user.\n\nSome of the valid projects for this demo instance are:\n- bedrock\n- cornerstone\n\nDemo instance have CORS enabled to allow cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and\naccessible to everyone, including any code on any site.\n\nTo test admin resources, users can use `admin` as `X-Grafana-User`.\n\nTimestamps must be specified in milliseconds, unless otherwise specified.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", diff --git a/pkg/api/docs/swagger.json b/pkg/api/docs/swagger.json index 5f9a82d4..6b126318 100644 --- a/pkg/api/docs/swagger.json +++ b/pkg/api/docs/swagger.json @@ -907,11 +907,11 @@ }, "info": { "contact": { - "email": "mahendra.paipuri@gmail.com", + "email": "git@paipuri.com", "name": "Mahendra Paipuri", "url": "https://github.com/ceems-dev/ceems/issues" }, - "description": "OpenAPI specification (OAS) for the CEEMS REST API.\n\nSee the Interactive Docs to try CEEMS API methods without writing code, and get\nthe complete schema of resources exposed by the API.\n\nIf basic auth is enabled, all the endpoints require authentication.\n\nAll the endpoints, except `health`, `swagger`, `debug` and `demo`,\nmust send a user-agent header.\n\nA demo instance of CEEMS API server is provided for the users to test. This\ninstance is running at `https://ceems-demo.myaddr.tools:6443` and it is the\ndefault server that will serve the requests originating from current OAS client.\n\nSome of the valid users for this demo instance are:\n- arnold\n- betty\n- edna\n- gazoo\n- wilma\n\nEvery request must contain a `X-Grafana-User` header with one of the usernames\nabove as the value to the header. This is how CEEMS API server recognise the user.\n\nSome of the valid projects for this demo instance are:\n- bedrock\n- cornerstone\n\nDemo instance have CORS enabled to allow cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and\naccessible to everyone, including any code on any site.\n\nTo test admin resources, users can use `admin` as `X-Grafana-User`.\n\nTimestamps must be specified in milliseconds, unless otherwise specified.", + "description": "OpenAPI specification (OAS) for the CEEMS REST API.\n\nSee the Interactive Docs to try CEEMS API methods without writing code, and get\nthe complete schema of resources exposed by the API.\n\nIf basic auth is enabled, all the endpoints require authentication.\n\nAll the endpoints, except `health`, `swagger`, `debug` and `demo`,\nmust send a user-agent header.\n\nA demo instance of CEEMS API server is provided for the users to test. This\ninstance is running at `https://demo.ceems.dev/ceems/` and it is the\ndefault server that will serve the requests originating from current OAS client.\n\nSome of the valid users for this demo instance are:\n- arnold\n- betty\n- edna\n- gazoo\n- wilma\n\nEvery request must contain a `X-Grafana-User` header with one of the usernames\nabove as the value to the header. This is how CEEMS API server recognise the user.\n\nSome of the valid projects for this demo instance are:\n- bedrock\n- cornerstone\n\nDemo instance have CORS enabled to allow cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and\naccessible to everyone, including any code on any site.\n\nTo test admin resources, users can use `admin` as `X-Grafana-User`.\n\nTimestamps must be specified in milliseconds, unless otherwise specified.", "license": { "name": "GPL-3.0 license", "url": "https://www.gnu.org/licenses/gpl-3.0.en.html" @@ -925,7 +925,7 @@ }, "externalDocs": { "description": "", - "url": "https://ceems-dev.github.io/ceems/" + "url": "https://ceems.dev/" }, "paths": { "/clusters/admin": { @@ -1048,62 +1048,6 @@ ] } }, - "/health": { - "get": { - "description": "This health endpoint can be used to check on the health of the API server\nin containerised and Kubernetes environments.\n\nThis endpoint does not need any user header. However, if basic auth\nis enabled, authentication header must be provided to get status.", - "responses": { - "200": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "OK" - }, - "401": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "Unauthorized" - }, - "503": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "KO" - } - }, - "security": [ - { - "BasicAuth": [] - } - ], - "servers": [ - { - "description": "Demo CEEMS API server URL for health, swagger and debug endpoints only.", - "url": "https://ceems-demo.myaddr.tools:6443" - }, - { - "description": "Current CEEMS API server URL for health, swagger and debug endpoints only.", - "url": "{scheme}://{host}:{port}{basepath}" - } - ], - "summary": "Health check endpoint for API server.", - "tags": [ - "health" - ] - } - }, "/projects": { "get": { "description": "This endpoint will show details of the queried project of current user. The\ncurrent user is always identified by the header `X-Grafana-User` in\nthe request.\n\nThe details include list of users in that project. If current user\nattempts to query a project that they are not part of, empty response\nwill be returned\n", @@ -2219,11 +2163,11 @@ "servers": [ { "description": "Demo CEEMS API server URL.", - "url": "https://ceems-demo.myaddr.tools:6443/api/v1" + "url": "https://demo.ceems.dev/ceems/api/v1" }, { "description": "Current CEEMS API server URL.", - "url": "{scheme}://{host}:{port}{basepath}", + "url": "{scheme}://{host}{port}{basepath}", "variables": { "basepath": { "default": "/api/v1" @@ -2232,7 +2176,7 @@ "default": "localhost" }, "port": { - "default": "9020" + "default": ":9020" }, "scheme": { "default": "http", diff --git a/pkg/api/docs/swagger.yaml b/pkg/api/docs/swagger.yaml index e07a0e01..6ef0ecb3 100644 --- a/pkg/api/docs/swagger.yaml +++ b/pkg/api/docs/swagger.yaml @@ -704,10 +704,10 @@ components: type: http externalDocs: description: "" - url: https://ceems-dev.github.io/ceems/ + url: https://ceems.dev/ info: contact: - email: mahendra.paipuri@gmail.com + email: git@paipuri.com name: Mahendra Paipuri url: https://github.com/ceems-dev/ceems/issues description: |- @@ -722,7 +722,7 @@ info: must send a user-agent header. A demo instance of CEEMS API server is provided for the users to test. This - instance is running at `https://ceems-demo.myaddr.tools:6443` and it is the + instance is running at `https://demo.ceems.dev/ceems/` and it is the default server that will serve the requests originating from current OAS client. Some of the valid users for this demo instance are: @@ -845,45 +845,6 @@ paths: summary: Demo Units/Usage endpoints tags: - demo - /health: - get: - description: |- - This health endpoint can be used to check on the health of the API server - in containerised and Kubernetes environments. - - This endpoint does not need any user header. However, if basic auth - is enabled, authentication header must be provided to get status. - responses: - "200": - content: - text/plain: - schema: - type: string - description: OK - "401": - content: - text/plain: - schema: - type: string - description: Unauthorized - "503": - content: - text/plain: - schema: - type: string - description: KO - security: - - BasicAuth: [] - servers: - - description: Demo CEEMS API server URL for health, swagger and debug endpoints - only. - url: https://ceems-demo.myaddr.tools:6443 - - description: Current CEEMS API server URL for health, swagger and debug endpoints - only. - url: '{scheme}://{host}:{port}{basepath}' - summary: Health check endpoint for API server. - tags: - - health /projects: get: description: | @@ -1767,16 +1728,16 @@ paths: - users servers: - description: Demo CEEMS API server URL. - url: https://ceems-demo.myaddr.tools:6443/api/v1 + url: https://demo.ceems.dev/ceems/api/v1 - description: Current CEEMS API server URL. - url: '{scheme}://{host}:{port}{basepath}' + url: '{scheme}://{host}{port}{basepath}' variables: basepath: default: /api/v1 host: default: localhost port: - default: "9020" + default: :9020 scheme: default: http enum: diff --git a/pkg/api/http/middleware.go b/pkg/api/http/middleware.go index 64fa30c0..0bbb2856 100644 --- a/pkg/api/http/middleware.go +++ b/pkg/api/http/middleware.go @@ -6,7 +6,6 @@ import ( "context" "database/sql" "errors" - "fmt" "log/slog" "net/http" "net/url" @@ -19,39 +18,29 @@ import ( // Define our struct. type authenticationMiddleware struct { - logger *slog.Logger - whitelistedURLs *regexp.Regexp - db *sql.DB - cors *cors - headers []string - adminUsers func(context.Context, *sql.DB) ([]string, error) + logger *slog.Logger + db *sql.DB + cors *cors + headers []string + adminUsers func(context.Context, *sql.DB) ([]string, error) } // newAuthenticationMiddleware returns a new instance authenticationMiddleware. -func newAuthenticationMiddleware(routePrefix string, corsOrigin *regexp.Regexp, headers []string, db *sql.DB, logger *slog.Logger) (*authenticationMiddleware, error) { +func newAuthenticationMiddleware(corsOrigin *regexp.Regexp, headers []string, db *sql.DB, logger *slog.Logger) (*authenticationMiddleware, error) { // Setup CORS cors := newCORS(corsOrigin, headers) - // Playground: https://regex101.com/r/lkmsWz/3 - urlsRegex, err := regexp.Compile( - fmt.Sprintf("^(?:(%s)?)/(swagger|debug|health|demo)(.*)", strings.TrimSuffix(routePrefix, "/")), - ) - if err != nil { - return nil, err - } - // Check if atleast one header name is configured. if len(headers) == 0 { return nil, errors.New("no header names configured to fetch username") } return &authenticationMiddleware{ - logger: logger, - whitelistedURLs: urlsRegex, - db: db, - cors: cors, - headers: headers, - adminUsers: AdminUserNames, + logger: logger, + db: db, + cors: cors, + headers: headers, + adminUsers: AdminUserNames, }, nil } @@ -71,20 +60,6 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler goto end } - // If requested URI is one of the following, skip checking for user header - // - / - // - /health endpoint - // - /demo/* endpoint - // - /swagger/* endpoints - // - /debug/* endpoints - // - // NOTE that we only skip checking X-Grafana-User header. In prod when - // basic auth is enabled, all these end points are under auth and hence an - // unautorised user cannot access these end points - if r.URL.Path == "/" || amw.whitelistedURLs.MatchString(r.URL.Path) { - goto end - } - // Remove any X-Ceems-Admin-User header or X-Ceems-Logged-User if passed r.Header.Del(base.AdminUserHeader) r.Header.Del(base.LoggedUserHeader) diff --git a/pkg/api/http/middleware_test.go b/pkg/api/http/middleware_test.go index 87d0c9e4..4e3d7b26 100644 --- a/pkg/api/http/middleware_test.go +++ b/pkg/api/http/middleware_test.go @@ -21,7 +21,7 @@ func mockAdminUsers(_ context.Context, _ *sql.DB) ([]string, error) { func setupMiddleware() (http.Handler, error) { // Setup middileware - amw, err := newAuthenticationMiddleware("/api/v1", regexp.MustCompile("^(?:.*)$"), []string{base.GrafanaUserHeader}, nil, noOpLogger) + amw, err := newAuthenticationMiddleware(regexp.MustCompile("^(?:.*)$"), []string{base.GrafanaUserHeader}, nil, noOpLogger) if err != nil { return nil, err } @@ -38,15 +38,11 @@ func setupMiddleware() (http.Handler, error) { func TestNewMiddleware(t *testing.T) { // Valid route prefix - _, err := newAuthenticationMiddleware("/api/v1", regexp.MustCompile("^(?:.*)$"), []string{base.GrafanaUserHeader}, nil, noOpLogger) + _, err := newAuthenticationMiddleware(regexp.MustCompile("^(?:.*)$"), []string{base.GrafanaUserHeader}, nil, noOpLogger) require.NoError(t, err) - // Invald route prefix - _, err = newAuthenticationMiddleware("/(?!\\/)", regexp.MustCompile("^(?:.*)$"), []string{base.GrafanaUserHeader}, nil, noOpLogger) - require.Error(t, err) - // No user headers - _, err = newAuthenticationMiddleware("/api/v1", regexp.MustCompile("^(?:.*)$"), nil, nil, noOpLogger) + _, err = newAuthenticationMiddleware(regexp.MustCompile("^(?:.*)$"), nil, nil, noOpLogger) require.Error(t, err) } @@ -84,30 +80,6 @@ func TestMiddleware(t *testing.T) { header: true, admin: false, }, - { - name: "user accessing swagger resource", - method: http.MethodGet, - endpoint: "/swagger/index.html", - code: 200, - header: false, - admin: false, - }, - { - name: "user accessing debug resource", - method: http.MethodGet, - endpoint: "/debug/pprof", - code: 200, - header: false, - admin: false, - }, - { - name: "user accessing health resource", - method: http.MethodGet, - endpoint: "/health", - code: 200, - header: false, - admin: false, - }, { name: "user making preflight request", method: http.MethodOptions, diff --git a/pkg/api/http/server.go b/pkg/api/http/server.go index ef1dc654..1135dff3 100644 --- a/pkg/api/http/server.go +++ b/pkg/api/http/server.go @@ -14,9 +14,11 @@ import ( "log/slog" "net" "net/http" - _ "net/http/pprof" // #nosec + "net/http/pprof" "net/netip" "net/url" + "os" + "path" "path/filepath" "regexp" "slices" @@ -31,6 +33,7 @@ import ( "github.com/ceems-dev/ceems/pkg/api/docs" "github.com/ceems-dev/ceems/pkg/api/models" "github.com/ceems-dev/ceems/pkg/sqlite3" + "github.com/felixge/fgprof" "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/httprate" "github.com/gorilla/mux" @@ -38,6 +41,7 @@ import ( "github.com/prometheus/common/config" "github.com/prometheus/common/model" "github.com/prometheus/exporter-toolkit/web" + "github.com/stretchr/testify/assert/yaml" httpSwagger "github.com/swaggo/http-swagger/v2" ) @@ -58,6 +62,11 @@ const ( globalUsage = "global" ) +var ( + fgprofHandler = fgprof.Handler() + fgprofMu sync.Mutex +) + // WebConfig makes HTTP web config from CLI args. type WebConfig struct { Addresses []string @@ -210,7 +219,6 @@ func New(c *Config) (*CEEMSServer, error) { WriteTimeout: 10 * time.Second, ReadHeaderTimeout: 2 * time.Second, // slowloris attack: https://app.deepsource.com/directory/analyzers/go/issues/GO-S2112 }, - externalURL: c.Web.ExternalURL, webConfig: &web.FlagConfig{ WebListenAddresses: &c.Web.Addresses, WebSystemdSocket: &c.Web.WebSystemdSocket, @@ -231,32 +239,52 @@ func New(c *Config) (*CEEMSServer, error) { healthCheck: getDBStatus, } + // Calculate external URL + server.externalURL, err = computeExternalURL(c.Web.ExternalURL, c.Web.Addresses[0], c.Web.WebConfigFile) + if err != nil { + return nil, fmt.Errorf("failed to parse external URL %s: %w", c.Web.ExternalURL, err) + } + + // Default -web.route-prefix to path of -web.external-url. + if c.Web.RoutePrefix == "" { + c.Web.RoutePrefix = server.externalURL.Path + } else { + server.externalURL.Path = c.Web.RoutePrefix + } + + // RoutePrefix must always be at least '/'. + c.Web.RoutePrefix = "/" + strings.Trim(c.Web.RoutePrefix, "/") + // Get route prefix based on external URL path - var routePrefix string if c.Web.RoutePrefix != "/" { - routePrefix = fmt.Sprintf("%s/api/%s/", c.Web.RoutePrefix, base.APIVersion) - } else { - routePrefix = fmt.Sprintf("/api/%s/", base.APIVersion) + router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, c.Web.RoutePrefix+"/", http.StatusFound) + }) } - c.Logger.Debug("CEEMS API server running on prefix", "prefix", routePrefix) + webRouter := router.PathPrefix(c.Web.RoutePrefix).Subrouter() + + c.Logger.Debug("CEEMS API server running on prefix", "prefix", c.Web.RoutePrefix) // Make a landing page from config + landingConfig := c.Web.LandingConfig + landingConfig.RoutePrefix = c.Web.RoutePrefix + landingPage, err := web.NewLandingPage(*c.Web.LandingConfig) if err != nil { return nil, fmt.Errorf("failed to create landing page: %w", err) } // Landing page - router.Handle("/", landingPage) + webRouter.Handle("/", landingPage) // pprof debug end points. Expose them only on localhost if c.Web.EnableDebugServer { - router.PathPrefix("/debug/").Handler(http.DefaultServeMux).Methods(http.MethodGet).Host("localhost") + webRouter.HandleFunc(`/debug{subpath:[a-zA-Z0-9=\-\/]+}`, server.debug).Host("localhost") } // Swagger - router.PathPrefix("/swagger/").Handler(httpSwagger.Handler( + webRouter.PathPrefix("/swagger").Handler(httpSwagger.Handler( httpSwagger.URL("doc.json"), // The url pointing to API definition httpSwagger.DeepLinking(true), httpSwagger.DocExpansion("list"), @@ -264,29 +292,30 @@ func New(c *Config) (*CEEMSServer, error) { )) // Health endpoint - router.HandleFunc("/health", server.health) + webRouter.HandleFunc("/health", server.health) // Create a sub router with apiVersion as PathPrefix // Allow only GET and OPTIONS methods - subRouter := router.Methods(http.MethodGet, http.MethodOptions).PathPrefix(routePrefix).Subrouter() + apiRouter := router.Methods(http.MethodGet, http.MethodOptions).PathPrefix(path.Clean(fmt.Sprintf("%s/api/%s/", c.Web.RoutePrefix, base.APIVersion))).Subrouter() // Allow only GET methods - subRouter.HandleFunc("/"+usersResourceName, server.users) - subRouter.HandleFunc("/"+projectsResourceName, server.projects) - subRouter.HandleFunc("/"+unitsResourceName, server.units) - subRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}", usageResourceName), server.usage) - subRouter.HandleFunc(fmt.Sprintf("/%s/verify", unitsResourceName), server.verifyUnitsOwnership) + apiRouter.HandleFunc("/"+usersResourceName, server.users) + apiRouter.HandleFunc("/"+projectsResourceName, server.projects) + apiRouter.HandleFunc("/"+unitsResourceName, server.units) + apiRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}", usageResourceName), server.usage) + apiRouter.HandleFunc(fmt.Sprintf("/%s/verify", unitsResourceName), server.verifyUnitsOwnership) // Admin end points - subRouter.HandleFunc(fmt.Sprintf("/%s/admin", usersResourceName), server.usersAdmin) - subRouter.HandleFunc(fmt.Sprintf("/%s/admin", projectsResourceName), server.projectsAdmin) - subRouter.HandleFunc(fmt.Sprintf("/%s/admin", clustersResourceName), server.clustersAdmin) - subRouter.HandleFunc(fmt.Sprintf("/%s/admin", unitsResourceName), server.unitsAdmin) - subRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}/admin", usageResourceName), server.usageAdmin) - subRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}/admin", statsResourceName), server.statsAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/admin", usersResourceName), server.usersAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/admin", projectsResourceName), server.projectsAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/admin", clustersResourceName), server.clustersAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/admin", unitsResourceName), server.unitsAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}/admin", usageResourceName), server.usageAdmin) + apiRouter.HandleFunc(fmt.Sprintf("/%s/{mode:(?:current|global)}/admin", statsResourceName), server.statsAdmin) // A demo end point that returns mocked data for units and/or usage tables - subRouter.HandleFunc("/demo/{resource:(?:units|usage)}", server.demo) + demoRouter := router.Methods(http.MethodGet, http.MethodOptions).PathPrefix(path.Clean(fmt.Sprintf("%s/api/%s/", c.Web.RoutePrefix, base.APIVersion))).Subrouter() + demoRouter.HandleFunc("/demo/{resource:(?:units|usage)}", server.demo) // Open DB connection dsn := fmt.Sprintf( @@ -324,12 +353,12 @@ func New(c *Config) (*CEEMSServer, error) { } // Add a middleware that verifies headers and pass them in requests - amw, err := newAuthenticationMiddleware(routePrefix, c.Web.CORSOrigin, c.Web.UserHeaderNames, server.db, c.Logger) + amw, err := newAuthenticationMiddleware(c.Web.CORSOrigin, c.Web.UserHeaderNames, server.db, c.Logger) if err != nil { return nil, fmt.Errorf("failed to create middleware: %w", err) } - router.Use(amw.Middleware) + apiRouter.Use(amw.Middleware) // If compression is enabled, setup middleware if c.Web.EnableCompression { @@ -349,26 +378,22 @@ func New(c *Config) (*CEEMSServer, error) { // Start launches CEEMS HTTP server godoc. func (s *CEEMSServer) Start(_ context.Context) error { - // Set swagger info - docs.SwaggerInfo.BasePath = "/api/" + base.APIVersion - docs.SwaggerInfo.Schemes = []string{"http", "https"} - docs.SwaggerInfo.Host = s.server.Addr - - // If externalURL is set, use it for Swagger Host - if s.externalURL.Host != "" { - docs.SwaggerInfo.Host = s.externalURL.Host - docs.SwaggerInfo.Schemes = []string{s.externalURL.Scheme} - } - - // If externalURL is not set, ensure the server address is of good format. - host, port, err := net.SplitHostPort(docs.SwaggerInfo.Host) - if err == nil && host == "" { - docs.SwaggerInfo.Host = "localhost:" + port + // Replace the static server URL variables using current external URL + // This is sort of a hacky way to do as Swagger does not allow to override these + // variables using API + baseAPIPath := path.Clean(s.externalURL.Path + "/api/" + base.APIVersion) + docs.SwaggerInfo.SwaggerTemplate = strings.ReplaceAll(docs.SwaggerInfo.SwaggerTemplate, `"default": "/api/v1"`, fmt.Sprintf(`"default": "%s"`, baseAPIPath)) + + docs.SwaggerInfo.SwaggerTemplate = strings.ReplaceAll(docs.SwaggerInfo.SwaggerTemplate, `"default": "localhost"`, fmt.Sprintf(`"default": "%s"`, s.externalURL.Hostname())) + if s.externalURL.Port() != "" { + docs.SwaggerInfo.SwaggerTemplate = strings.ReplaceAll(docs.SwaggerInfo.SwaggerTemplate, `"default": ":9020"`, fmt.Sprintf(`"default": ":%s"`, s.externalURL.Port())) + } else { + docs.SwaggerInfo.SwaggerTemplate = strings.ReplaceAll(docs.SwaggerInfo.SwaggerTemplate, `"default": ":9020"`, `"default": ""`) } s.logger.Info("Starting " + base.CEEMSServerAppName) - err = web.ListenAndServe(s.server, s.webConfig, s.logger) + err := web.ListenAndServe(s.server, s.webConfig, s.logger) if err != nil && !errors.Is(err, http.ErrServerClosed) { s.logger.Error("Failed to Listen and Serve HTTP server", "err", err) @@ -435,32 +460,49 @@ func (s *CEEMSServer) setWriteDeadline(deadline time.Duration, w http.ResponseWr } } -// Health check godoc -// -// @Summary Health check endpoint for API server. -// @Description This health endpoint can be used to check on the health of the API server -// @Description in containerised and Kubernetes environments. -// @Description -// @Description This endpoint does not need any user header. However, if basic auth -// @Description is enabled, authentication header must be provided to get status. -// @servers.url https://ceems-demo.myaddr.tools:6443 -// @servers.description Demo CEEMS API server URL for health, swagger and debug endpoints only. -// @servers.url {scheme}://{host}:{port}{basepath} -// @servers.description Current CEEMS API server URL for health, swagger and debug endpoints only. -// @servers.variables.enum scheme http -// @servers.variables.enum scheme https -// @servers.variables.default scheme http -// @servers.variables.default host localhost -// @servers.variables.default port 9020 -// @servers.variables.default basepath /api/v1 -// @Security BasicAuth -// @Tags health -// @Produce plain -// @Success 200 {string} string "OK" -// @Failure 401 {string} string "Unauthorized" -// @Failure 503 {string} string "KO" -// @Router /health [get] -// +// GET /debug +// pprof and fgprof debug server. +func (s *CEEMSServer) debug(w http.ResponseWriter, r *http.Request) { + subpath := mux.Vars(r)["subpath"] + + if subpath == "/pprof" { + http.Redirect(w, r, r.URL.Path+"/", http.StatusMovedPermanently) //nolint: gosec + + return + } + + if !strings.HasPrefix(subpath, "/pprof/") { + http.NotFound(w, r) + + return + } + + subpath = strings.TrimPrefix(subpath, "/pprof/") + + switch subpath { + case "cmdline": + pprof.Cmdline(w, r) + case "profile": + pprof.Profile(w, r) + case "symbol": + pprof.Symbol(w, r) + case "trace": + pprof.Trace(w, r) + case "fgprof": + if !fgprofMu.TryLock() { + http.Error(w, "Could not enable fgprof profiling: fgprof profiling already in use", http.StatusInternalServerError) + + return + } + defer fgprofMu.Unlock() + + fgprofHandler.ServeHTTP(w, r) + default: + r.URL.Path = "/debug/pprof/" + subpath + pprof.Index(w, r) + } +} + // GET /health // Get health status of the server. func (s *CEEMSServer) health(w http.ResponseWriter, r *http.Request) { @@ -2163,3 +2205,64 @@ func convertTimeLocation(sourceLoc *time.Location, targetLoc *time.Location, val return val } + +// webConfigHasTLSServerConfig reports whether the web config file at path configures TLS, +// i.e. contains a tls_server_config section that sets at least one TLS-enabling field, as +// decided by exporter-toolkit's own TLSConfig.IsEnabled(). An empty path, or a file that +// cannot be read or parsed as YAML, is treated as not configuring TLS; a definitive error +// for such cases is reported later by toolkit_web.Validate. +func webConfigHasTLSServerConfig(path string) bool { + if path == "" { + return false + } + + data, err := os.ReadFile(path) + if err != nil { + return false + } + + var webConfig web.Config + + err = yaml.Unmarshal(data, &webConfig) + if err != nil { + return false + } + + return webConfig.TLSConfig.IsEnabled() +} + +// computeExternalURL computes a sanitized external URL from a raw input. It infers unset +// URL parts from the OS and the given listen address. When u is empty, the scheme of the +// inferred URL is set to https if webConfigFile configures TLS. +func computeExternalURL(u *url.URL, listenAddr string, webConfigFile string) (*url.URL, error) { + if u == nil || u.Scheme == "" || u.Host == "" { + hostname, err := os.Hostname() + if err != nil { + return nil, err + } + + _, port, err := net.SplitHostPort(listenAddr) + if err != nil { + return nil, err + } + + scheme := "http" + if webConfigHasTLSServerConfig(webConfigFile) { + scheme = "https" + } + + u = &url.URL{ + Scheme: scheme, + Host: fmt.Sprintf("%s:%s", hostname, port), + } + } + + ppref := strings.TrimRight(u.Path, "/") + if ppref != "" && !strings.HasPrefix(ppref, "/") { + ppref = "/" + ppref + } + + u.Path = ppref + + return u, nil +} diff --git a/pkg/api/http/server_test.go b/pkg/api/http/server_test.go index 785430ca..b04d0bc5 100644 --- a/pkg/api/http/server_test.go +++ b/pkg/api/http/server_test.go @@ -1004,3 +1004,132 @@ func TestUnitsHandlerWithUnituuidsQueryParams(t *testing.T) { // t.Errorf("expected usage %#v usage, got %#v", expectedUsage, response.Data) // } // } + +// Nicked from https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main_test.go#L179 +func TestComputeExternalURL(t *testing.T) { + tests := []struct { + externalURL *url.URL + listenAddr string + valid bool + }{ + { + externalURL: nil, + listenAddr: "0.0.0.0:9020", + valid: true, + }, + { + externalURL: &url.URL{}, + listenAddr: "0.0.0.0:9020", + valid: true, + }, + { + externalURL: &url.URL{}, + listenAddr: "0.0.0.0.9020", + valid: false, + }, + { + externalURL: &url.URL{Host: "localhost:9020", Path: "/ceems"}, + listenAddr: "0.0.0.0:9020", + valid: true, + }, + } + + for _, test := range tests { + _, err := computeExternalURL(test.externalURL, test.listenAddr, "") + if test.valid { + require.NoError(t, err) + } else { + require.Error(t, err, "externalURL=%q;listenAddr=%q", test.externalURL, test.listenAddr) + } + } +} + +func TestComputeExternalURLWithWebConfig(t *testing.T) { + dir := t.TempDir() + + tlsConfig := filepath.Join(dir, "web-config-tls.yml") + require.NoError(t, os.WriteFile(tlsConfig, []byte(` +tls_server_config: + cert_file: server.crt + key_file: server.key +`), 0o640)) + + basicAuthOnlyConfig := filepath.Join(dir, "web-config-basic-auth.yml") + require.NoError(t, os.WriteFile(basicAuthOnlyConfig, []byte(` +basic_auth_users: + alice: $2y$10$mDwo.lAisC94iLAyP81MCesa29IzH37oigHC/42V2pdJlUprsJPze +`), 0o640)) + + emptyTLSConfig := filepath.Join(dir, "web-config-empty-tls.yml") + require.NoError(t, os.WriteFile(emptyTLSConfig, []byte(` +tls_server_config: +`), 0o640)) + + nonEnablingTLSConfig := filepath.Join(dir, "web-config-non-enabling-tls.yml") + require.NoError(t, os.WriteFile(nonEnablingTLSConfig, []byte(` +tls_server_config: + min_version: TLS12 +`), 0o640)) + + tests := []struct { + name string + webConfigFile string + expectedScheme string + }{ + { + name: "no web config file", + webConfigFile: "", + expectedScheme: "http", + }, + { + name: "web config file with tls_server_config", + webConfigFile: tlsConfig, + expectedScheme: "https", + }, + { + name: "web config file without tls_server_config", + webConfigFile: basicAuthOnlyConfig, + expectedScheme: "http", + }, + { + name: "web config file with empty tls_server_config", + webConfigFile: emptyTLSConfig, + expectedScheme: "http", + }, + { + name: "web config file with tls_server_config setting only non-enabling fields", + webConfigFile: nonEnablingTLSConfig, + expectedScheme: "http", + }, + { + name: "nonexistent web config file", + webConfigFile: filepath.Join(dir, "does-not-exist.yml"), + expectedScheme: "http", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + u, err := computeExternalURL(&url.URL{}, "0.0.0.0:9020", test.webConfigFile) + require.NoError(t, err) + require.Equal(t, test.expectedScheme, u.Scheme) + }) + } +} + +// TestComputeExternalURLExplicitSchemeUnaffectedByWebConfig verifies that an explicitly +// provided --web.external-url is never overridden by TLS detection: only the inferred +// default URL (empty input) should have its scheme derived from the web config file. +func TestComputeExternalURLExplicitSchemeUnaffectedByWebConfig(t *testing.T) { + dir := t.TempDir() + tlsConfig := filepath.Join(dir, "web-config-tls.yml") + require.NoError(t, os.WriteFile(tlsConfig, []byte(` +tls_server_config: + cert_file: server.crt + key_file: server.key +`), 0o640)) + + u, err := computeExternalURL(&url.URL{Host: "example.com", Scheme: "http"}, "0.0.0.0:9090", tlsConfig) + require.NoError(t, err) + require.Equal(t, "http", u.Scheme) +} diff --git a/thirdparty/grafana/dashboards/k8s/k8s-pod-summary.json b/thirdparty/grafana/dashboards/k8s/k8s-pod-summary.json index 745aff05..0df99510 100644 --- a/thirdparty/grafana/dashboards/k8s/k8s-pod-summary.json +++ b/thirdparty/grafana/dashboards/k8s/k8s-pod-summary.json @@ -1,20 +1,20 @@ { "__inputs": [ { - "name": "VAR_ORGID", - "type": "constant", - "label": "Organization ID", - "value": "1", - "description": "Grafana Organization ID" - }, - { - "name": "DS_CEEMS-API", - "label": "CEEMS API Server's datasource", + "name": "DS_YESOREYERAM-INFINITY-DATASOURCE", + "label": "yesoreyeram-infinity-datasource", "description": "", "type": "datasource", "pluginId": "yesoreyeram-infinity-datasource", "pluginName": "Infinity" }, + { + "name": "VAR_ORGID", + "type": "constant", + "label": "Grafana Organization ID", + "value": "", + "description": "Grafana Organization ID" + }, { "name": "VAR_CLUSTERID", "type": "constant", @@ -42,7 +42,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.4.0" + "version": "13.3.0" }, { "type": "panel", @@ -72,7 +72,7 @@ "type": "datasource", "id": "yesoreyeram-infinity-datasource", "name": "Infinity", - "version": "3.0.0-beta.1" + "version": "4.1.4" } ], "annotations": { @@ -91,11 +91,10 @@ } ] }, - "description": "List of k8s pods", + "description": "List of Openstack VMs", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, "links": [ { "asDropdown": false, @@ -110,6 +109,7 @@ "url": "https://github.com/ceems-dev/ceems" } ], + "liveNow": false, "panels": [ { "collapsed": false, @@ -119,29 +119,27 @@ "x": 0, "y": 0 }, - "id": 9, - "panels": [], + "id": 53, "title": "Aggregate Usage Statistics of User ${user} from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", "type": "row" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Average usage statistics of all pods of the user", + "description": "Average usage statistics of all VMs of the user", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", - "value": null + "value": 0 }, { "color": "orange", @@ -165,6 +163,14 @@ }, "id": 10, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -175,11 +181,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -211,7 +222,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -278,21 +289,20 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Total energy consumption of all pods of the user", + "description": "Total energy consumption of all VMs of the user", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -328,7 +338,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -351,7 +361,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -368,10 +378,6 @@ "headers": [], "method": "GET", "params": [ - { - "key": "cluster_id", - "value": "${clusterId}" - }, { "key": "project", "value": "${account}" @@ -399,6 +405,10 @@ { "key": "field", "value": "username" + }, + { + "key": "cluster_id", + "value": "${clusterId}" } ] } @@ -466,27 +476,26 @@ "content": "# README\n\nThe panels to the left show the overall usage by the user\n**${user}** using the project **${account}**\nduring the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the pods\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the pods of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the pods\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host is the equivalent emissions due to the energy consumed by host components such as CPU, CPU memory and\n other peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Total emissions from the energy consumption of all pods of the user using emission factor from RTE eCO2 mix data", + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -522,7 +531,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -545,7 +554,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -616,14 +625,6 @@ { "alias": "Host owid", "path": "owid_total" - }, - { - "alias": "Host wt", - "path": "wt_total" - }, - { - "alias": "Host global", - "path": "global_total" } ], "source": "Host" @@ -645,14 +646,6 @@ { "alias": "GPU owid", "path": "owid_total" - }, - { - "alias": "GPU wt", - "path": "wt_total" - }, - { - "alias": "GPU global", - "path": "global_total" } ], "source": "GPU" @@ -710,25 +703,25 @@ "x": 0, "y": 13 }, - "id": 45, + "id": 54, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Average usage statistics of all pods of the user", + "description": "Average usage statistics of all VMs of the user", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "red" + "color": "red", + "value": 0 }, { "color": "orange", @@ -741,8 +734,7 @@ ] }, "unit": "percent" - }, - "overrides": [] + } }, "gridPos": { "h": 12, @@ -752,6 +744,14 @@ }, "id": 42, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -762,11 +762,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -798,7 +803,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -850,6 +855,10 @@ { "key": "field", "value": "username" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -861,20 +870,20 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Total energy consumption of all pods of the user", + "description": "Total energy consumption of all VMs of the user", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -883,8 +892,7 @@ ] }, "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 6, @@ -910,7 +918,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -933,7 +941,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -950,10 +958,6 @@ "headers": [], "method": "GET", "params": [ - { - "key": "cluster_id", - "value": "${clusterId}" - }, { "key": "project", "value": "${account}" @@ -977,6 +981,14 @@ { "key": "field", "value": "username" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -1028,10 +1040,6 @@ "type": "stat" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 12, "w": 8, @@ -1048,27 +1056,28 @@ "content": "# README\n\nThe panels to the left show the overall usage by the project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}. This includes\nthe usage of all the users in the project. For consulting only user specific usage,\nplease refer to the panels above.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the pods\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the pods of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the pods\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", + "targets": [], "title": "", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Total emissions from the energy consumption of all pods of the user using emission factor from RTE eCO2 mix data", + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -1077,14 +1086,13 @@ ] }, "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 6, "w": 8, "x": 8, - "y": 94 + "y": 20 }, "id": 50, "options": { @@ -1104,7 +1112,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1127,7 +1135,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1198,14 +1206,6 @@ { "alias": "Host owid", "path": "owid_total" - }, - { - "alias": "Host wt", - "path": "wt_total" - }, - { - "alias": "Host global", - "path": "global_total" } ], "source": "Host" @@ -1227,14 +1227,6 @@ { "alias": "GPU owid", "path": "owid_total" - }, - { - "alias": "GPU wt", - "path": "wt_total" - }, - { - "alias": "GPU global", - "path": "global_total" } ], "source": "GPU" @@ -1295,17 +1287,18 @@ "x": 0, "y": 14 }, - "id": 41, + "id": 55, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of each user in the project ${account}", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { @@ -1315,11 +1308,8 @@ "viz": false } }, - "fieldMinMax": false, - "mappings": [], "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1350,12 +1340,14 @@ "fields": "/^Total$/", "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1374,17 +1366,10 @@ "text": "GPU", "type": "number" } - ], - "computed_columns": [ - { - "selector": "Host+GPU", - "text": "Total", - "type": "string" - } ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -1439,14 +1424,28 @@ "title": "⚡ Total Energy Consumption by users of ${account} ⚡", "transformations": [ { - "id": "filterFieldsByName", + "id": "calculateField", "options": { - "include": { - "names": [ - "User", - "Total" - ] - } + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": false } } ], @@ -1455,12 +1454,13 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Total emissions from the energy consumption of all pods of the user using emission factor from RTE eCO2 mix data", + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { @@ -1470,10 +1470,8 @@ "viz": false } }, - "mappings": [], "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1501,104 +1499,40 @@ "calcs": [ "lastNotNull" ], - "fields": "", + "fields": "/^Total$/", "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ { - "selector": "total_cpu_emissions_gms.rte_total", - "text": "HostRTE", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.emaps_total", - "text": "HostEmaps", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.owid_total", - "text": "HostOWID", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.wt_total", - "text": "HostWT", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.global_total", - "text": "HostGlobal", - "type": "number" - }, - { - "selector": "total_gpu_emissions_gms.rte_total", - "text": "GPURTE", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.emaps_total", - "text": "GPUEmaps", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.owid_total", - "text": "GPUOWID", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.wt_total", - "text": "GPUWT", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.global_total", - "text": "GPUGlobal", - "type": "number" - }, - { - "selector": "username", - "text": "User", - "type": "string" - } - ], - "computed_columns": [ - { - "selector": "HostRTE+GPURTE", - "text": "rte", - "type": "string" - }, - { - "selector": "HostEmaps+GPUEmaps", - "text": "emaps", - "type": "string" - }, - { - "selector": "HostOWID+GPUOWID", - "text": "owid", + "selector": "total_cpu_emissions_gms", + "text": "Host", "type": "string" }, { - "selector": "HostWT+GPUWT", - "text": "wt", + "selector": "total_gpu_emissions_gms", + "text": "GPU", "type": "string" }, { - "selector": "HostGlobal+GPUGlobal", - "text": "global", + "selector": "username", + "text": "User", "type": "string" } ], + "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1653,23 +1587,92 @@ ], "title": "👣 Total Equivalent Emissions estimated using ${provider:text} by users of ${account} 👣", "transformations": [ + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "Host rte", + "path": "rte_total" + }, + { + "alias": "Host emaps", + "path": "emaps_total" + }, + { + "alias": "Host owid", + "path": "owid_total" + } + ], + "source": "Host" + } + }, + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "GPU rte", + "path": "rte_total" + }, + { + "alias": "GPU emaps", + "path": "emaps_total" + }, + { + "alias": "GPU owid", + "path": "owid_total" + } + ], + "source": "GPU" + } + }, { "id": "filterFieldsByName", "options": { "byVariable": false, "include": { - "pattern": "(${provider}|User)" + "pattern": "(((Host|GPU)\\s*${provider})|User)" + } + } + }, + { + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byType", + "options": "number" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "reduceRow", + "reduce": { + "reducer": "sum" } } + }, + { + "id": "renameByRegex", + "options": { + "regex": "(Host|GPU)(.*)", + "renamePattern": "$1" + } } ], "type": "piechart" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 10, "w": 8, @@ -1683,10 +1686,11 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "# README\n\nThe panels to the left show the breakdown of total energy consumption and\nequivalent emissions for project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Total energy consumption is sum of energy consumed by host and GPUs (if present)\nfor all pods ran during this period.\n\n- Total equivalent emissions is the sum of equivalent emissions from the energy\nconsumed by host and GPUs (if present) for all pods ran during this period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n", + "content": "# README\n\nThe panels to the left show the breakdown of total energy consumption and\nequivalent emissions for project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Total energy consumption is sum of energy consumed by host and GPUs (if present)\nfor all pods ran during this period.\n\n- Total equivalent emissions is the sum of equivalent emissions from the energy\nconsumed by host and GPUs (if present) for all VMs ran during this period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", + "targets": [], "title": "", "type": "text" } @@ -1702,14 +1706,14 @@ "x": 0, "y": 15 }, - "id": 32, + "id": 56, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "List of all k8s pods of user ${user} and all service accounts within namespace ${account}. By clicking the row, user will be redirected to the dashboard that shows the time series metrics of that pod.", + "description": "List of all k8s pods of user ${user} with project ${account}. By clicking the row, user will be redirected to the dashboard that shows the time series metrics of that pod.", "fieldConfig": { "defaults": { "color": { @@ -1718,26 +1722,28 @@ "custom": { "align": "left", "cellOptions": { - "type": "auto", - "wrapText": false + "type": "auto" }, "filterable": true, - "inspect": false + "footer": { + "reducers": [] + }, + "inspect": false, + "wrapText": false }, "links": [ { "targetBlank": true, - "title": "k8s Pod Metrics Dashboard", - "url": "/d/k8s-single-pod-metrics/_?orgId=${orgId}&var-uuid=${__data.fields.UUID}&from=${__data.fields.from}&to=${__data.fields.to}&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-start=${__data.fields.started_at_ts}&var-end=${__data.fields.ended_at_ts}&var-name=${__data.fields.Name}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-qos=${__data.fields.QoS}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-cpu_emissions_wt=${__data.fields[\"Host Emissions WTime (gms)\"]}&var-cpu_emissions_global=${__data.fields[\"Host Emissions World Avg. (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-gpu_emissions_wt=${__data.fields[\"GPU Emissions WTime (gms)\"]}&var-gpu_emissions_global=${__data.fields[\"GPU Emissions World Avg. (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}&var-total_emissions_wt=${__data.fields[\"Total Emissions WTime (gms)\"]}&var-total_emissions_global=${__data.fields[\"Total Emissions World Avg. (gms)\"]}" + "title": "Openstack VM Metrics Dashboard", + "url": "/d/k8s-pod-metrics/_?orgId=${orgId}&var-uuid=${__data.fields.UUID}&from=now-24h&to=now&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-start=${__data.fields.started_at_ts}&var-end=${__data.fields.ended_at_ts}&var-name=${__data.fields.Name}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}" } ], - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -1750,26 +1756,14 @@ { "matcher": { "id": "byRegexp", - "options": "/(created_at_ts|ended_at_ts|project|started_at_ts|from|to)/" + "options": "/(created_at_ts|ended_at_ts|project|started_at_ts)/" }, "properties": [ { - "id": "custom.hidden", + "id": "custom.hideFrom.viz", "value": true } ] - }, - { - "matcher": { - "id": "byName", - "options": "to" - }, - "properties": [ - { - "id": "noValue", - "value": "now" - } - ] } ] }, @@ -1777,29 +1771,22 @@ "h": 27, "w": 24, "x": 0, - "y": 26 + "y": 16 }, "id": 52, "options": { "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": true, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, + "enablePagination": true, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "Start Time" } - ] + ], + "zebraStriping": false }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1904,67 +1891,21 @@ "text": "Name", "type": "string" }, - { - "selector": "tags.qos", - "text": "QoS", - "type": "string" - }, - { - "selector": "total_cpu_emissions_gms.emaps_total", - "text": "Host Emissions EMaps (gms)", - "type": "number" - }, { "selector": "total_cpu_emissions_gms.owid_total", "text": "Host Emissions OWID (gms)", "type": "number" }, - { - "selector": "total_gpu_emissions_gms.emaps_total", - "text": "GPU Emissions EMaps (gms)", - "type": "number" - }, { "selector": "total_gpu_emissions_gms.owid_total", "text": "GPU Emissions OWID (gms)", "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.wt_total", - "text": "Host Emissions WTime (gms)", - "type": "number" - }, - { - "selector": "total_cpu_emissions_gms.global_total", - "text": "Host Emissions World Avg. (gms)", - "type": "number" - }, - { - "selector": "total_gpu_emissions_gms.wt_total", - "text": "GPU Emissions WTime (gms)", - "type": "number" - }, - { - "selector": "total_gpu_emissions_gms.global_total", - "text": "GPU Emissions World Avg. (gms)", - "type": "number" - } - ], - "computed_columns": [ - { - "selector": "ended_at_ts == 0 ? (${__to} - started_at_ts - 86400000 < 0 ? started_at_ts : ${__to} - 86400000) : (ended_at_ts - started_at_ts - 86400000 < 0 ? started_at_ts : ended_at_ts - 86400000)", - "text": "from", - "type": "string" - }, - { - "text": "to", - "selector": "ended_at_ts == now ? ${__to} : ended_at_ts", - "type": "string" } ], + "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -2107,58 +2048,11 @@ } } }, - { - "id": "calculateField", - "options": { - "alias": "Total Emissions WTime (gms)", - "binary": { - "left": { - "matcher": { - "id": "byName", - "options": "Host Emissions WTime (gms)" - } - }, - "right": { - "matcher": { - "id": "byName", - "options": "GPU Emissions WTime (gms)" - } - } - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "Total Emissions World Avg. (gms)", - "binary": { - "left": { - "matcher": { - "id": "byName", - "options": "Host Emissions World Avg. (gms)" - } - }, - "right": { - "matcher": { - "id": "byName", - "options": "GPU Emissions World Avg. (gms)" - } - } - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, { "id": "organize", "options": { "excludeByName": { + "Partition": false, "QoS": false, "created_at_ts": false, "ended_at_ts": false, @@ -2169,43 +2063,37 @@ }, "includeByName": {}, "indexByName": { - "CPU Mem Usage (%)": 13, - "CPU Usage (%)": 12, + "CPU Mem Usage (%)": 11, + "CPU Usage (%)": 10, "Elapsed": 4, "End Time": 3, - "GPU Emissions EMaps (gms)": 24, - "GPU Emissions OWID (gms)": 26, - "GPU Emissions RTE (gms)": 23, - "GPU Emissions WTime (gms)": 25, - "GPU Emissions World Avg. (gms)": 27, - "GPU Energy (kWh)": 22, - "GPU Mem Usage (%)": 21, - "GPU Usage (%)": 20, - "Host Emissions EMaps (gms)": 16, - "Host Emissions OWID (gms)": 18, - "Host Emissions RTE (gms)": 15, - "Host Emissions WTime (gms)": 17, - "Host Emissions World Avg. (gms)": 19, - "Host Energy (kWh)": 14, + "GPU Emissions EMaps (gms)": 20, + "GPU Emissions OWID (gms)": 21, + "GPU Emissions RTE (gms)": 19, + "GPU Energy (kWh)": 18, + "GPU Mem Usage (%)": 17, + "GPU Usage (%)": 16, + "Host Emissions EMaps (gms)": 14, + "Host Emissions OWID (gms)": 15, + "Host Emissions RTE (gms)": 13, + "Host Energy (kWh)": 12, "Name": 1, - "QoS": 28, + "Nodelist": 22, + "Partition": 23, + "QoS": 24, "Start Time": 2, "State": 5, "Total Emissions EMaps (gms)": 8, - "Total Emissions OWID (gms)": 10, + "Total Emissions OWID (gms)": 9, "Total Emissions RTE (gms)": 7, - "Total Emissions WTime (gms)": 9, - "Total Emissions World Avg. (gms)": 11, "Total Energy (kWh)": 6, "UUID": 0, - "created_at_ts": 29, - "ended_at_ts": 30, - "from": 35, - "project": 31, - "started_at_ts": 32, - "to": 36, - "total_time_seconds.walltime": 33, - "username": 34 + "created_at_ts": 25, + "ended_at_ts": 26, + "project": 27, + "started_at_ts": 28, + "total_time_seconds.walltime": 29, + "username": 30 }, "renameByName": {} } @@ -2218,22 +2106,24 @@ "type": "row" } ], + "preload": false, "refresh": "", - "schemaVersion": 40, + "schemaVersion": 42, "tags": [ - "pod", + "vm", "aggregate", - "k8s", + "openstack", "energy", "emissions" ], "templating": { "list": [ { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, @@ -2261,7 +2151,7 @@ "root_selector": "data", "source": "url", "type": "json", - "url": "/api/v1/users${endpoint}", + "url": "/api/v1/users/admin", "url_options": { "data": "", "headers": [], @@ -2269,7 +2159,7 @@ "params": [ { "key": "cluster_id", - "value": "${clusterId}" + "value": "k8s-0" } ] } @@ -2278,18 +2168,20 @@ "queryType": "infinity" }, "refresh": 1, - "regex": "", + "regex": "edna|bambam", + "regexApplyTo": "value", "type": "query" }, { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, - "label": "Account:", + "label": "Project:", "name": "account", "options": [], "query": { @@ -2309,7 +2201,7 @@ "source": "url", "type": "uql", "uql": "parse-json\n| scope \"data\"\n| jsonata \"[projects]\"", - "url": "/api/v1/users${endpoint}", + "url": "/api/v1/users/admin", "url_options": { "data": "", "headers": [], @@ -2317,7 +2209,7 @@ "params": [ { "key": "cluster_id", - "value": "${clusterId}" + "value": "k8s-0" }, { "key": "user", @@ -2331,18 +2223,21 @@ }, "refresh": 1, "regex": "", + "regexApplyTo": "value", "type": "query" }, { + "allowCustomValue": true, "current": { - "text": "global", - "value": "global" + "text": "rte", + "value": "rte" }, + "includeAll": false, "label": "Emission Factor Provider:", "name": "provider", "options": [ { - "selected": false, + "selected": true, "text": "RTE eCO2 Mix", "value": "rte" }, @@ -2355,18 +2250,14 @@ "selected": false, "text": "OWID", "value": "owid" - }, - { - "selected": true, - "text": "IEA", - "value": "global" } ], - "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid, IEA : global", - "type": "custom" + "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid", + "type": "custom", + "valuesFormat": "csv" }, { - "description": "Grafana Organization ID", + "description": "Grafana Organisation ID", "hide": 2, "name": "orgId", "query": "${VAR_ORGID}", @@ -2386,41 +2277,41 @@ ] }, { - "description": "CEEMS Cluster ID defined in CEEMS API server config", + "description": "Set it to /admin for admin dashboards to consult usage statistics of any user. For user dashboards that restrict data to current logged user, set it to empty space.", "hide": 2, - "name": "clusterId", - "query": "${VAR_CLUSTERID}", + "name": "endpoint", + "query": "${VAR_ENDPOINT}", "skipUrlSync": true, "type": "constant", "current": { - "value": "${VAR_CLUSTERID}", - "text": "${VAR_CLUSTERID}", + "value": "${VAR_ENDPOINT}", + "text": "${VAR_ENDPOINT}", "selected": false }, "options": [ { - "value": "${VAR_CLUSTERID}", - "text": "${VAR_CLUSTERID}", + "value": "${VAR_ENDPOINT}", + "text": "${VAR_ENDPOINT}", "selected": false } ] }, { - "description": "Set it to /admin for admin dashboards to consult usage statistics of any user. For user dashboards that restrict data to current logged user, set it to empty space.", + "description": "CEEMS Cluster ID defined in CEEMS API server config", "hide": 2, - "name": "endpoint", - "query": "${VAR_ENDPOINT}", + "name": "clusterId", + "query": "${VAR_CLUSTERID}", "skipUrlSync": true, "type": "constant", "current": { - "value": "${VAR_ENDPOINT}", - "text": "${VAR_ENDPOINT}", + "value": "${VAR_CLUSTERID}", + "text": "${VAR_CLUSTERID}", "selected": false }, "options": [ { - "value": "${VAR_ENDPOINT}", - "text": "${VAR_ENDPOINT}", + "value": "${VAR_CLUSTERID}", + "text": "${VAR_CLUSTERID}", "selected": false } ] @@ -2441,9 +2332,9 @@ "1d" ] }, - "timezone": "", - "title": "User k8s Pod Summary", - "uid": "k8s-pod-summary", - "version": 1, + "timezone": "browser", + "title": "User k8s Pods Summary", + "uid": "eethlvcs613wgf", + "version": 6, "weekStart": "" -} \ No newline at end of file +} diff --git a/thirdparty/grafana/dashboards/lsf/lsf-job-summary.json b/thirdparty/grafana/dashboards/lsf/lsf-job-summary.json index 62e879e1..2145ceed 100644 --- a/thirdparty/grafana/dashboards/lsf/lsf-job-summary.json +++ b/thirdparty/grafana/dashboards/lsf/lsf-job-summary.json @@ -1,20 +1,20 @@ { "__inputs": [ { - "name": "VAR_ORGID", - "type": "constant", - "label": "Organization ID", - "value": "1", - "description": "Grafana Organization ID" - }, - { - "name": "DS_CEEMS-API", - "label": "CEEMS API Server's datasource", + "name": "DS_YESOREYERAM-INFINITY-DATASOURCE", + "label": "yesoreyeram-infinity-datasource", "description": "", "type": "datasource", "pluginId": "yesoreyeram-infinity-datasource", "pluginName": "Infinity" }, + { + "name": "VAR_ORGID", + "type": "constant", + "label": "Grafana Organization ID", + "value": "", + "description": "Grafana Organization ID" + }, { "name": "VAR_CLUSTERID", "type": "constant", @@ -42,7 +42,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.4.0" + "version": "13.3.0" }, { "type": "panel", @@ -72,7 +72,7 @@ "type": "datasource", "id": "yesoreyeram-infinity-datasource", "name": "Infinity", - "version": "3.0.0-beta.1" + "version": "4.1.4" } ], "annotations": { @@ -95,7 +95,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, "links": [ { "asDropdown": false, @@ -110,6 +109,7 @@ "url": "https://github.com/ceems-dev/ceems" } ], + "liveNow": false, "panels": [ { "collapsed": false, @@ -119,15 +119,14 @@ "x": 0, "y": 0 }, - "id": 9, - "panels": [], + "id": 53, "title": "Aggregate Usage Statistics of User ${user} from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", "type": "row" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Average usage statistics of all jobs of the user", "fieldConfig": { @@ -135,13 +134,12 @@ "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", - "value": null + "value": 0 }, { "color": "orange", @@ -165,6 +163,14 @@ }, "id": 10, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -175,11 +181,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -211,7 +222,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -278,7 +289,7 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of all jobs of the user", "fieldConfig": { @@ -286,13 +297,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -328,7 +338,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -351,7 +361,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -466,13 +476,13 @@ "content": "# README\n\nThe panels to the left show the overall usage by the user\n**${user}** using the project **${account}**\nduring the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the jobs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the jobs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the jobs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host is the equivalent emissions due to the energy consumed by host components such as CPU, CPU memory and\n other peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { @@ -480,13 +490,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -522,7 +531,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -545,7 +554,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -710,12 +719,12 @@ "x": 0, "y": 13 }, - "id": 45, + "id": 54, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Average usage statistics of all jobs of the user", "fieldConfig": { @@ -723,12 +732,12 @@ "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "red" + "color": "red", + "value": 0 }, { "color": "orange", @@ -741,8 +750,7 @@ ] }, "unit": "percent" - }, - "overrides": [] + } }, "gridPos": { "h": 12, @@ -752,6 +760,14 @@ }, "id": 42, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -762,11 +778,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -798,7 +819,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -850,6 +871,10 @@ { "key": "field", "value": "username" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -861,7 +886,7 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of all jobs of the user", "fieldConfig": { @@ -869,12 +894,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -883,8 +908,7 @@ ] }, "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 6, @@ -910,7 +934,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -933,7 +957,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -977,6 +1001,10 @@ { "key": "field", "value": "username" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -1028,10 +1056,6 @@ "type": "stat" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 12, "w": 8, @@ -1048,14 +1072,15 @@ "content": "# README\n\nThe panels to the left show the overall usage by the project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}. This includes\nthe usage of all the users in the project. For consulting only user specific usage,\nplease refer to the panels above.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the jobs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the jobs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the jobs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", + "targets": [], "title": "", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { @@ -1063,12 +1088,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -1077,14 +1102,13 @@ ] }, "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 6, "w": 8, "x": 8, - "y": 94 + "y": 20 }, "id": 50, "options": { @@ -1104,7 +1128,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1127,7 +1151,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1295,17 +1319,18 @@ "x": 0, "y": 14 }, - "id": 41, + "id": 55, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of each user in the project ${account}", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { @@ -1315,11 +1340,8 @@ "viz": false } }, - "fieldMinMax": false, - "mappings": [], "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1350,12 +1372,14 @@ "fields": "/^Total$/", "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1384,7 +1408,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -1455,12 +1479,13 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { @@ -1470,10 +1495,8 @@ "viz": false } }, - "mappings": [], "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1504,12 +1527,14 @@ "fields": "", "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1598,7 +1623,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1666,10 +1691,6 @@ "type": "piechart" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 10, "w": 8, @@ -1686,7 +1707,8 @@ "content": "# README\n\nThe panels to the left show the breakdown of total energy consumption and\nequivalent emissions for project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Total energy consumption is sum of energy consumed by host and GPUs (if present)\nfor all jobs ran during this period.\n\n- Total equivalent emissions is the sum of equivalent emissions from the energy\nconsumed by host and GPUs (if present) for all jobs ran during this period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", + "targets": [], "title": "", "type": "text" } @@ -1702,12 +1724,12 @@ "x": 0, "y": 15 }, - "id": 32, + "id": 56, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "List of all LSF jobs of user ${user} with project ${account}. By clicking the row, user will be redirected to the dashboard that shows the time series metrics of that compute unit.", "fieldConfig": { @@ -1718,11 +1740,14 @@ "custom": { "align": "left", "cellOptions": { - "type": "auto", - "wrapText": false + "type": "auto" }, "filterable": true, - "inspect": false + "footer": { + "reducers": [] + }, + "inspect": false, + "wrapText": false }, "links": [ { @@ -1731,13 +1756,12 @@ "url": "/d/lsf-single-job-metrics/_?orgId=${ordId}&var-jobid=${__data.fields.JobID}&from=${__data.fields.started_at_ts}&to=${__data.fields.ended_at_ts}&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-name=${__data.fields.Name}&var-nodelist=${__data.fields.Nodelist}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-partition=${__data.fields.Partition}&var-qos=${__data.fields.QoS}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-cpu_emissions_wt=${__data.fields[\"Host Emissions WTime (gms)\"]}&var-cpu_emissions_global=${__data.fields[\"Host Emissions World Avg. (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-gpu_emissions_wt=${__data.fields[\"GPU Emissions WTime (gms)\"]}&var-gpu_emissions_global=${__data.fields[\"GPU Emissions World Avg. (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}&var-total_emissions_wt=${__data.fields[\"Total Emissions WTime (gms)\"]}&var-total_emissions_global=${__data.fields[\"Total Emissions World Avg. (gms)\"]}" } ], - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -1754,7 +1778,7 @@ }, "properties": [ { - "id": "custom.hidden", + "id": "custom.hideFrom.viz", "value": true } ] @@ -1777,20 +1801,12 @@ "h": 27, "w": 24, "x": 0, - "y": 26 + "y": 16 }, "id": 52, "options": { "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": true, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, + "enablePagination": true, "showHeader": true, "sortBy": [ { @@ -1799,7 +1815,7 @@ } ] }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.0.1", "targets": [ { "columns": [ @@ -1963,7 +1979,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -2218,8 +2234,9 @@ "type": "row" } ], + "preload": false, "refresh": "", - "schemaVersion": 40, + "schemaVersion": 42, "tags": [ "job", "aggregate", @@ -2234,10 +2251,11 @@ "templating": { "list": [ { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, @@ -2283,13 +2301,15 @@ }, "refresh": 1, "regex": "", + "regexApplyTo": "value", "type": "query" }, { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, @@ -2335,18 +2355,21 @@ }, "refresh": 1, "regex": "", + "regexApplyTo": "value", "type": "query" }, { + "allowCustomValue": true, "current": { "text": "owid", "value": "owid" }, + "includeAll": false, "label": "Emission Factor Provider:", "name": "provider", "options": [ { - "selected": true, + "selected": false, "text": "RTE eCO2 Mix", "value": "rte" }, @@ -2356,13 +2379,14 @@ "value": "emaps" }, { - "selected": false, + "selected": true, "text": "OWID", "value": "owid" } ], "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid", - "type": "custom" + "type": "custom", + "valuesFormat": "csv" }, { "description": "Grafana Organization ID", @@ -2440,9 +2464,9 @@ "1d" ] }, - "timezone": "", + "timezone": "browser", "title": "User LSF Job Summary", "uid": "lsf-job-summary", - "version": 1, + "version": 4, "weekStart": "" -} \ No newline at end of file +} diff --git a/thirdparty/grafana/dashboards/openstack/os-single-vm-metrics.json b/thirdparty/grafana/dashboards/openstack/os-single-vm-metrics.json index 1621b3de..f4f5d85f 100644 --- a/thirdparty/grafana/dashboards/openstack/os-single-vm-metrics.json +++ b/thirdparty/grafana/dashboards/openstack/os-single-vm-metrics.json @@ -1,39 +1,78 @@ { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "Prometheus datasource. When CEEMS LB is enabled, datasource corresponding to CEEMS LB must be configured here.", + "name": "DS_YESOREYERAM-INFINITY-DATASOURCE", + "label": "yesoreyeram-infinity-datasource", "description": "", "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" + "pluginId": "yesoreyeram-infinity-datasource", + "pluginName": "Infinity" + }, + { + "name": "VAR_ORGID", + "type": "constant", + "label": "Grafana Organization ID", + "value": "", + "description": "Grafana Organization ID" + }, + { + "name": "VAR_CLUSTERID", + "type": "constant", + "label": "CEEMS Cluster ID defined in CEEMS API server config", + "value": "", + "description": "CEEMS Cluster ID defined in CEEMS API server config" + }, + { + "name": "VAR_ENDPOINT", + "type": "constant", + "label": "Set it to /admin for admin dashboards to consult usage statistics of any user. For user dashboards that restrict data to current logged user, set it to empty space", + "value": "", + "description": "Set it to /admin for admin dashboards to consult usage statistics of any user. For user dashboards that restrict data to current logged user, set it to empty space" } ], "__elements": {}, "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.3.1" + "version": "13.3.0" }, { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" }, { "type": "panel", - "id": "text", - "name": "Text", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", "version": "" }, { "type": "panel", - "id": "timeseries", - "name": "Time series", + "id": "text", + "name": "Text", "version": "" + }, + { + "type": "datasource", + "id": "yesoreyeram-infinity-datasource", + "name": "Infinity", + "version": "4.1.4" } ], "annotations": { @@ -52,11 +91,10 @@ } ] }, - "description": "Time series metrics of a Openstack VM", + "description": "List of Openstack VMs", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, "links": [ { "asDropdown": false, @@ -68,73 +106,595 @@ "title": "Powered by CEEMS", "tooltip": "Go To GitHub", "type": "link", - "url": "https://github.com/ceems-dev/ceems" + "url": "https://github.com/mahendrapaipuri/ceems" } ], + "liveNow": false, "panels": [ { + "collapsed": false, "gridPos": { - "h": 13, - "w": 8, + "h": 1, + "w": 24, "x": 0, "y": 0 }, "id": 53, + "title": "Aggregate Usage Statistics of User ${user} from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", + "type": "row" + }, + { + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "description": "Average usage statistics of all VMs of the user", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": 0 + }, + { + "color": "orange", + "value": 30 + }, + { + "color": "green", + "value": 70 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 8, + "x": 0, + "y": 1 + }, + "id": 10, "options": { - "code": { - "language": "plaintext", - "showLineNumbers": false, - "showMiniMap": false + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false }, - "content": " \n The following metrics are aggregated over entire VM duration\n\n
\n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Average Utilization (%)CPU${cpu_usage}
CPU Memory${cpumem_usage}
GPU${gpu_usage}
GPU Memory\n ${gpumem_usage}
Energy Consumption (kWh)Host${cpu_energy}
GPU${gpu_energy}
Total${total_energy}
Equivalent Emissions (gms)Emission FactorRTEElec. MapsW. TimeOWIDWorld Avg.
Host${cpu_emissions_rte}${cpu_emissions_emaps}${cpu_emissions_wt}${cpu_emissions_owid}${cpu_emissions_global}
GPU${gpu_emissions_rte}${gpu_emissions_emaps}${gpu_emissions_wt}${gpu_emissions_owid}${gpu_emissions_global}
Total${total_emissions_rte}${total_emissions_emaps}${total_emissions_wt}${total_emissions_owid}${total_emissions_global}
", - "mode": "html" + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.3.1", - "title": "Aggregate Metrics", - "type": "text" + "pluginVersion": "13.3.0", + "targets": [ + { + "columns": [ + { + "selector": "avg_cpu_usage.global", + "text": "Average CPU Usage", + "type": "number" + }, + { + "selector": "avg_gpu_usage.global", + "text": "Average GPU Usage", + "type": "number" + }, + { + "selector": "avg_cpu_mem_usage.global", + "text": "Average CPU Mem Usage", + "type": "number" + }, + { + "selector": "avg_gpu_mem_usage.global", + "text": "Average GPU Mem Usage", + "type": "number" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "User == \"${user}\"", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "field", + "value": "avg_cpu_usage" + }, + { + "key": "field", + "value": "avg_cpu_mem_usage" + }, + { + "key": "field", + "value": "avg_gpu_usage" + }, + { + "key": "field", + "value": "avg_gpu_mem_usage" + }, + { + "key": "field", + "value": "username" + } + ] + } + } + ], + "title": "⚙️ Average Utilization by ${user} ⚙️", + "type": "gauge" }, { + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "description": "Total energy consumption of all VMs of the user", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kwatth" + }, + "overrides": [] + }, "gridPos": { - "h": 13, + "h": 6, "w": 8, "x": 8, - "y": 0 + "y": 1 }, - "id": 31, + "id": 35, "options": { - "code": { - "language": "plaintext", - "showLineNumbers": false, - "showMiniMap": false + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false }, - "content": " \n Following table gives different VM meta data\n\n
\n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
AttributeValue
UUID${uuid}
Name${name}
Account${account}
Created At${submit:date:YYYY-MM-DD HH:mm:SS Z}
Started At${start:date:YYYY-MM-DD HH:mm:SS Z}
Ended At${end:date:YYYY-MM-DD HH:mm:SS Z}
Elapsed Time${elapsed}
State${state}
\n", - "mode": "html" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "11.3.1", - "title": "Job Details", - "type": "text" + "pluginVersion": "13.3.0", + "targets": [ + { + "columns": [ + { + "selector": "total_cpu_energy_usage_kwh.total", + "text": "Host", + "type": "number" + }, + { + "selector": "total_gpu_energy_usage_kwh.total", + "text": "GPU", + "type": "number" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], + "computed_columns": [], + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "User == \"${user}\"", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "field", + "value": "total_cpu_energy_usage_kwh" + }, + { + "key": "field", + "value": "total_gpu_energy_usage_kwh" + }, + { + "key": "field", + "value": "username" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + } + ] + } + } + ], + "title": "⚡ Total Energy Consumption by ${user} ⚡", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "User": true + }, + "includeByName": {}, + "indexByName": { + "GPU": 1, + "Host": 0, + "Total": 3, + "User": 2 + }, + "renameByName": {} + } + } + ], + "type": "stat" }, { "gridPos": { - "h": 13, + "h": 12, "w": 8, "x": 16, - "y": 0 + "y": 1 }, - "id": 54, + "id": 31, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, - "content": "This dashboard presents the time series metrics of VM ${uuid} running under project ${account}.\nCurrently the following time series metrics are available:\n\n- **CPU Stats**:\n\n - *CPU Usage*: This shows the usage of CPU by the VM and it is estimated using CPU time.\n In one second interval, if CPU works only for 0.2 seconds, CPU usage will be reported as 20%. \n If a VM has _n_ cpus and uses all _n_\n cpus all the time, the usage will be 100% all the time. If the VM uses only _n/2_ cpus or uses\n _n_ cpus only 50% of time, the resulting CPU usage will be 50%.\n\n - *CPU Memory Usage*: This is the percentage of memory used by the VM compared to the total memory available\n to the VM.\n\n - *Host Energy Usage*: This is the energy consumption estimated based on total energy consumption\n (excluding GPUs) of the\n compute node and the resources used by the VM. Thus it includes CPU, CPU memory and other peripherals \n on the compute node excluding GPUs. The estimation is made using CPU time, memory used\n by the VM relative to total CPU time and total memory used by the compute node. If there are multiple\n VMs running on the node at a given time, the reported energy consumption is the energy consumed only\n by the current VM.\n
\n\n- **GPU Stats**:\n\n - *GPU Usage*: This shows the GPU usage reported by [NVML](https://developer.nvidia.com/management-library-nvml).\n According to [NVML docs](https://docs.nvidia.com/deploy/nvml-api/structnvmlUtilization__t.html#structnvmlUtilization__t),\n it is percent of time over the past sample period during which one or more kernels was executing on the GPU.\n\n - *GPU Memory Usage*: This is the percentage of memory used by the VM compared to the available memory on\n the GPU.\n\n - *GPU Energy Usage*: This is the energy consumption reported by [NVML](https://developer.nvidia.com/management-library-nvml)\n by the GPU.\n
\n\n- **GPU Profiling Stats**: NVIDIA DCGM [docs](https://docs.nvidia.com/datacenter/dcgm/latest/user-guide/feature-overview.html#profiling-metrics)\nexplains all the presented GPU profiling metrics.\n
\n\n- **IO Stats**:\n\n - *Read/Write bandwidths*: Read/Write bandwidths for different\n file systems.\n\n - *Read/Write Requests*: Number of requests for read/write for different \n file systems.\n\n - *Read/Write Errors*: Number of errors while executing read/write requests\n for different file systems.\n
\n", + "content": "# README\n\nThe panels to the left show the overall usage by the user\n**${user}** using the project **${account}**\nduring the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the VMs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the VMs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the VMs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host is the equivalent emissions due to the energy consumed by host components such as CPU, CPU memory and\n other peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.3.1", - "title": "README", + "pluginVersion": "13.3.0", "type": "text" }, + { + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "massg" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 7 + }, + "id": 36, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "13.3.0", + "targets": [ + { + "columns": [ + { + "selector": "total_cpu_emissions_gms", + "text": "Host", + "type": "string" + }, + { + "selector": "total_gpu_emissions_gms", + "text": "GPU", + "type": "string" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], + "computed_columns": [], + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "User == \"${user}\"", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "field", + "value": "total_cpu_emissions_gms" + }, + { + "key": "field", + "value": "total_gpu_emissions_gms" + }, + { + "key": "field", + "value": "username" + } + ] + } + } + ], + "title": "👣 Total Equivalent Emissions estimated using ${provider:text} by ${user} 👣", + "transformations": [ + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "Host rte", + "path": "rte_total" + }, + { + "alias": "Host emaps", + "path": "emaps_total" + }, + { + "alias": "Host owid", + "path": "owid_total" + } + ], + "source": "Host" + } + }, + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "GPU rte", + "path": "rte_total" + }, + { + "alias": "GPU emaps", + "path": "emaps_total" + }, + { + "alias": "GPU owid", + "path": "owid_total" + } + ], + "source": "GPU" + } + }, + { + "id": "filterFieldsByName", + "options": { + "byVariable": false, + "include": { + "pattern": "(Host|GPU)\\s*${provider}" + } + } + }, + { + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byType", + "options": "number" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "reduceRow", + "reduce": { + "include": [], + "reducer": "sum" + } + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "(Host|GPU)(.*)", + "renamePattern": "$1" + } + } + ], + "type": "stat" + }, { "collapsed": true, "gridPos": { @@ -143,173 +703,187 @@ "x": 0, "y": 13 }, - "id": 1, + "id": 54, "panels": [ { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Time series of CPU usage of the VM", + "description": "Average usage statistics of all VMs of the user", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "mode": "thresholds" }, - "mappings": [], - "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "red", + "value": 0 }, { - "color": "red", - "value": 80 + "color": "orange", + "value": 30 + }, + { + "color": "green", + "value": 70 } ] }, "unit": "percent" - }, - "overrides": [] + } }, "gridPos": { - "h": 8, + "h": 12, "w": 8, "x": 0, "y": 14 }, - "id": 2, - "interval": "10s", - "maxDataPoints": 1448, + "id": 42, "options": { - "legend": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { "calcs": [ - "min", - "max", "mean" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.1", + "fields": "", + "values": false + }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" + }, + "pluginVersion": "13.3.0", "targets": [ { + "columns": [ + { + "selector": "avg_cpu_usage.global", + "text": "Average CPU Usage", + "type": "number" + }, + { + "selector": "avg_gpu_usage.global", + "text": "Average GPU Usage", + "type": "number" + }, + { + "selector": "avg_cpu_mem_usage.global", + "text": "Average CPU Mem Usage", + "type": "number" + }, + { + "selector": "avg_gpu_mem_usage.global", + "text": "Average GPU Mem Usage", + "type": "number" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_cpu_usage:ratio_irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "CPU Total", - "range": true, - "refId": "A" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "field", + "value": "avg_cpu_usage" + }, + { + "key": "field", + "value": "avg_cpu_mem_usage" + }, + { + "key": "field", + "value": "avg_gpu_usage" + }, + { + "key": "field", + "value": "avg_gpu_mem_usage" + }, + { + "key": "field", + "value": "username" + }, + { + "key": "user", + "value": "${user}" + } + ] + } } ], - "title": "CPU Utilization", - "type": "timeseries" + "title": "⚙️ Average Utilization by ${account} ⚙️", + "type": "gauge" }, { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Time series of CPU memory usage of the VM", + "description": "Total energy consumption of all VMs of the user", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -317,149 +891,193 @@ } ] }, - "unit": "bytes" - }, - "overrides": [] + "unit": "kwatth" + } }, "gridPos": { - "h": 8, + "h": 6, "w": 8, "x": 8, "y": 14 }, - "id": 3, - "interval": "10s", - "maxDataPoints": 1488, + "id": 44, "options": { - "legend": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { "calcs": [ - "min", - "max", - "mean" + "sum" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "11.3.1", + "pluginVersion": "13.3.0", "targets": [ { + "columns": [ + { + "selector": "total_cpu_energy_usage_kwh.total", + "text": "Host", + "type": "number" + }, + { + "selector": "total_gpu_energy_usage_kwh.total", + "text": "GPU", + "type": "number" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], + "computed_columns": [], "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (ceems_compute_unit_memory_total_bytes{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total usable", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum without (instance,hostname) (ceems_compute_unit_memory_used_bytes{uuid=\"${uuid}\"})", - "format": "time_series", - "instant": false, - "legendFormat": "Used", - "range": true, - "refId": "B" - }, + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "field", + "value": "total_cpu_energy_usage_kwh" + }, + { + "key": "field", + "value": "total_gpu_energy_usage_kwh" + }, + { + "key": "field", + "value": "username" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "user", + "value": "${user}" + } + ] + } + } + ], + "title": "⚡ Total Energy Consumption by ${account} ⚡", + "transformations": [ { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (ceems_compute_unit_memory_rss_bytes{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "RSS", - "range": true, - "refId": "C" + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } + } }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (ceems_compute_unit_memory_cache_bytes{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Cached", - "range": true, - "refId": "D" + "id": "organize", + "options": { + "excludeByName": { + "User": true + }, + "includeByName": {}, + "indexByName": { + "GPU": 1, + "Host": 0, + "Total": 3, + "User": 2 + }, + "renameByName": {} + } } ], - "title": "CPU Memory Utilization", - "type": "timeseries" + "type": "stat" + }, + { + "gridPos": { + "h": 12, + "w": 8, + "x": 16, + "y": 14 + }, + "id": 48, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# README\n\nThe panels to the left show the overall usage by the project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}. This includes\nthe usage of all the users in the project. For consulting only user specific usage,\nplease refer to the panels above.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the VMs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the VMs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the VMs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", + "mode": "markdown" + }, + "pluginVersion": "13.3.0", + "targets": [], + "title": "", + "type": "text" }, { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Time series of estimated VM power usage", + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -467,56 +1085,198 @@ } ] }, - "unit": "watt" - }, - "overrides": [] + "unit": "massg" + } }, "gridPos": { - "h": 8, + "h": 6, "w": 8, - "x": 16, - "y": 14 + "x": 8, + "y": 20 }, - "id": 4, - "interval": "10s", - "maxDataPoints": 1488, + "id": 50, "options": { - "legend": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { "calcs": [ - "min", - "max", - "mean" + "sum" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "11.3.1", + "pluginVersion": "13.3.0", "targets": [ { + "columns": [ + { + "selector": "total_cpu_emissions_gms", + "text": "Host", + "type": "string" + }, + { + "selector": "total_gpu_emissions_gms", + "text": "GPU", + "type": "string" + }, + { + "selector": "username", + "text": "User", + "type": "string" + } + ], + "computed_columns": [], "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_host_power_watts:pue{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total consumption", - "range": true, - "refId": "A" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "field", + "value": "total_cpu_emissions_gms" + }, + { + "key": "field", + "value": "total_gpu_emissions_gms" + }, + { + "key": "field", + "value": "username" + } + ] + } + } + ], + "title": "👣 Total Equivalent Emissions estimated using ${provider:text} by ${account} 👣", + "transformations": [ + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "Host rte", + "path": "rte_total" + }, + { + "alias": "Host emaps", + "path": "emaps_total" + }, + { + "alias": "Host owid", + "path": "owid_total" + } + ], + "source": "Host" + } + }, + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "GPU rte", + "path": "rte_total" + }, + { + "alias": "GPU emaps", + "path": "emaps_total" + }, + { + "alias": "GPU owid", + "path": "owid_total" + } + ], + "source": "GPU" + } + }, + { + "id": "filterFieldsByName", + "options": { + "byVariable": false, + "include": { + "pattern": "(Host|GPU)\\s*${provider}" + } + } + }, + { + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byType", + "options": "number" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + } + } + }, + { + "id": "renameByRegex", + "options": { + "regex": "(Host|GPU)(.*)", + "renamePattern": "$1" + } } ], - "title": "Power Usage", - "type": "timeseries" + "type": "stat" } ], - "title": "CPU Stats", + "title": "Aggregate Usage Statistics of Project ${account} from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", "type": "row" }, { @@ -527,2534 +1287,1050 @@ "x": 0, "y": 14 }, - "id": 7, + "id": 55, "panels": [ { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Time series of GPU usage reported by nVIDIA-DCGM", + "description": "Total energy consumption of each user in the project ${account}", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] + "unit": "kwatth" + } }, "gridPos": { - "h": 8, + "h": 10, "w": 8, "x": 0, - "y": 68 + "y": 15 }, - "id": 8, - "interval": "10s", - "maxDataPoints": 1488, + "id": 37, "options": { + "displayLabels": [ + "name", + "value" + ], "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "value", + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { "calcs": [ - "min", - "max", - "mean" + "allValues" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "/^Total$/", + "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.3.1", + "pluginVersion": "13.3.0", "targets": [ { + "columns": [ + { + "selector": "total_cpu_energy_usage_kwh.total", + "text": "Host", + "type": "number" + }, + { + "selector": "username", + "text": "User", + "type": "string" + }, + { + "selector": "total_gpu_energy_usage_kwh.total", + "text": "GPU", + "type": "number" + } + ], "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_usage:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "GPU: {{gpu}}", - "range": true, - "refId": "A" - }, + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "field", + "value": "total_cpu_energy_usage_kwh" + }, + { + "key": "field", + "value": "username" + }, + { + "key": "field", + "value": "total_gpu_energy_usage_kwh" + } + ] + } + } + ], + "title": "⚡ Total Energy Consumption by users of ${account} ⚡", + "transformations": [ { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_usage:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average Usage on all GPUs", - "range": true, - "refId": "B" + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + }, + "replaceFields": false + } } ], - "title": "GPU Utilization", - "type": "timeseries" + "type": "piechart" }, { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "description": "Time series of GPU memory usage reported by nVIDIA-DCGM", + "description": "Total emissions from the energy consumption of all VMs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { "defaults": { "color": { + "fixedColor": "#73BF69", "mode": "palette-classic" }, "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] + "unit": "massg" + } }, "gridPos": { - "h": 8, + "h": 10, "w": 8, "x": 8, - "y": 68 + "y": 15 }, - "id": 22, - "interval": "10s", - "maxDataPoints": 1488, + "id": 51, "options": { + "displayLabels": [ + "name", + "value" + ], "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { "calcs": [ - "min", - "max", - "mean" + "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "/^Total$/", + "values": true }, + "sort": "desc", "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.3.1", + "pluginVersion": "13.3.0", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_memory_usage:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_memory_usage:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average Memory Usage on all GPUs", - "range": true, - "refId": "B" - } - ], - "title": "GPU Memory Utilization", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU power usage reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "columns": [ + { + "selector": "total_cpu_emissions_gms", + "text": "Host", + "type": "string" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + { + "selector": "total_gpu_emissions_gms", + "text": "GPU", + "type": "string" }, - "thresholdsStyle": { - "mode": "off" + { + "selector": "username", + "text": "User", + "type": "string" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + ], + "computed_columns": [], + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filterExpression": "", + "filters": [], + "format": "table", + "global_query_id": "", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/usage/current${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ { - "color": "green" + "key": "project", + "value": "${account}" }, { - "color": "red", - "value": 80 + "key": "user", + "value": "${user}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "field", + "value": "total_cpu_emissions_gms" + }, + { + "key": "field", + "value": "total_gpu_emissions_gms" + }, + { + "key": "field", + "value": "username" } ] - }, - "unit": "watt" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 68 - }, - "id": 25, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_gpu_power_watts:pue{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "GPU: {{gpu}}", - "range": true, - "refId": "A" + } + } + ], + "title": "👣 Total Equivalent Emissions estimated using ${provider:text} by users of ${account} 👣", + "transformations": [ + { + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ + { + "alias": "Host rte", + "path": "rte_total" + }, + { + "alias": "Host emaps", + "path": "emaps_total" + }, + { + "alias": "Host owid", + "path": "owid_total" + } + ], + "source": "Host" + } }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname,gpuuuid) (uuid:ceems_gpu_power_watts:pue{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total Usage on all GPUs", - "range": true, - "refId": "B" - } - ], - "title": "GPU Power Usage", - "type": "timeseries" - } - ], - "title": "GPU Stats", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 15 - }, - "id": 42, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU SM Activity & Occupancy reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "id": "extractFields", + "options": { + "format": "json", + "jsonPaths": [ { - "color": "green" + "alias": "GPU rte", + "path": "rte_total" }, { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 392 - }, - "id": 34, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_sm_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "SM Activity on GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_sm_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average SM Activity on all GPUs", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_sm_occupancy:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "SM Occupancy GPU: {{gpu}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_sm_occupancy:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average SM Occupancy on all GPUs", - "range": true, - "refId": "D" - } - ], - "title": "GPU SM Activity & Occupancy", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU Graphics and Tensor Engines Activity reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "alias": "GPU emaps", + "path": "emaps_total" }, { - "color": "red", - "value": 80 + "alias": "GPU owid", + "path": "owid_total" } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 392 - }, - "id": 35, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_gr_engine_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Graphics Engine Activity on GPU: {{gpu}}", - "range": true, - "refId": "A" + ], + "source": "GPU" + } }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_gr_engine_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average Graphics Engine Activity on all GPUs", - "range": true, - "refId": "B" + "id": "filterFieldsByName", + "options": { + "byVariable": false, + "include": { + "pattern": "(((Host|GPU)\\s*${provider})|User)" + } + } }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_pipe_tensor_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Tensor Pipe Activity on GPU: {{gpu}}", - "range": true, - "refId": "C" + "id": "calculateField", + "options": { + "alias": "Total", + "binary": { + "left": { + "matcher": { + "id": "byType", + "options": "number" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU" + } + } + }, + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + } + } }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pipe_tensor_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average Tensor Pipe Activity on all GPUs", - "range": true, - "refId": "D" + "id": "renameByRegex", + "options": { + "regex": "(Host|GPU)(.*)", + "renamePattern": "$1" + } } ], - "title": "GPU Graphics and Tensor Engines Activity", - "type": "timeseries" + "type": "piechart" }, { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU FP{64, 32, 16} Engines Activity reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, "gridPos": { - "h": 8, + "h": 10, "w": 8, "x": 16, - "y": 392 + "y": 15 }, - "id": 39, - "interval": "10s", - "maxDataPoints": 1488, + "id": 49, "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# README\n\nThe panels to the left show the breakdown of total energy consumption and\nequivalent emissions for project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Total energy consumption is sum of energy consumed by host and GPUs (if present)\nfor all VMs ran during this period.\n\n- Total equivalent emissions is the sum of equivalent emissions from the energy\nconsumed by host and GPUs (if present) for all VMs ran during this period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n", + "mode": "markdown" + }, + "pluginVersion": "13.3.0", + "targets": [], + "title": "", + "type": "text" + } + ], + "title": "Breakdown of ${account}'s Energy & Emissions Usage from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", + "type": "row" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 56, + "title": "VM Metrics from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", + "type": "row" + }, + { + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "description": "List of all Openstack VMs of user ${user} with project ${account}. By clicking the row, user will be redirected to the dashboard that shows the time series metrics of that compute unit.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_pipe_fp64_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "FP64 Activity on GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_pipe_fp32_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "FP32 Activity on GPU: {{gpu}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_pipe_fp16_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "FP16 Activity on GPU: {{gpu}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pipe_fp64_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average FP64 Engine Activity on all GPUs", - "range": true, - "refId": "D" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pipe_fp32_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average FP32 Engine Activity on all GPUs", - "range": true, - "refId": "E" + "custom": { + "align": "left", + "cellOptions": { + "type": "auto" }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pipe_fp16_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average FP16 Engine Activity on all GPUs", - "range": true, - "refId": "F" - } - ], - "title": "GPU FP Engines Activity", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of fraction of cycles where data was sent to or received from GPU reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 400 - }, - "id": 38, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname) (uuid:ceems_gpu_prof_dram_active:ratio{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "avg without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_dram_active:ratio{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Average Memory BW Utilization on all GPUs", - "range": true, - "refId": "B" - } - ], - "title": "GPU Memory BW Utilization", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU NVLink Bandwidth reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 400 - }, - "id": 40, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_gpu_prof_nvlink_tx_bytes:sum{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Transmitted on GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_nvlink_tx_bytes:sum{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total Transmitted Bandwidth on all GPUs", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_gpu_prof_nvlink_rx_bytes:sum{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Received on GPU: {{gpu}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_nvlink_rx_bytes:sum{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total Received Bandwidth on all GPUs", - "range": true, - "refId": "D" - } - ], - "title": "GPU NVLink Bandwidth", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of GPU PCIe Bandwidth reported by nVIDIA-DCGM", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 400 - }, - "id": 41, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_gpu_prof_pcie_tx_bytes:sum{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Transmitted on GPU: {{gpu}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pcie_tx_bytes:sum{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Total Transmitted Bandwidth on all GPUs", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_gpu_prof_pcie_rx_bytes:sum{gpuuuid=~\"${gpu}\",uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Received on GPU: {{gpu}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname,gpuuuid) (uuid:ceems_gpu_prof_pcie_rx_bytes:sum{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "TOtal Received Bandwidth on all GPUs", - "range": true, - "refId": "D" - } - ], - "title": "GPU PCIe Bandwidth", - "type": "timeseries" - } - ], - "title": "GPU Profiling Stats", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 16 - }, - "id": 52, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of Read/Write Bandwidth to different file systems.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 225 - }, - "id": 49, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_read_bytes:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Read Bandwith on {{mountpoint}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_write_bytes:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Write Bandwith on {{mountpoint}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_read_bytes:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Read Bandwith on {{mountpoint}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_write_bytes:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Write Bandwith on {{mountpoint}}", - "range": true, - "refId": "D" - } - ], - "title": "IO Read/Write Bandwidth", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of Read/Write Requests to different file systems.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 225 - }, - "id": 50, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_read_requests:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Read Requests on {{mountpoint}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_write_requests:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Write Requests on {{mountpoint}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_read_requests:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Read Requests on {{mountpoint}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_write_requests:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Write Requests on {{mountpoint}}", - "range": true, - "refId": "D" - } - ], - "title": "IO Read/Write Requests", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of Read/Write Errors to different file systems.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "si:errors/s" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 225 - }, - "id": 51, - "interval": "10s", - "maxDataPoints": 1488, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_read_errors:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Read Errors on {{mountpoint}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_io_write_errors:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Write Errors on {{mountpoint}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_read_errors:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Read Errors on {{mountpoint}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (mountpoint) (uuid:ceems_io_write_errors:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Write Errors on {{mountpoint}}", - "range": true, - "refId": "D" - } - ], - "title": "IO Read/Write Errors", - "type": "timeseries" - } - ], - "title": "IO Stats", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 58, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of Job Network Ingress/Egress Bandwidth.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 27 - }, - "id": 59, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_net_ingress_bytes:irate{uuid=\"${uuid}\"})", - "legendFormat": "Ingress Bandwith {{proto}}/{{family}}", - "range": true, - "refId": "A", - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - } - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_net_egress_bytes:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Egress Bandwith {{proto}}/{{family}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (proto,family) (uuid:ceems_net_ingress_bytes:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Ingress Bandwith {{proto}}/{{family}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (proto,family) (uuid:ceems_net_egress_bytes:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Egress Bandwith {{proto}}/{{family}}", - "range": true, - "refId": "D" - } - ], - "title": "Network Ingress/Egress Bandwidth", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Time series of Job Network Ingress/Egress Packets.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "pps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 27 - }, - "id": 60, - "options": { - "legend": { - "calcs": [ - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_net_ingress_packets:irate{uuid=\"${uuid}\"})", - "legendFormat": "Ingress Packets {{proto}}/{{family}}", - "range": true, - "refId": "A", - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - } - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (uuid:ceems_net_egress_packets:irate{uuid=\"${uuid}\"})", - "hide": false, - "instant": false, - "legendFormat": "Egress Packets {{proto}}/{{family}}", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (proto,family) (uuid:ceems_net_ingress_packets:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Ingress Packets {{proto}}/{{family}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "sum without (instance,hostname) (sum by (proto,family) (uuid:ceems_net_egress_packets:irate{uuid=\"${uuid}\"}))", - "hide": false, - "instant": false, - "legendFormat": "Total Egress Packets {{proto}}/{{family}}", - "range": true, - "refId": "D" - } - ], - "title": "Network Ingress/Egress Packets", - "type": "timeseries" - } - ], - "title": "Network Stats", - "type": "row" - } - ], - "schemaVersion": 40, - "tags": [ - "openstack", - "emissions", - "energy", - "vm", - "cloud" - ], - "templating": { - "list": [ - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "label": "UUID", - "name": "uuid", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "definition": "query_result(max_over_time((sum without (instance,hostname) (ceems_compute_unit_gpu_index_flag{uuid=\"${uuid}\"}))[$__range:]))", - "label": "GPU:", - "multi": true, - "name": "gpu", - "options": [], - "query": { - "qryType": 3, - "query": "query_result(max_over_time((sum without (instance,hostname) (ceems_compute_unit_gpu_index_flag{uuid=\"${uuid}\"}))[$__range:]))", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "/index=\"(?[^\"]+)|gpuuuid=\"(?[^\"]+)/g", - "type": "query" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "name", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "submit", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "start", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "end", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "state", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "elapsed", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "account", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_usage", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpumem_usage", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_energy", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_emissions_rte", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_emissions_emaps", - "options": [ - { - "selected": true, - "text": "", - "value": "" + "filterable": true, + "footer": { + "reducers": [] + }, + "inspect": false, + "wrapText": false + }, + "links": [ + { + "targetBlank": true, + "title": "Openstack VM Metrics Dashboard", + "url": "/d/de5zvcrpxkv7kb/_?orgId=${orgId}&var-uuid=${__data.fields.UUID}&from=now-24h&to=now&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-start=${__data.fields.started_at_ts}&var-end=${__data.fields.ended_at_ts}&var-name=${__data.fields.Name}&var-nodelist=${__data.fields.Nodelist}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" }, - "hide": 2, - "name": "cpu_emissions_wt", - "options": [ + "overrides": [ { - "selected": true, - "text": "", - "value": "" + "matcher": { + "id": "byRegexp", + "options": "/(created_at_ts|ended_at_ts|project|started_at_ts)/" + }, + "properties": [ + { + "id": "custom.hideFrom.viz", + "value": true + } + ] } - ], - "query": "", - "type": "textbox" + ] }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_emissions_owid", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" + "gridPos": { + "h": 27, + "w": 24, + "x": 0, + "y": 16 }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "cpu_emissions_global", - "options": [ + "id": 52, + "options": { + "cellHeight": "sm", + "enablePagination": true, + "showHeader": true, + "sortBy": [ { - "selected": true, - "text": "", - "value": "" + "desc": true, + "displayName": "Start Time" } ], - "query": "", - "type": "textbox" + "zebraStriping": false }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "gpu_usage", - "options": [ - { - "selected": true, - "text": "", - "value": "" + "pluginVersion": "13.3.0", + "targets": [ + { + "columns": [ + { + "selector": "uuid", + "text": "UUID", + "type": "string" + }, + { + "selector": "started_at", + "text": "Start Time", + "timestampFormat": "2006-01-02T15:04:05Z07:00", + "type": "string" + }, + { + "selector": "ended_at", + "text": "End Time", + "type": "string" + }, + { + "selector": "elapsed", + "text": "Elapsed", + "type": "string" + }, + { + "selector": "state", + "text": "State", + "type": "string" + }, + { + "selector": "avg_cpu_usage.global", + "text": "CPU Usage (%)", + "type": "number" + }, + { + "selector": "total_cpu_energy_usage_kwh.total", + "text": "Host Energy (kWh)", + "type": "number" + }, + { + "selector": "total_cpu_emissions_gms.rte_total", + "text": "Host Emissions RTE (gms)", + "type": "number" + }, + { + "selector": "avg_gpu_usage.global", + "text": "GPU Usage (%)", + "type": "number" + }, + { + "selector": "total_gpu_energy_usage_kwh.total", + "text": "GPU Energy (kWh)", + "type": "number" + }, + { + "selector": "total_gpu_emissions_gms.rte_total", + "text": "GPU Emissions RTE (gms)", + "type": "number" + }, + { + "selector": "started_at_ts", + "text": "", + "type": "number" + }, + { + "selector": "ended_at_ts", + "text": "", + "type": "number" + }, + { + "selector": "username", + "text": "", + "type": "string" + }, + { + "selector": "project", + "text": "", + "type": "string" + }, + { + "selector": "total_time_seconds.walltime", + "text": "", + "type": "number" + }, + { + "selector": "avg_cpu_mem_usage.global", + "text": "CPU Mem Usage (%)", + "type": "number" + }, + { + "selector": "avg_gpu_mem_usage.global", + "text": "GPU Mem Usage (%)", + "type": "number" + }, + { + "selector": "created_at_ts", + "text": "", + "type": "number" + }, + { + "selector": "name", + "text": "Name", + "type": "string" + }, + { + "selector": "total_cpu_emissions_gms.emaps_total", + "text": "Host Emissions EMaps (gms)", + "type": "number" + }, + { + "selector": "total_cpu_emissions_gms.owid_total", + "text": "Host Emissions OWID (gms)", + "type": "number" + }, + { + "selector": "total_gpu_emissions_gms.emaps_total", + "text": "GPU Emissions EMaps (gms)", + "type": "number" + }, + { + "selector": "total_gpu_emissions_gms.owid_total", + "text": "GPU Emissions OWID (gms)", + "type": "number" + } + ], + "computed_columns": [], + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" + }, + "filters": [], + "format": "table", + "global_query_id": "", + "pagination_mode": "none", + "parser": "backend", + "refId": "A", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/units${endpoint}", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "project", + "value": "${account}" + }, + { + "key": "from", + "value": "${__from:date:seconds}" + }, + { + "key": "to", + "value": "${__to:date:seconds}" + }, + { + "key": "cluster_id", + "value": "${clusterId}" + }, + { + "key": "user", + "value": "${user}" + }, + { + "key": "running", + "value": "1" + } + ] } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" - }, - "hide": 2, - "name": "gpumem_usage", - "options": [ - { - "selected": true, - "text": "", - "value": "" + } + ], + "title": "List of Openstack VMs", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total Energy (kWh)", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host Energy (kWh)" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU Energy (kWh)" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" }, - "hide": 2, - "name": "gpu_energy", - "options": [ - { - "selected": true, - "text": "", - "value": "" + { + "id": "calculateField", + "options": { + "alias": "Total Emissions EMaps (gms)", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host Emissions EMaps (gms)" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU Emissions EMaps (gms)" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" }, - "hide": 2, - "name": "gpu_emissions_rte", - "options": [ - { - "selected": true, - "text": "", - "value": "" + { + "id": "calculateField", + "options": { + "alias": "Total Emissions OWID (gms)", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host Emissions OWID (gms)" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU Emissions OWID (gms)" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" }, - "hide": 2, - "name": "gpu_emissions_emaps", - "options": [ - { - "selected": true, - "text": "", - "value": "" + { + "id": "calculateField", + "options": { + "alias": "Total Emissions RTE (gms)", + "binary": { + "left": { + "matcher": { + "id": "byName", + "options": "Host Emissions RTE (gms)" + } + }, + "right": { + "matcher": { + "id": "byName", + "options": "GPU Emissions RTE (gms)" + } + } + }, + "mode": "binary", + "reduce": { + "reducer": "sum" + } } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" }, - "hide": 2, - "name": "gpu_emissions_wt", - "options": [ - { - "selected": true, - "text": "", - "value": "" + { + "id": "organize", + "options": { + "excludeByName": { + "Partition": false, + "QoS": false, + "created_at_ts": false, + "ended_at_ts": false, + "project": false, + "started_at_ts": false, + "total_time_seconds.walltime": true, + "username": true + }, + "includeByName": {}, + "indexByName": { + "CPU Mem Usage (%)": 11, + "CPU Usage (%)": 10, + "Elapsed": 4, + "End Time": 3, + "GPU Emissions EMaps (gms)": 20, + "GPU Emissions OWID (gms)": 21, + "GPU Emissions RTE (gms)": 19, + "GPU Energy (kWh)": 18, + "GPU Mem Usage (%)": 17, + "GPU Usage (%)": 16, + "Host Emissions EMaps (gms)": 14, + "Host Emissions OWID (gms)": 15, + "Host Emissions RTE (gms)": 13, + "Host Energy (kWh)": 12, + "Name": 1, + "Nodelist": 22, + "Partition": 23, + "QoS": 24, + "Start Time": 2, + "State": 5, + "Total Emissions EMaps (gms)": 8, + "Total Emissions OWID (gms)": 9, + "Total Emissions RTE (gms)": 7, + "Total Energy (kWh)": 6, + "UUID": 0, + "created_at_ts": 25, + "ended_at_ts": 26, + "project": 27, + "started_at_ts": 28, + "total_time_seconds.walltime": 29, + "username": 30 + }, + "renameByName": {} } - ], - "query": "", - "type": "textbox" - }, + } + ], + "type": "table" + } + ], + "preload": false, + "refresh": "", + "schemaVersion": 42, + "tags": [ + "vm", + "aggregate", + "openstack", + "energy", + "emissions" + ], + "templating": { + "list": [ { - "current": { - "text": "", - "value": "" + "allowCustomValue": true, + "current": {}, + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "hide": 2, - "name": "gpu_emissions_owid", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" + "definition": "", + "includeAll": false, + "label": "User:", + "name": "user", + "options": [], + "query": { + "infinityQuery": { + "columns": [ + { + "selector": "name", + "text": "__text", + "type": "string" + }, + { + "selector": "name", + "text": "__value", + "type": "string" + } + ], + "filters": [], + "format": "table", + "parser": "backend", + "refId": "", + "root_selector": "data", + "source": "url", + "type": "json", + "url": "/api/v1/users/admin", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "cluster_id", + "value": "os-0" + } + ] + } + }, + "query": "", + "queryType": "infinity" }, - "hide": 2, - "name": "gpu_emissions_global", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" + "refresh": 1, + "regex": "gazoo|betty", + "regexApplyTo": "value", + "type": "query" }, { - "current": { - "text": "", - "value": "" + "allowCustomValue": true, + "current": {}, + "datasource": { + "type": "yesoreyeram-infinity-datasource", + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, - "hide": 2, - "name": "total_energy", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" - }, - { - "current": { - "text": "", - "value": "" + "definition": "", + "includeAll": false, + "label": "Project:", + "name": "account", + "options": [], + "query": { + "infinityQuery": { + "columns": [ + { + "selector": "", + "text": "", + "type": "string" + } + ], + "filters": [], + "format": "table", + "parser": "backend", + "refId": "", + "root_selector": "data.projects[*]", + "source": "url", + "type": "uql", + "uql": "parse-json\n| scope \"data\"\n| jsonata \"[projects]\"", + "url": "/api/v1/users/admin", + "url_options": { + "data": "", + "headers": [], + "method": "GET", + "params": [ + { + "key": "cluster_id", + "value": "os-0" + }, + { + "key": "user", + "value": "${user}" + } + ] + } + }, + "query": "", + "queryType": "infinity" }, - "hide": 2, - "name": "total_emissions_rte", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "type": "textbox" + "refresh": 1, + "regex": "", + "regexApplyTo": "value", + "type": "query" }, { + "allowCustomValue": true, "current": { - "text": "", - "value": "" + "text": "rte", + "value": "rte" }, - "hide": 2, - "name": "total_emissions_emaps", + "includeAll": false, + "label": "Emission Factor Provider:", + "name": "provider", "options": [ { "selected": true, - "text": "", - "value": "" + "text": "RTE eCO2 Mix", + "value": "rte" + }, + { + "selected": false, + "text": "Electricity Maps", + "value": "emaps" + }, + { + "selected": false, + "text": "OWID", + "value": "owid" } ], - "query": "", - "type": "textbox" + "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid", + "type": "custom", + "valuesFormat": "csv" }, { + "description": "Grafana Organization ID", + "hide": 2, + "name": "orgId", + "query": "${VAR_ORGID}", + "skipUrlSync": true, + "type": "constant", "current": { - "text": "", - "value": "" + "value": "${VAR_ORGID}", + "text": "${VAR_ORGID}", + "selected": false }, - "hide": 2, - "name": "total_emissions_wt", "options": [ { - "selected": true, - "text": "", - "value": "" + "value": "${VAR_ORGID}", + "text": "${VAR_ORGID}", + "selected": false } - ], - "query": "", - "type": "textbox" + ] }, { + "description": "CEEMS Cluster ID defined in CEEMS API server config", + "hide": 2, + "name": "clusterId", + "query": "${VAR_CLUSTERID}", + "skipUrlSync": true, + "type": "constant", "current": { - "text": "", - "value": "" + "value": "${VAR_CLUSTERID}", + "text": "${VAR_CLUSTERID}", + "selected": false }, - "hide": 2, - "name": "total_emissions_owid", "options": [ { - "selected": true, - "text": "", - "value": "" + "value": "${VAR_CLUSTERID}", + "text": "${VAR_CLUSTERID}", + "selected": false } - ], - "query": "", - "type": "textbox" + ] }, { + "description": "Set it to /admin for admin dashboards to consult usage statistics of any user. For user dashboards that restrict data to current logged user, set it to empty space.", + "hide": 2, + "name": "endpoint", + "query": "${VAR_ENDPOINT}", + "skipUrlSync": true, + "type": "constant", "current": { - "text": "", - "value": "" + "value": "${VAR_ENDPOINT}", + "text": "${VAR_ENDPOINT}", + "selected": false }, - "hide": 2, - "name": "total_emissions_global", "options": [ { - "selected": true, - "text": "", - "value": "" + "value": "${VAR_ENDPOINT}", + "text": "${VAR_ENDPOINT}", + "selected": false } - ], - "query": "", - "type": "textbox" + ] } ] }, "time": { - "from": "2025-02-07T15:58:19.000Z", - "to": "2025-02-07T16:05:03.000Z" + "from": "now-90d", + "to": "now" }, "timepicker": { - "hidden": false, "refresh_intervals": [ "5m", "15m", @@ -3064,9 +2340,9 @@ "1d" ] }, - "timezone": "", - "title": "Single VM Metrics", - "uid": "os-vm-metrics", - "version": 1, + "timezone": "browser", + "title": "User Openstack VM Summary", + "uid": "be5x3it7gpx4wf", + "version": 7, "weekStart": "" -} \ No newline at end of file +} diff --git a/thirdparty/grafana/dashboards/slurm/slurm-job-summary.json b/thirdparty/grafana/dashboards/slurm/slurm-job-summary.json index 01650a5b..98d5bf5b 100644 --- a/thirdparty/grafana/dashboards/slurm/slurm-job-summary.json +++ b/thirdparty/grafana/dashboards/slurm/slurm-job-summary.json @@ -1,20 +1,20 @@ { "__inputs": [ { - "name": "VAR_ORGID", - "type": "constant", - "label": "Organization ID", - "value": "1", - "description": "Grafana Organization ID" - }, - { - "name": "DS_CEEMS-API", - "label": "CEEMS API Server's datasource", + "name": "DS_YESOREYERAM-INFINITY-DATASOURCE", + "label": "yesoreyeram-infinity-datasource", "description": "", "type": "datasource", "pluginId": "yesoreyeram-infinity-datasource", "pluginName": "Infinity" }, + { + "name": "VAR_ORGID", + "type": "constant", + "label": "Grafana Organization ID", + "value": "", + "description": "Grafana Organization ID" + }, { "name": "VAR_CLUSTERID", "type": "constant", @@ -42,7 +42,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.4.0" + "version": "13.3.0" }, { "type": "panel", @@ -72,7 +72,7 @@ "type": "datasource", "id": "yesoreyeram-infinity-datasource", "name": "Infinity", - "version": "3.0.0-beta.1" + "version": "4.1.4" } ], "annotations": { @@ -95,7 +95,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, "links": [ { "asDropdown": false, @@ -110,6 +109,7 @@ "url": "https://github.com/ceems-dev/ceems" } ], + "liveNow": false, "panels": [ { "collapsed": false, @@ -119,15 +119,14 @@ "x": 0, "y": 0 }, - "id": 9, - "panels": [], + "id": 54, "title": "Aggregate Usage Statistics of User ${user} from ${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}", "type": "row" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Average usage statistics of all jobs of the user", "fieldConfig": { @@ -135,13 +134,12 @@ "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "red", - "value": null + "value": 0 }, { "color": "orange", @@ -165,6 +163,14 @@ }, "id": 10, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -175,11 +181,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -211,7 +222,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -278,7 +289,7 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of all jobs of the user", "fieldConfig": { @@ -286,13 +297,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -328,7 +338,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -351,7 +361,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -466,13 +476,13 @@ "content": "# README\n\nThe panels to the left show the overall usage by the user\n**${user}** using the project **${account}**\nduring the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the jobs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the jobs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the jobs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host is the equivalent emissions due to the energy consumed by host components such as CPU, CPU memory and\n other peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { @@ -480,13 +490,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -522,7 +531,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -545,7 +554,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "User == \"${user}\"", "filters": [], @@ -710,12 +719,12 @@ "x": 0, "y": 13 }, - "id": 45, + "id": 55, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Average usage statistics of all jobs of the user", "fieldConfig": { @@ -723,12 +732,12 @@ "color": { "mode": "thresholds" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "red" + "color": "red", + "value": 0 }, { "color": "orange", @@ -741,8 +750,7 @@ ] }, "unit": "percent" - }, - "overrides": [] + } }, "gridPos": { "h": 12, @@ -752,6 +760,14 @@ }, "id": 42, "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", @@ -762,11 +778,16 @@ "fields": "", "values": false }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", "showThresholdLabels": false, "showThresholdMarkers": true, - "sizing": "auto" + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -798,7 +819,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -850,6 +871,10 @@ { "key": "field", "value": "username" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -861,7 +886,7 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of all jobs of the user", "fieldConfig": { @@ -869,12 +894,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -883,8 +908,7 @@ ] }, "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 6, @@ -910,7 +934,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -933,7 +957,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -977,6 +1001,10 @@ { "key": "field", "value": "username" + }, + { + "key": "user", + "value": "${user}" } ] } @@ -1028,10 +1056,6 @@ "type": "stat" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 12, "w": 8, @@ -1048,14 +1072,15 @@ "content": "# README\n\nThe panels to the left show the overall usage by the project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}. This includes\nthe usage of all the users in the project. For consulting only user specific usage,\nplease refer to the panels above.\n\n- Average CPU, GPU, CPU memory and GPU memory usage is the average over all the jobs\nof the user during the above stated period.\n\n- Total energy usage is the total energy consumed by the jobs of the user during the above\nstated period.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU corresponds to the energy consumption of GPUs alone.\n - Total is the sum of power consumption of Host and GPUs.\n\n- Total emissions is the total equivalent emissions due the energy consumed by the jobs\nof the user during the above stated period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n\n - Host corresponds to the energy consumption by host components such as CPU, CPU memory and other\n peripherals of the node excluding GPU (if present)\n - GPU is the equivalent emissions due to energy consumption of GPUs alone.\n - Total is the sum of equivalent emissions of Host and GPUs.", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", + "targets": [], "title": "", "type": "text" }, { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { @@ -1063,12 +1088,12 @@ "color": { "mode": "palette-classic" }, - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": 0 }, { "color": "red", @@ -1077,14 +1102,13 @@ ] }, "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 6, "w": 8, "x": 8, - "y": 94 + "y": 20 }, "id": 50, "options": { @@ -1104,7 +1128,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1127,7 +1151,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1295,12 +1319,12 @@ "x": 0, "y": 14 }, - "id": 41, + "id": 56, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total energy consumption of each user in the project ${account}", "fieldConfig": { @@ -1315,11 +1339,8 @@ "viz": false } }, - "fieldMinMax": false, - "mappings": [], "unit": "kwatth" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1347,15 +1368,16 @@ "calcs": [ "allValues" ], - "fields": "/^Total$/", + "fields": "", "values": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "12.1.1", "targets": [ { "columns": [ @@ -1384,7 +1406,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -1455,7 +1477,7 @@ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "Total emissions from the energy consumption of all jobs of the user using emission factor from RTE eCO2 mix data", "fieldConfig": { @@ -1470,10 +1492,8 @@ "viz": false } }, - "mappings": [], "unit": "massg" - }, - "overrides": [] + } }, "gridPos": { "h": 10, @@ -1481,7 +1501,7 @@ "x": 8, "y": 15 }, - "id": 51, + "id": 53, "options": { "displayLabels": [ "name", @@ -1505,11 +1525,12 @@ "values": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.4.0", + "pluginVersion": "12.1.1", "targets": [ { "columns": [ @@ -1598,7 +1619,7 @@ ], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filterExpression": "", "filters": [], @@ -1666,10 +1687,6 @@ "type": "piechart" }, { - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, "gridPos": { "h": 10, "w": 8, @@ -1686,7 +1703,8 @@ "content": "# README\n\nThe panels to the left show the breakdown of total energy consumption and\nequivalent emissions for project\n**${account}** during the period\n${__from:date:YYYY-MM-DD HH:mm:ss} to ${__to:date:YYYY-MM-DD HH:mm:ss}.\n\n- Total energy consumption is sum of energy consumed by host and GPUs (if present)\nfor all jobs ran during this period.\n\n- Total equivalent emissions is the sum of equivalent emissions from the energy\nconsumed by host and GPUs (if present) for all jobs ran during this period. Real time emission factors\n[RTE eCO2](https://www.rte-france.com/en/eco2mix/co2-emissions),\n[Electricity Maps](https://app.electricitymaps.com/map/72h) and\nstatic emission factor from [OWID](https://ourworldindata.org/co2-and-greenhouse-gas-emissions)\nare supported in the estimation of the emissions.\n", "mode": "markdown" }, - "pluginVersion": "11.4.0", + "pluginVersion": "12.1.1", + "targets": [], "title": "", "type": "text" } @@ -1702,12 +1720,12 @@ "x": 0, "y": 15 }, - "id": 32, + "id": 57, "panels": [ { "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "description": "List of all SLURM jobs of user ${user} with project ${account}. By clicking the row, user will be redirected to the dashboard that shows the time series metrics of that compute unit.", "fieldConfig": { @@ -1718,26 +1736,28 @@ "custom": { "align": "left", "cellOptions": { - "type": "auto", - "wrapText": false + "type": "auto" }, "filterable": true, - "inspect": false + "footer": { + "reducers": [] + }, + "inspect": false, + "wrapText": false }, "links": [ { "targetBlank": true, "title": "SLURM Job Metrics Dashboard", - "url": "/d/slurm-single-job-metrics/_?orgId=${ordId}&var-jobid=${__data.fields.JobID}&from=${__data.fields.started_at_ts}&to=${__data.fields.ended_at_ts}&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-name=${__data.fields.Name}&var-nodelist=${__data.fields.Nodelist}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-partition=${__data.fields.Partition}&var-qos=${__data.fields.QoS}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-cpu_emissions_wt=${__data.fields[\"Host Emissions WTime (gms)\"]}&var-cpu_emissions_global=${__data.fields[\"Host Emissions World Avg. (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-gpu_emissions_wt=${__data.fields[\"GPU Emissions WTime (gms)\"]}&var-gpu_emissions_global=${__data.fields[\"GPU Emissions World Avg. (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}&var-total_emissions_wt=${__data.fields[\"Total Emissions WTime (gms)\"]}&var-total_emissions_global=${__data.fields[\"Total Emissions World Avg. (gms)\"]}" + "url": "/d/single-job-metrics/_?orgId=${orgId}&var-jobid=${__data.fields.JobID}&from=${__data.fields.started_at_ts}&to=${__data.fields.ended_at_ts}&var-provider=rte&var-submit=${__data.fields.created_at_ts}&var-name=${__data.fields.Name}&var-nodelist=${__data.fields.Nodelist}&var-state=${__data.fields.State}&var-elapsed=${__data.fields.Elapsed}&var-account=${account}&var-partition=${__data.fields.Partition}&var-qos=${__data.fields.QoS}&var-cpu_usage=${__data.fields[\"CPU Usage (%)\"]}&var-cpumem_usage=${__data.fields[\"CPU Mem Usage (%)\"]}&var-cpu_energy=${__data.fields[\"Host Energy (kWh)\"]}&var-cpu_emissions_rte=${__data.fields[\"Host Emissions RTE (gms)\"]}&var-cpu_emissions_emaps=${__data.fields[\"Host Emissions EMaps (gms)\"]}&var-cpu_emissions_owid=${__data.fields[\"Host Emissions OWID (gms)\"]}&var-cpu_emissions_wt=${__data.fields[\"Host Emissions WTime (gms)\"]}&var-cpu_emissions_global=${__data.fields[\"Host Emissions World Avg. (gms)\"]}&var-gpu_usage=${__data.fields[\"GPU Usage (%)\"]}&var-gpumem_usage=${__data.fields[\"GPU Mem Usage (%)\"]}&var-gpu_energy=${__data.fields[\"GPU Energy (kWh)\"]}&var-gpu_emissions_rte=${__data.fields[\"GPU Emissions RTE (gms)\"]}&var-gpu_emissions_emaps=${__data.fields[\"GPU Emissions EMaps (gms)\"]}&var-gpu_emissions_owid=${__data.fields[\"GPU Emissions OWID (gms)\"]}&var-gpu_emissions_wt=${__data.fields[\"GPU Emissions WTime (gms)\"]}&var-gpu_emissions_global=${__data.fields[\"GPU Emissions World Avg. (gms)\"]}&var-total_energy=${__data.fields[\"Total Energy (kWh)\"]}&var-total_emissions_rte=${__data.fields[\"Total Emissions RTE (gms)\"]}&var-total_emissions_emaps=${__data.fields[\"Total Emissions EMaps (gms)\"]}&var-total_emissions_owid=${__data.fields[\"Total Emissions OWID (gms)\"]}&var-total_emissions_wt=${__data.fields[\"Total Emissions WTime (gms)\"]}&var-total_emissions_global=${__data.fields[\"Total Emissions World Avg. (gms)\"]}" } ], - "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -1754,7 +1774,7 @@ }, "properties": [ { - "id": "custom.hidden", + "id": "custom.hideFrom.viz", "value": true } ] @@ -1777,29 +1797,22 @@ "h": 27, "w": 24, "x": 0, - "y": 26 + "y": 16 }, "id": 52, "options": { "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": true, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, + "enablePagination": true, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "Start Time" } - ] + ], + "zebraStriping": false }, - "pluginVersion": "11.4.0", + "pluginVersion": "13.3.0", "targets": [ { "columns": [ @@ -1963,7 +1976,7 @@ "computed_columns": [], "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "filters": [], "format": "table", @@ -2218,8 +2231,9 @@ "type": "row" } ], + "preload": false, "refresh": "", - "schemaVersion": 40, + "schemaVersion": 42, "tags": [ "job", "aggregate", @@ -2234,10 +2248,11 @@ "templating": { "list": [ { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, @@ -2286,10 +2301,11 @@ "type": "query" }, { + "allowCustomValue": true, "current": {}, "datasource": { "type": "yesoreyeram-infinity-datasource", - "uid": "${DS_CEEMS-API}" + "uid": "${DS_YESOREYERAM-INFINITY-DATASOURCE}" }, "definition": "", "includeAll": false, @@ -2338,10 +2354,12 @@ "type": "query" }, { + "allowCustomValue": true, "current": { - "text": "owid", - "value": "owid" + "text": "rte", + "value": "rte" }, + "includeAll": false, "label": "Emission Factor Provider:", "name": "provider", "options": [ @@ -2359,10 +2377,16 @@ "selected": false, "text": "OWID", "value": "owid" + }, + { + "selected": false, + "text": "Watt Time", + "value": "wt" } ], - "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid", - "type": "custom" + "query": "RTE eCO2 Mix : rte, Electricity Maps : emaps, OWID : owid, Watt Time : wt", + "type": "custom", + "valuesFormat": "csv" }, { "description": "Grafana Organization ID", @@ -2440,9 +2464,9 @@ "1d" ] }, - "timezone": "", + "timezone": "browser", "title": "User SLURM Job Summary", "uid": "slurm-job-summary", - "version": 1, + "version": 9, "weekStart": "" -} \ No newline at end of file +} diff --git a/website/cspell.json b/website/cspell.json index 5c874124..d56bec42 100644 --- a/website/cspell.json +++ b/website/cspell.json @@ -92,7 +92,8 @@ "ENVDIR", "Paipuri", "Neuwirth", - "Weinzierl" + "Weinzierl", + "IDRIS" ], // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index c7e040d1..423796c1 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -380,13 +380,8 @@ const config: Config = { // The application ID provided by Algolia appId: 'KQ58EXUULN', // Public API key: it is safe to commit it - apiKey: '16e0dc2efb99e9d654683fd9b9602082', - indexName: 'mahendrapaipuriio', - // // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs - replaceSearchResultPathname: { - from: '/ceems/', - to: '/', - }, + apiKey: '04b21253b1cc361fb93228b268f5b85e', + indexName: 'ceems', // We may need to tune `contextualSearch` and `searchParameters` to handle search for versioned docs // Optional: see doc section -- https://docusaurus.io/docs/search#contextual-search contextualSearch: false,