cci-tools
CERN Cloud Infrastructure Tools (aka cci-tools
) provides a set of Python
scripts and libraries following good software & coding practices, ensuring as
much as possible the reusability of the code.
Prerequisites
Please install these packages to start development on this library
RedHat/CentOs
$ sudo yum install gcc python-devel python3-devel python-tox openldap-devel krb5-libs
Debian/Ubuntu
$ sudo apt-get install gcc libsasl2-dev python-dev python3-dev python-tox libldap2-dev libssl-dev libkrb5-dev krb5-config
Release Management
Changelog
In general, all the merge requests done in the repository should cover a new feature, bug fix, etc... triggering a new version of the package.
This implies that every new feature should:
- Add a new entry in
cci-tools.spec
. - Bump the version in
cci-tools.spec
.
Tests
Tests can be run with:
$ cd path/to/cci-tools
$ tox
Add a new command into cci-tools
In order to create a new command ccitools, please follow the steps:
-
Create a new class under ccitools/cmd. You can inherit from the BaseCMD class that has some basic argument parser for logging.
-
Once created, the file containing the class should have a main method like
def main(args=None):
MyNewCMD().main(args)
if __name__ == "__main__":
try:
main()
except Exception as e:
logger.exception(e)
sys.exit(1)
- Add the entry of your new command in setup.cfg so it gets installed by pip in the environment
[entry_points]
console_scripts =
cci-my-new-cmd = ccitools.cmd.my_new_cmd:main
- To run the command log in one of the development, you can use the venv environment that will install the requirements of your command.
$ tox -evenv /bin/bash
cci-my-new-cmd
Rundeck mapping to ccitools scripts
The following list shows the current mapping of Rundeck jobs to ccitools scripts:
Cloud-Operations project
-
Hyper-V
- Multiple recreate VM: TODO
-
Hyper-V/subtasks
- Check enough quota: TODO
- Delete VM & recreate: TODO
- Wait4snapshot & create volume: TODO
-
Project Management/Creation
-
1. Escalate Project Creation request:
cci-escalate-project
-
2. Project Creation (from snow):
cci-create-project
-
3. Enable project:
cci-enable-project
-
Project Creation (from input values):
cci-create-project
-
1. Escalate Project Creation request:
-
Project Management/Deletion
-
Project Deletion (from input values):
cci-delete-project
-
Project Deletion (from snow):
cci-delete-project
-
Project Deletion (from input values):
-
Project Management/Quota Update
-
1. Escalate Quota request:
cci-update-quota
-
2. Apply Quota request:
cci-update-quota
-
1. Escalate Quota request:
-
Snow-man duties/Checks
-
Check un-assigned GNI tickets:
cci-verify-gni-tickets
-
Cleanup of old Rally jobs:
cci-rally-cleanup
-
Role assignment cleanup:
cci-assignment-cleanup
-
Check cloud_ VMs owners:
cci-check-cloud-vm-owners
-
Check disable compute nodes:
cci-check-disabled-nodes
-
Check un-assigned GNI tickets:
-
Snow-man duties/Reports
-
Health report for Puppet machines:
cci-health-report-puppet
-
Health report for virtual machines:
cci-health-report
-
Health report for volumes:
cci-health-report
-
XSLS availability and metrics:
cci-xsls-metrics
-
Health report for Puppet machines:
-
identities
-
Reset Fernet Keys:
cci-reset-fernet-keys
-
Rotate Fernet Keys:
cci-rotate-fernet-keys
-
Reset Fernet Keys:
Common project
-
Rundeck scheduler:
cci-rundeck-scheduler
-
compute
-
Generic remove compute node:
cci-delete-hosted-vms
-
Lock-Unlock VMs of hypervisors:
cci-lock-unlock-hv-servers
-
Power on-off VMs of hypervisors:
cci-power-on-off-hv-servers
-
Generic remove compute node:
-
interventions
-
Send calendar invitation:
cci-send-calendar-invitation
-
Send calendar invitation:
-
notifications
-
Megabus producer:
cci-megabus-producer
-
Megabus producer:
-
servicenow
-
Print project creation request:
cci-dump-record-producer
-
Print project deletion request:
cci-dump-record-producer
-
Print quota update request:
cci-dump-record-producer
-
Update ticket:
cci-update-ticket
-
Print project creation request:
HW-Resources
- Project Management
-
Apply Quota Request:
cci-update-quota
-
Enable project:
cci-enable-project
-
Project Creation (from snow):
cci-create-project
-
Apply Quota Request:
Internal
- Auto delete logs: TODO
- Check interventions: TODO
-
Check scheduled jobs user:
cci-check-scheduled-jobs
-
Export projects:
cci-export-rundeck-projects
-
Export Rundeck Jobs & Projecst:
cci-export-rundeck-definitions
- megabus client: TODO
-
Reload nodes:
cci-reload-nodes-puppetdb
-
Takeover scheduled jobs:
cci-takeover-scheduled-jobs