Text Blame History Raw

SOP to create Duffy tenant

This SOP covers the process of how to create a duffy tenant

Steps

  1. Connect to duffy.ci.centos.org
ssh duffy.ci.centos.org
  1. Change to duffy user
sudo su - duffy
  1. Create tenant with the command below and save api key somewhere safe, it outputs the key as <tenant name>: <API key>
duffy admin create-tenant <tenant name> <ssh pub-key>
  1. Connect to the host that will have duffy client
ssh <host user>@<target host>
  1. Install duffy client using pip
pip3.8 install --user duffy[client]
  1. In the home path of the user, create .config directory if it doesn’t exist and create .config/duffy with the following content
client:
  url: https://duffy.ci.centos.org/api/v1
  auth:
    name: <tenant name>
    key: <API key>
  1. To create a session, the name of the pool is required. Check the pool available executing the command (Optional)
duffy client list-pools
  1. Request a session
duffy client request-session pool=<name of the pool>,quantity=<number of sessions wanted>

By default this command outputs a json, but it's possible to change the format to yaml or flat using --format. Under "node" key it's possible to find the hostname to be used. Log in to it as root user, using ssh.

{
...output ommited...

"nodes": [
    {
        "hostname": "<hostname>.ci.centos.org",
        "ipaddr": "<ip address>",

...output ommited...
}
  1. When needed to retire the session, connect to your duffy client host and execute the command
duffy client retire-session <session id>

It's possible to check the session id either when the session is requested, in the output under "session" key, or using the following command:

duffy client list-sessions