ComponentInstaller

Module for managing the installation of DIRAC components: MySQL, DB’s, NoSQL DBs, Services, Agents, Executors and Consumers

It only makes use of defaults in LocalInstallation Section in dirac.cfg

The Following Options are used:

/DIRAC/Setup:             Setup to be used for any operation
/LocalInstallation/InstanceName:    Name of the Instance for the current Setup (default /DIRAC/Setup)
/LocalInstallation/LogLevel:        LogLevel set in "run" script for all components installed
/LocalInstallation/RootPath:        Used instead of rootPath in "run" script
                                    if defined (if links are used to named versions)
/LocalInstallation/InstancePath:    Location where runit and startup directories are created (default rootPath)
/LocalInstallation/UseVersionsDir:  DIRAC is installed under versions/<Versioned Directory> with a link from pro
                                    (This option overwrites RootPath and InstancePath)
/LocalInstallation/Host:            Used when build the URL to be published for the installed
                                    service (default: socket.getfqdn())
/LocalInstallation/RunitDir:        Location where runit directory is created (default InstancePath/runit)
/LocalInstallation/StartupDir:      Location where startup directory is created (default InstancePath/startup)
/LocalInstallation/MySQLDir:        Location where mysql databases are created (default InstancePath/mysql)
/LocalInstallation/Database/User:                 (default Dirac)
/LocalInstallation/Database/Password:             (must be set for SystemAdministrator Service to work)
/LocalInstallation/Database/RootUser:             (default root)
/LocalInstallation/Database/RootPwd:              (must be set for SystemAdministrator Service to work)
/LocalInstallation/Database/Host:                 (must be set for SystemAdministrator Service to work)
/LocalInstallation/Database/Port:                 (default 3306)
/LocalInstallation/Database/MySQLSmallMem:        Configure a MySQL with small memory requirements
                                                  for testing purposes innodb_buffer_pool_size=200MB
/LocalInstallation/Database/MySQLLargeMem:        Configure a MySQL with high memory requirements
                                                  for production purposes innodb_buffer_pool_size=10000MB
/LocalInstallation/NoSQLDatabase/Host:            (must be set for SystemAdministrator Service to work)
/LocalInstallation/NoSQLDatabase/Port:            (default 9200)
/LocalInstallation/NoSQLDatabase/User:            (default '')
/LocalInstallation/NoSQLDatabase/Password:        (not strictly necessary)
/LocalInstallation/NoSQLDatabase/SSL:             (default True)

The setupSite method (used by the dirac-setup-site command) will use the following info:

/LocalInstallation/Systems:       List of Systems to be defined for this instance
                                  in the CS (default: Configuration, Framework)
/LocalInstallation/Databases:     List of MySQL Databases to be installed and configured
/LocalInstallation/Services:      List of System/ServiceName to be setup
/LocalInstallation/Agents:        List of System/AgentName to be setup
/LocalInstallation/WebPortal:     Boolean to setup the Web Portal (default no)
/LocalInstallation/ConfigurationMaster: Boolean, requires Configuration/Server to be given
                                        in the list of Services (default: no)
/LocalInstallation/PrivateConfiguration: Boolean, requires Configuration/Server to be given
                                         in the list of Services (default: no)

If a Master Configuration Server is being installed the following Options can be used:

/LocalInstallation/ConfigurationName: Name of the Configuration (default: Setup )
/LocalInstallation/AdminUserName:  Name of the Admin user (default: None )
/LocalInstallation/AdminUserDN:    DN of the Admin user certificate (default: None )
/LocalInstallation/AdminUserEmail: Email of the Admin user (default: None )
/LocalInstallation/AdminGroupName: Name of the Admin group (default: dirac_admin )
/LocalInstallation/HostDN: DN of the host certificate (default: None )
/LocalInstallation/VirtualOrganization: Name of the main Virtual Organization (default: None)
class DIRAC.FrameworkSystem.Client.ComponentInstaller.ComponentInstaller

Bases: object

__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

addCfgToComponentCfg(componentType, systemName, component, cfg)

Add some extra configuration to the local component cfg

