Skip to main content

Subsystem graph generation for environment modules

Project description

Compspec Modules

PyPI version

A compspec (Composition spec) is a specification and model for comparing things. Compspec modules is a plugin for extraction of environment modules subsystem metadata about software installed on a system. This can be for the entire system or a user-specific install. The plugin exports json graph format (JGF) that can be used for scheduling and other purposes. To learn more:

  • Compspec: the Python library that discovers and loads this plugin.

Note that I'm currently parsing environment modules, and very simply. We can extend to more complex / LMOD if needed.

Usage

Install compspec and the plugin here:

pip install compspec
pip install compspec-modules

Here is an easy way (in the devcontainer) to get a bunch of testing modules.

git clone https://github.com/shawfdong/modulefiles /tmp/modulefiles
export MODULEPATH=$MODULEPATH:/tmp/modulefiles

Then run an extraction with spack. You will want to provide the root to the spack install to describe:

compspec extract modules

To save to file:

compspec extract --outfile module-subsystem.json modules
compspec-modules output
{
    "graph": {
        "nodes": {
            "environment-modules0": {
                "metadata": {
                    "type": "environment-modules",
                    "basename": "environment-modules",
                    "name": "environment-modules0",
                    "id": 0,
                    "uniq_id": 0,
                    "containment": {
                        "paths": "/environment-modules0"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false
                },
                "label": "environment-modules0"
            },
            "module1": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module0",
                    "id": 1,
                    "uniq_id": 1,
                    "containment": {
                        "paths": "/environment-modules0/module0"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "dot",
                        "software": "dot"
                    }
                },
                "label": "module1"
            },
            "module2": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module1",
                    "id": 2,
                    "uniq_id": 2,
                    "containment": {
                        "paths": "/environment-modules0/module1"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "module-info",
                        "software": "module-info"
                    }
                },
                "label": "module2"
            },
            "module3": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module2",
                    "id": 3,
                    "uniq_id": 3,
                    "containment": {
                        "paths": "/environment-modules0/module2"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "modules",
                        "software": "modules",
                        "version": "5.4.0"
                    }
                },
                "label": "module3"
            },
            "module4": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module3",
                    "id": 4,
                    "uniq_id": 4,
                    "containment": {
                        "paths": "/environment-modules0/module3"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "module-git",
                        "software": "module-git"
                    }
                },
                "label": "module4"
            },
            "module5": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module4",
                    "id": 5,
                    "uniq_id": 5,
                    "containment": {
                        "paths": "/environment-modules0/module4"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "use.own",
                        "software": "use.own"
                    }
                },
                "label": "module5"
            },
            "module6": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module5",
                    "id": 6,
                    "uniq_id": 6,
                    "containment": {
                        "paths": "/environment-modules0/module5"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "null",
                        "software": "null"
                    }
                },
                "label": "module6"
            },
            "module7": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module6",
                    "id": 7,
                    "uniq_id": 7,
                    "containment": {
                        "paths": "/environment-modules0/module6"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "python/intelpython2",
                        "software": "python"
                    }
                },
                "label": "module7"
            },
            "module8": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module7",
                    "id": 8,
                    "uniq_id": 8,
                    "containment": {
                        "paths": "/environment-modules0/module7"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "python/anaconda3",
                        "software": "python"
                    }
                },
                "label": "module8"
            },
            "module9": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module8",
                    "id": 9,
                    "uniq_id": 9,
                    "containment": {
                        "paths": "/environment-modules0/module8"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "python/anaconda2",
                        "software": "python"
                    }
                },
                "label": "module9"
            },
            "module10": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module9",
                    "id": 10,
                    "uniq_id": 10,
                    "containment": {
                        "paths": "/environment-modules0/module9"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "python/intelpython3",
                        "software": "python"
                    }
                },
                "label": "module10"
            },
            "module11": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module10",
                    "id": 11,
                    "uniq_id": 11,
                    "containment": {
                        "paths": "/environment-modules0/module10"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "python/rh-python36",
                        "software": "python"
                    }
                },
                "label": "module11"
            },
            "module12": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module11",
                    "id": 12,
                    "uniq_id": 12,
                    "containment": {
                        "paths": "/environment-modules0/module11"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "PrgEnv-intel/2019.1.053",
                        "software": "PrgEnv-intel",
                        "version": "2019.1.053"
                    }
                },
                "label": "module12"
            },
            "module13": {
                "metadata": {
                    "type": "module",
                    "basename": "module",
                    "name": "module12",
                    "id": 13,
                    "uniq_id": 13,
                    "containment": {
                        "paths": "/environment-modules0/module12"
                    },
                    "size": 1,
                    "unit": "",
                    "rank": 0,
                    "exclusive": false,
                    "attributes": {
                        "name": "PrgEnv-pgi/llvm_18.10",
                        "software": "PrgEnv-pgi",
                        "version": "18.10"
                    }
                },
                "label": "module13"
            },

...
    },
    "metadata": {
        "install_name": "compat-experiment"
    }
}

Development

If you open the Development container in VSCode, you'll find environment modules are installed:

$ module avail

This allows us to easily develop and test the compatibility plugin.

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-modules-0.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

compspec_modules-0.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file compspec-modules-0.0.1.tar.gz.

File metadata

  • Download URL: compspec-modules-0.0.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for compspec-modules-0.0.1.tar.gz
Algorithm Hash digest
SHA256 16e1bb28b8d28ee1b4377ac5acae257d65ec61740e26ed72b77c1471596e29dd
MD5 ff8919fe2e73e494594cd879c1c96042
BLAKE2b-256 461f0c99e2c64980c5e34115d5f7c51b4d0ca68ba13ce0e4b51ad42f8003ee4b

See more details on using hashes here.

File details

Details for the file compspec_modules-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for compspec_modules-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86ee0cd9b128f4c74fa33f3adc75c606d12856c912cd5a9bf84da120debe7ae9
MD5 fca2993f4c9c4120f99da437365c4420
BLAKE2b-256 f40041a855f21ce1ec7d1cb2ce6e5e1a58ddf62e971323b3535c171b053eb09c

See more details on using hashes here.

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