Skip to content

Commit 8835f15

Browse files
authored
add cabana pic (#82)
Signed-off-by: vsoch <vsoch@users.noreply.github.com> Co-authored-by: vsoch <vsoch@users.noreply.github.com>
1 parent 64865cf commit 8835f15

File tree

6 files changed

+179
-0
lines changed

6 files changed

+179
-0
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
## ["network-chatterbug", "ghcr.io/converged-computing/metric-chatterbug:latest", 120],
7575
["app-nekbone", "ghcr.io/converged-computing/metric-nekbone:latest", 120],
7676
["app-ldms", "ghcr.io/converged-computing/metric-ovis-hpc:latest", 120],
77+
["app-cabanaPIC", "ghcr.io/converged-computing/metric-cabanapic:latest", 120],
7778
["app-amg", "ghcr.io/converged-computing/metric-amg:latest", 120],
7879
["app-kripke", "ghcr.io/converged-computing/metric-kripke:latest", 120],
7980
["app-pennant", "ghcr.io/converged-computing/metric-pennant:latest", 120],

docs/_static/data/metrics.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"image": "ghcr.io/converged-computing/metric-bdas:latest",
1414
"url": "https://asc.llnl.gov/sites/asc/files/2020-09/BDAS_Summary_b4bcf27_0.pdf"
1515
},
16+
{
17+
"name": "app-cabanapic",
18+
"description": "structured PIC (particle in cell) proxy app",
19+
"family": "simulation",
20+
"image": "ghcr.io/converged-computing/metric-cabanapic:latest",
21+
"url": "https://github.com/ECP-copa/CabanaPIC"
22+
},
1623
{
1724
"name": "app-hpl",
1825
"description": "High-Performance Linpack (HPL)",

docs/getting_started/metrics.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ More likely you want an actual problem size on a specific number of node and tas
330330
run a larger problem and the parser does not work as expected, please [send us the output](https://github.com/converged-computing/metrics-operator/issues) and we will provide an updated parser.
331331
See [this guide](https://asc.llnl.gov/sites/asc/files/2020-09/AMG_Summary_v1_7.pdf) for more detail.
332332
333+
### app-cabanaPIC
334+
335+
- *[app-cabanaPIC](https://github.com/converged-computing/metrics-operator/tree/main/examples/tests/app-cabanaPIC)*
336+
337+
This is a [particle in cell](https://github.com/ECP-copa/CabanaPIC/issues/3) simulation that is experimental because it does not
338+
seem to support multiple nodes yet (but should).
339+
340+
| Name | Description | Option Key | Type | Default |
341+
|-----|-------------|------------|------|---------|
342+
| command | The full command to run | options->command | string | cbnpic |
343+
| workdir | The working directory for the command | options->workdir | string | /opt/cabanaPIC/build |
344+
333345
### app-quicksilver
334346
335347
- *[app-quicksilver](https://github.com/converged-computing/metrics-operator/tree/main/examples/tests/app-quicksilver)*
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Laghos Example
2+
3+
This is an example of a metric app, Laghos.
4+
We have not yet added a Python example as we want a use case first, but can and will when it is warranted.
5+
6+
## Usage
7+
8+
Create a cluster
9+
10+
```bash
11+
kind create cluster
12+
```
13+
14+
and install JobSet to it.
15+
16+
```bash
17+
VERSION=v0.2.0
18+
kubectl apply --server-side -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml
19+
```
20+
21+
Install the operator (from the development manifest here):
22+
23+
```bash
24+
$ kubectl apply -f ../../dist/metrics-operator-dev.yaml
25+
```
26+
27+
How to see metrics operator logs:
28+
29+
```bash
30+
$ kubectl logs -n metrics-system metrics-controller-manager-859c66464c-7rpbw
31+
```
32+
33+
Then create the metrics set. This is going to run cabanaPIC on a single node.
34+
35+
```bash
36+
kubectl apply -f metrics.yaml
37+
```
38+
39+
Wait until you see the pod created by the job and then running.
40+
41+
```bash
42+
kubectl get pods
43+
```
44+
```diff
45+
NAME READY STATUS RESTARTS AGE
46+
metricset-sample-l-0-0-lt782 1/1 Running 0 3s
47+
```
48+
49+
And the output is the simulation. There are output files generated but we aren't retrieving them for this demo.
50+
51+
```bash
52+
kubectl logs metricset-sample-l-0-0-lt782 -f
53+
```
54+
```console
55+
...
56+
5988 117.057419 6.957814e-05 2.644137e-03
57+
5989 117.076973 7.096451e-05 2.644661e-03
58+
5990 117.096519 7.223449e-05 2.645145e-03
59+
5991 117.116066 7.343685e-05 2.645631e-03
60+
5992 117.135612 7.469198e-05 2.646064e-03
61+
5993 117.155167 7.599744e-05 2.646421e-03
62+
5994 117.174713 7.732580e-05 2.646714e-03
63+
5995 117.194260 7.854241e-05 2.646956e-03
64+
5996 117.213814 7.978067e-05 2.647144e-03
65+
5997 117.233360 8.094098e-05 2.647246e-03
66+
5998 117.252907 8.202127e-05 2.647287e-03
67+
5999 117.272453 8.307652e-05 2.647311e-03
68+
6000 117.292007 8.416179e-05 2.647350e-03
69+
METRICS OPERATOR COLLECTION END
70+
```
71+
72+
When you are done, cleanup.
73+
74+
```bash
75+
kubectl delete -f metrics.yaml
76+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: flux-framework.org/v1alpha2
2+
kind: MetricSet
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: metricset
6+
app.kubernetes.io/instance: metricset-sample
7+
name: metricset-sample
8+
spec:
9+
pods: 1
10+
metrics:
11+
- name: app-cabanapic

pkg/metrics/app/cabana.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
Copyright 2023 Lawrence Livermore National Security, LLC
3+
(c.f. AUTHORS, NOTICE.LLNS, COPYING)
4+
5+
SPDX-License-Identifier: MIT
6+
*/
7+
8+
package application
9+
10+
import (
11+
api "github.com/converged-computing/metrics-operator/api/v1alpha2"
12+
"k8s.io/apimachinery/pkg/util/intstr"
13+
14+
metrics "github.com/converged-computing/metrics-operator/pkg/metrics"
15+
)
16+
17+
const (
18+
cabanapicIdentifier = "app-cabanapic"
19+
cabanapicSummary = "structured PIC (particle in cell) proxy app"
20+
cabanapicContainer = "ghcr.io/converged-computing/metric-cabanapic:latest"
21+
)
22+
23+
type CabanaPIC struct {
24+
metrics.LauncherWorker
25+
}
26+
27+
// I think this is a simulation?
28+
func (m CabanaPIC) Family() string {
29+
return metrics.SimulationFamily
30+
}
31+
32+
func (m CabanaPIC) Validate(set *api.MetricSet) bool {
33+
return true
34+
}
35+
36+
func (m CabanaPIC) Url() string {
37+
return "https://github.com/ECP-copa/CabanaPIC"
38+
}
39+
40+
// Set custom options / attributes for the metric
41+
func (m *CabanaPIC) SetOptions(metric *api.Metric) {
42+
43+
m.Identifier = cabanapicIdentifier
44+
m.Summary = cabanapicSummary
45+
m.Container = cabanapicContainer
46+
47+
// Set user defined values or fall back to defaults
48+
m.Prefix = "/bin/bash"
49+
m.Command = "cbnpic"
50+
m.Workdir = "/opt/cabanaPIC/build"
51+
m.SetDefaultOptions(metric)
52+
}
53+
54+
// Exported options and list options
55+
func (m CabanaPIC) Options() map[string]intstr.IntOrString {
56+
return map[string]intstr.IntOrString{
57+
"command": intstr.FromString(m.Command),
58+
"prefix": intstr.FromString(m.Prefix),
59+
"workdir": intstr.FromString(m.Workdir),
60+
}
61+
}
62+
63+
func init() {
64+
base := metrics.BaseMetric{
65+
Identifier: cabanapicIdentifier,
66+
Summary: cabanapicSummary,
67+
Container: cabanapicContainer,
68+
}
69+
launcher := metrics.LauncherWorker{BaseMetric: base}
70+
CabanaPIC := CabanaPIC{LauncherWorker: launcher}
71+
metrics.Register(&CabanaPIC)
72+
}

0 commit comments

Comments
 (0)