GithubHelp home page GithubHelp logo

mp's Introduction

Multipass Instance Manager - Python 3

This project provides a library for managing Linux instances using Multipass.

Features

  • Generate unique instance names
  • Launch new instances with specified parameters
  • Upload configuration files to instances
  • Install prerequisites on instances
  • Initialize new instances with default or specified parameters

Usage

The main entry point of the application is the init_instance function in init-vm.py. This function initializes a new instance with the specified or default parameters.

Here's an example of how to use it:

python3 init-vm.py

If you want to use the library in your own code, you can import the init_instance function and call it like this:

from init-vm import init_instance

# Initialize a new instance with default parameters
init_instance()

Configuration

You can configure the default parameters for new instances by modifying the following constants in init-vm.py:

DEFAULT_INSTANCE_IMAGE: The image of the instance (default: "22.04") DEFAULT_INSTANCE_VCPUS: The number of CPUs (default: "1") DEFAULT_INSTANCE_MEMORY: The amount of memory (default: "2G")

Logging

The application logs its activity to a file in the logs/instances directory. The log file is named init-vm-.log, where is the date and time when the application was started.

The logs are also sended to Sysadmin's discord channel with the logger function. This function can report multiple levels of logs: INFO, WARNING, ERROR, CRITICAL.

All logs are saved, but only the WARNING, ERROR and CRITICAL logs are sended to the sysadmin's discord channel. You can find in the discord embed message :

  • The log level
  • The log message
  • The log timestamp
  • Instance name

Contributing

If you want to contribute to this project, you can fork the repository and submit a pull request with your changes. Please make sure to follow the coding standards and write tests for your code.

mp's People

Contributors

julesreyn avatar

Watchers

 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.