addDatabaseOptionsToCS(gConfig_o, systemName, dbName, mySetup=None, overwrite=False)

Add the section with the database options to the CS

addDefaultOptionsToCS(gConfig_o, componentType, systemName, component, extensions, mySetup=None, specialOptions={}, overwrite=False, addDefaultOptions=True)

Add the section with the component options to the CS

addDefaultOptionsToComponentCfg(componentType, systemName, component, extensions)

Add default component options local component cfg

addOptionToDiracCfg(option, value)

Add Option to dirac.cfg

addSystemInstance(systemName, compInstance, mySetup=None, myCfg=False)

Add a new system self.instance to dirac.cfg and CS

checkComponentModule(componentType, system, module)

Check existence of the given module and if it inherits from the proper class

checkComponentSoftware(componentType, system, component, extensions)

Check the component software

execCommand(timeout, cmd)

Execute command tuple and handle Error cases

execMySQL(cmd, dbName='mysql', localhost=False)

Execute MySQL Command

fixMySQLScripts(startupScript=None)

Edit MySQL scripts to point to desired locations for db and my.cnf

getAvailableDatabases(extensions)
getAvailableSystems(extensions)

Get the list of all systems (in all given extensions) locally available

getComponentCfg(componentType, system, component, compInstance, extensions, specialOptions={}, addDefaultOptions=True)

Get the CFG object of the component configuration

getComponentModule(system, component, compType)

Get the component software module

getDatabaseCfg(system, dbName, compInstance)

Get the CFG object of the database configuration

getDatabases()

Get the list of installed databases

getExtensions()

Get the list of installed extensions

getInfo()
getInstalledComponents()

Get the list of all the components ( services and agents ) installed on the system in the runit directory

getLogTail(system, component, length=100)

Get the tail of the component log file

getMySQLPasswords()

Get MySQL passwords from local configuration or prompt

getMySQLStatus()

Get the status of the MySQL database installation

getOverallStatus(extensions)

Get the list of all the components ( services and agents ) set up for running with runsvdir in startup directory

getSetupComponents()

Get the list of all the components ( services and agents ) set up for running with runsvdir in startup directory

getSoftwareComponents(extensions)

Get the list of all the components ( services and agents ) for which the software is installed on the system

getStartupComponentStatus(componentTupleList)

Get the list of all the components ( services and agents ) set up for running with runsvdir in startup directory

installComponent(componentType, system, component, extensions, componentModule='', checkModule=True)

Install runit directory for the specified component

installDatabase(dbName)

Install requested DB in MySQL server

installMySQL()

Attempt an installation of MySQL mode:

-Master -Slave -None
installNewPortal()

Install runit directories for the Web Portal

installPortal()

Install runit directories for the Web Portal

loadDiracCfg()

Read again defaults from dirac.cfg

mysqlInstalled(doNotExit=False)

Check if MySQL is already installed

printOverallStatus(rDict)

Print in nice format the return dictionary from self.getOverallStatus

printStartupStatus(rDict)

Print in nice format the return dictionary from self.getStartupComponentStatus (also returned by self.runsvctrlComponent)

removeComponentOptionsFromCS(system, component, mySetup=None)

Remove the section with Component options from the CS, if possible

removeDatabaseOptionsFromCS(gConfig_o, system, dbName, mySetup=None)

Remove the section with database options from the CS, if possible

runsvctrlComponent(system, component, mode)

Execute runsvctrl and check status of the specified component

setMySQLPasswords(root='', dirac='')

Set MySQL passwords

setupComponent(componentType, system, component, extensions, componentModule='', checkModule=True)

Install and create link in startup

setupNewPortal()

Install and create link in startup

setupPortal()

Install and create link in startup

setupSite(scriptCfg, cfg=None)

Setup a new site using the options defined

startMySQL()

Start MySQL server

stopMySQL()

Stop MySQL server

uninstallComponent(system, component, removeLogs)

Remove startup and runit directories

uninstallDatabase(gConfig_o, dbName)

Remove a database from DIRAC

unsetupComponent(system, component)

Remove link from startup