Aremis CLI

Artemis CLI

artemis-cli is a simple CLI tool to use to manage requests and Artemis configuration.

Installation

  • Artemis CLI lives in cli directory:

    $ cd cli/
  • create a local installation of Artemis CLI:

    $ poetry install

    Poetry will take care of creating a dedicated virtual environment, installing requirements, and makes it accessible via poetry run or poetry shell.

  • call artemis-cli:

    $ poetry run artemis-cli
    Usage: artemis-cli [OPTIONS] COMMAND [ARGS]...
    
    Options:
      --config TEXT  Path to the configuration directory
      --help         Show this message and exit.
    
    Commands:
      guest     Guest related commands
      init      Initialize configuration file.
      knob      Knob related commands
      snapshot  Snapshots related commands
    $
  • to be of any use, you need to provide a configuration to point artemis-cli to the Artemis deployment you wish to manage. The following command will initialize the configuration file, ~/.config/artemis-cli/config.yaml:

    $ poetry run artemis-cli init
  • the installation should be complete, you may verify it by running the following command - it should output list of current guest requests (which may be an empty list):

    $ poetry run artemis-cli guest list

Simple provisioning workflow

  • submit a guest request, to provision a x86_64 machine running Fedora-Rawhide compose:

    $ artemis-cli guest create --keyname ci-key --arch x86_64 --compose Fedora-Rawhide
    {
        "address": null,
        "environment": {
            "hw": {
                "arch": "x86_64"
            },
            "os": {
                "compose": "Fedora-Rawhide"
            }
        },
        "guestname": "4264a144-6e1c-4c20-b37a-6d03e2d79b82",
        "owner": "artemis",
        "ssh": {
            "keyname": "ci-key",
            "port": 22,
            "username": "root"
        },
        "state": "pending",
        "user_data": {},
        "ctime": "2021-06-07 21:06:09.95"
    }
  • guestname field gives you a handle to use when refering to this request in the future. For example, to check current state of the request, run following command:

    $ artemis-cli guest inspect 4264a144-6e1c-4c20-b37a-6d03e2d79b82
    {
        "address": "10.0.141.183",
        "environment": {
            "hw": {
                "arch": "x86_64"
            },
            "os": {
                "compose": "Fedora-Rawhide"
            }
        },
        "guestname": "4264a144-6e1c-4c20-b37a-6d03e2d79b82",
        "owner": "artemis",
        "ssh": {
            "keyname": "ci-key",
            "port": 22,
            "username": "root"
        },
        "state": "ready",
        "user_data": {},
        "ctime": "2021-06-07 21:06:09.95"
    }
  • once state becomes ready, address field should provide you with an IP address you can connect to via SSH.
  • to cancel the request and release all its resources, run following command:

    $ artemis-cli guest cancel 4264a144-6e1c-4c20-b37a-6d03e2d79b82
    guest "4264a144-6e1c-4c20-b37a-6d03e2d79b82" has been canceled
    $