diff --git a/docs/operations/ci/adding_cico_tenant/adding-duffy-tenant.md b/docs/operations/ci/adding_cico_tenant/adding-duffy-tenant.md new file mode 100644 index 0000000..8841779 --- /dev/null +++ b/docs/operations/ci/adding_cico_tenant/adding-duffy-tenant.md @@ -0,0 +1,72 @@ +# 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 +```shell +ssh duffy.ci.centos.org +``` + +2. Change to duffy user +```shell +sudo su - duffy +``` + +3. Create tenant with the command below and save api key somewhere safe, it outputs the key as `: ` +```shell +duffy admin create-tenant +``` + +4. Connect to the host that will have duffy client +```shell +ssh @ +``` + +5. Install duffy client using `pip` +```shell +pip3.8 install --user duffy[client] +``` + +6. 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: + key: +``` + +7. To create a session, the name of the pool is required. Check the pool available executing the command **_(Optional)_** +```shell +duffy client list-pools +``` + +8. Request a session +```shell +duffy client request-session pool=,quantity= +``` + +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`. + +```json +{ +...output ommited... + +"nodes": [ + { + "hostname": ".ci.centos.org", + "ipaddr": "", + +...output ommited... +} +``` + +9. When needed to retire the session, connect to your duffy client host and execute the command +```shell +duffy client retire-session +``` + +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: +```shell +duffy client list-sessions +```