Skip to main content

Generate resource graphs using Flux

Project description

Compspec Flux

PyPI version

A compspec (Composition spec) is a specification and model for comparing things. Compspec Flux provides a simple means to extract metadata about a running flux instance, namely the graph of nodes. Other links of interest include:

  • Compspec: the Python library that discovers and loads this plugin.
  • Compatibility: of container images and applications to a host environment.
  • Compspec Go: the Go library that retrieves artifacts and makes graphs for image selection and scheduling.

Usage

Install compspec and the plugin here:

pip install compspec
pip install compspec-flux

Then (alongside a Flux instance) run the plugin. Note that the VSCode setup provided here will provide this for you. You can use defaults, or add any parameters to the plugin after the plugin name "flux" Here is how to start a flux instance:

flux start --test-size=4

And here is how to print to the terminal:

compspec extract flux
Flux output
{
    "graph": {
        "nodes": {
            "0": {
                "id": 0,
                "metadata": {
                    "type": "cluster",
                    "basename": "cluster",
                    "name": "cluster0",
                    "uniq_id": 0,
                    "containment": {
                        "paths": "/cluster0"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false
                }
            },
            "1": {
                "id": 1,
                "metadata": {
                    "type": "node",
                    "basename": "node",
                    "name": "node1",
                    "uniq_id": 1,
                    "containment": {
                        "paths": "/cluster0/node1"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false
                }
            }
        },
        "edges": [
            {
                "source": "0",
                "target": "1",
                "metadata": {
                    "name": {
                        "containment": "contains"
                    }
                }
            },
            {
                "source": "1",
                "target": "0",
                "metadata": {
                    "name": {
                        "containment": "in"
                    }
                }
            }
        ]
    }
}

And how to save to file

compspec extract --outfile cluster-resources.json flux

License

HPCIC DevTools is distributed under the terms of the MIT license. All new contributions must be made under this license.

See LICENSE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: (MIT)

LLNL-CODE- 842614

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compspec-flux-0.0.11.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

compspec_flux-0.0.11-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page