Skip to content

Commit

Permalink
add cabana pic
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Nov 27, 2023
1 parent 64865cf commit 7c94d5e
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
## ["network-chatterbug", "ghcr.io/converged-computing/metric-chatterbug:latest", 120],
["app-nekbone", "ghcr.io/converged-computing/metric-nekbone:latest", 120],
["app-ldms", "ghcr.io/converged-computing/metric-ovis-hpc:latest", 120],
["app-cabanaPIC", "ghcr.io/converged-computing/metric-cabanapic:latest", 120],
["app-amg", "ghcr.io/converged-computing/metric-amg:latest", 120],
["app-kripke", "ghcr.io/converged-computing/metric-kripke:latest", 120],
["app-pennant", "ghcr.io/converged-computing/metric-pennant:latest", 120],
Expand Down
7 changes: 7 additions & 0 deletions docs/_static/data/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"image": "ghcr.io/converged-computing/metric-bdas:latest",
"url": "https://asc.llnl.gov/sites/asc/files/2020-09/BDAS_Summary_b4bcf27_0.pdf"
},
{
"name": "app-cabanapic",
"description": "structured PIC (particle in cell) proxy app",
"family": "simulation",
"image": "ghcr.io/converged-computing/metric-cabanapic:latest",
"url": "https://github.com/ECP-copa/CabanaPIC"
},
{
"name": "app-hpl",
"description": "High-Performance Linpack (HPL)",
Expand Down
12 changes: 12 additions & 0 deletions docs/getting_started/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@ More likely you want an actual problem size on a specific number of node and tas
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.
See [this guide](https://asc.llnl.gov/sites/asc/files/2020-09/AMG_Summary_v1_7.pdf) for more detail.
### app-cabanaPIC
- *[app-cabanaPIC](https://github.com/converged-computing/metrics-operator/tree/main/examples/tests/app-cabanaPIC)*
This is a [particle in cell](https://github.com/ECP-copa/CabanaPIC/issues/3) simulation that is experimental because it does not
seem to support multiple nodes yet (but should).
| Name | Description | Option Key | Type | Default |
|-----|-------------|------------|------|---------|
| command | The full command to run | options->command | string | cbnpic |
| workdir | The working directory for the command | options->workdir | string | /opt/cabanaPIC/build |
### app-quicksilver
- *[app-quicksilver](https://github.com/converged-computing/metrics-operator/tree/main/examples/tests/app-quicksilver)*
Expand Down
76 changes: 76 additions & 0 deletions examples/tests/app-cabanaPIC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Laghos Example

This is an example of a metric app, Laghos.
We have not yet added a Python example as we want a use case first, but can and will when it is warranted.

## Usage

Create a cluster

```bash
kind create cluster
```

and install JobSet to it.

```bash
VERSION=v0.2.0
kubectl apply --server-side -f https://github.com/kubernetes-sigs/jobset/releases/download/$VERSION/manifests.yaml
```

Install the operator (from the development manifest here):

```bash
$ kubectl apply -f ../../dist/metrics-operator-dev.yaml
```

How to see metrics operator logs:

```bash
$ kubectl logs -n metrics-system metrics-controller-manager-859c66464c-7rpbw
```

Then create the metrics set. This is going to run cabanaPIC on a single node.

```bash
kubectl apply -f metrics.yaml
```

Wait until you see the pod created by the job and then running.

```bash
kubectl get pods
```
```diff
NAME READY STATUS RESTARTS AGE
metricset-sample-l-0-0-lt782 1/1 Running 0 3s
```

And the output is the simulation. There are output files generated but we aren't retrieving them for this demo.

```bash
kubectl logs metricset-sample-l-0-0-lt782 -f
```
```console
...
5988 117.057419 6.957814e-05 2.644137e-03
5989 117.076973 7.096451e-05 2.644661e-03
5990 117.096519 7.223449e-05 2.645145e-03
5991 117.116066 7.343685e-05 2.645631e-03
5992 117.135612 7.469198e-05 2.646064e-03
5993 117.155167 7.599744e-05 2.646421e-03
5994 117.174713 7.732580e-05 2.646714e-03
5995 117.194260 7.854241e-05 2.646956e-03
5996 117.213814 7.978067e-05 2.647144e-03
5997 117.233360 8.094098e-05 2.647246e-03
5998 117.252907 8.202127e-05 2.647287e-03
5999 117.272453 8.307652e-05 2.647311e-03
6000 117.292007 8.416179e-05 2.647350e-03
METRICS OPERATOR COLLECTION END
```

When you are done, cleanup.

```bash
kubectl delete -f metrics.yaml
```
11 changes: 11 additions & 0 deletions examples/tests/app-cabanaPIC/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: flux-framework.org/v1alpha2
kind: MetricSet
metadata:
labels:
app.kubernetes.io/name: metricset
app.kubernetes.io/instance: metricset-sample
name: metricset-sample
spec:
pods: 1
metrics:
- name: app-cabanapic
72 changes: 72 additions & 0 deletions pkg/metrics/app/cabana.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
Copyright 2023 Lawrence Livermore National Security, LLC
(c.f. AUTHORS, NOTICE.LLNS, COPYING)
SPDX-License-Identifier: MIT
*/

package application

import (
api "github.com/converged-computing/metrics-operator/api/v1alpha2"
"k8s.io/apimachinery/pkg/util/intstr"

metrics "github.com/converged-computing/metrics-operator/pkg/metrics"
)

const (
cabanapicIdentifier = "app-cabanapic"
cabanapicSummary = "structured PIC (particle in cell) proxy app"
cabanapicContainer = "ghcr.io/converged-computing/metric-cabanapic:latest"
)

type CabanaPIC struct {
metrics.LauncherWorker
}

// I think this is a simulation?
func (m CabanaPIC) Family() string {
return metrics.SimulationFamily
}

func (m CabanaPIC) Validate(set *api.MetricSet) bool {
return true
}

func (m CabanaPIC) Url() string {
return "https://github.com/ECP-copa/CabanaPIC"
}

// Set custom options / attributes for the metric
func (m *CabanaPIC) SetOptions(metric *api.Metric) {

m.Identifier = cabanapicIdentifier
m.Summary = cabanapicSummary
m.Container = cabanapicContainer

// Set user defined values or fall back to defaults
m.Prefix = "/bin/bash"
m.Command = "cbnpic"
m.Workdir = "/opt/cabanaPIC/build"
m.SetDefaultOptions(metric)
}

// Exported options and list options
func (m CabanaPIC) Options() map[string]intstr.IntOrString {
return map[string]intstr.IntOrString{
"command": intstr.FromString(m.Command),
"prefix": intstr.FromString(m.Prefix),
"workdir": intstr.FromString(m.Workdir),
}
}

func init() {
base := metrics.BaseMetric{
Identifier: cabanapicIdentifier,
Summary: cabanapicSummary,
Container: cabanapicContainer,
}
launcher := metrics.LauncherWorker{BaseMetric: base}
CabanaPIC := CabanaPIC{LauncherWorker: launcher}
metrics.Register(&CabanaPIC)
}

0 comments on commit 7c94d5e

Please sign in to comment.