Coder Social home page Coder Social logo

oscar-franzen / slurm-ops-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omnivector-solutions/slurm-ops-manager

0.0 1.0 0.0 228 KB

Facilitate slurm install and configuration operations

License: MIT License

Makefile 0.10% Python 99.90%

slurm-ops-manager's Introduction

slurm-ops-manager

This library is used to facilitate the installation and configuration of slurm in an operator charm.

Usage

To get slurm installed in your charm, you need to define a resource "slurm" in your metadata.yaml of your charm. This interface allows two different resource types, a slurm snap, and a slurm binary tar file. The SlurmOpsManager class retrieves the model resource checks to see if it is binary or a snap and proceeds to install slurm.

Example:

class SlurmCharm(CharmBase):
    def __init__(self, *args):
        super().__init__(*args)
	snap_mode = "all"
        self.slurm_ops = SlurmOpsManager(self, snap_mode)

    def _on_install(self, event):
	self.slurm_ops.install()

Writing config and restarting the daemons

self.slurm_ops.render_config_and_restart(slum_config)

This function accomplishes 4 main tasks

  • writes the slurm.conf

  • restarts the slurm daemon

  • writes the munge key

  • restarts the munge daemon

to use this function correctly the user needs to supply a dictionary full of the correct key value pairs to be loaded into the template found in the templates folder of this repository. Either slurmbd.conf.tmpl if you're configuring the slurmdbd component or slurm.conf.tmppl for all other components of slurm. In that same dictionary the munge key value should be provided as a dict item with the key being "munge_key" and the value being a string representation of the munge key.

values to be supplied to slurm.conf.tmpl

more info on these values can be found here https://slurm.schedmd.com/slurm.conf.html

  • clustername
  • active_controller_hostname
  • active_controller_ingress_address
  • backup_controller_hostname
  • backup_controller_ingress_address
  • munge_socket
  • mail_prog
  • slurm_user
  • slurmctld_pid_file
  • slurmd_pid_file
  • slurmctld_log_file
  • slurmd_log_file
  • slurm_spool_dir
  • slurm_state_dir
  • slurm_plugin_dir
  • slurm_plugstack_conf
  • slurmdbd_hostname
  • slurmdbd_port
  • munge_socket
  • nodes
  • partitions

The inventory of the nodes should also be supplied in this format:

{"nodes": {"inventory": "n_0"}, {"inventory": "n_1"},...{"inventory":"n_n-1} }

{% for partition, values in partitions.items() %} PartitionName={{ partition }} Nodes={{ values.hosts|join(',') }} Default={{ 'YES' if values.default else 'NO' }} State=UP {% endfor %}

License

Contact

slurm-ops-manager's People

Contributors

ducks23 avatar jamesbeedy avatar oscar-franzen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.