Skip to content

praiskup/resalloc

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
bin
 
 
 
 
 
 
etc
 
 
man
 
 
 
 
rpm
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Resource Allocator
------------------

This project aims to help with taking care of (rather expensive)
resources, for example several ephemeral virtual machines for the purposes
of your CI.

Overview
--------

Server side allows you to:
  - automatically allocate resources
  - periodically check that the resources are working properly
  - and once the resource is not needed anymore, dispose it

The client side let's your users:
  - request particular resource type
  - wait till the resource is available
  - release the resource

Such allocation of resource might be time consuming, so to not let your
users wait too much -- the server side is able to pre-allocate several
instances in advance.  For more info, have a look at ./config/pools.yaml
configuration example.

Typical client use-cases
------------------------

1. get the resource, and wait till it is ready

    $ ticket=$(resalloc ticket --tag x86_64 --tag jenkins_vm)
    $ output=$(resalloc ticket-wait $ticket)

2. get the resource, and periodically check till it is available

    $ ticket=$(resalloc ticket --tag x86_64 --tag jenkins_vm)
    $ while ! resalloc ticket-check $ticket; do true; done
    $ output=$(resalloc ticket-check $ticket)

Then, you can work with the resource:

    $ ip=$output
    $ ssh root@"$ip" -c "do something"
    $ resalloc ticket-close "$ticket"

The $output variable will contain important info from the 'cmd_new'
command run by resalloc server.  If you request VMs, you typically want
'cmd_new' command which outputs an IP of the allocated virtual machine.

Installation
------------

The released versions are installable from Fedora and Fedora EPEL repositories,
just do

    $ sudo dnf install -y resalloc        # clients
    $ sudo dnf install -y resalloc-server # server

Pre-release RPMs are available in testing Copr repositories:
https://copr.fedorainfracloud.org/coprs/praiskup/resalloc/