This SOP covers the process of how to create a duffy tenant
Note
we'll start using the pkistore
git-crypted git repo for this, so be sure to have that under git control
We'll just create the new ssh keypair directly into the CI pkistore repository :
project="samba" ssh-keygen -f ocp/ssh/${project} -C ${project}@CI
Important
Don't forget to add and git commit && git push new keys in pkistore/ocp/ssh repo
This will create both private and public ssh keys, and you can now copy the public key to be inserted into Duffy DB (see below)
ssh duffy.ci.centos.org
sudo su - duffy
<tenant name>: <API key>
duffy admin create-tenant <tenant name> "ssh-rsa <ssh pub-key_created_above>"
CI tenants are allowed to upload artifacts to one storage box, so we need to allow them to upload/rsync to it.
It's all controlled by the artifacts_projects_list
list in ansible (host_vars) so don't forget to also add project and ssh public keys there too
ssh <host user>@<target host>
pip
pip3.8 install --user duffy[client]
.config
directory if it doesn’t exist and create .config/duffy
with the following contentclient: url: https://duffy.ci.centos.org/api/v1 auth: name: <tenant name> key: <API key>
duffy client list-pools
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... }
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