Commit dda76855 authored by Maiken's avatar Maiken

Merge branch 'arcctl-for-other-arc-services' into 'master'

Using arcctl for controlling other ARC services

See merge request !954
parents f75486ec 8cd2f235
Pipeline #7527 passed with stages
in 143 minutes and 18 seconds
......@@ -128,6 +128,7 @@ Depends:
${shlibs:Depends},
${misc:Depends},
libarccommon3 (= ${binary:Version}),
nordugrid-arc-arcctl-service (= ${source:Version}),
nordugrid-arc-plugins-gridftp (= ${binary:Version}),
lsb-base (>= 3.0-6)
Description: ARC GridFTP server
......@@ -146,6 +147,7 @@ Depends:
${misc:Depends},
libarccommon3 (= ${binary:Version}),
nordugrid-arc-hed (= ${binary:Version}),
nordugrid-arc-arcctl-service (= ${source:Version}),
nordugrid-arc-plugins-needed (= ${binary:Version}),
lsb-base (>= 3.0-6)
Description: ARC data delivery service
......@@ -228,6 +230,24 @@ Description: ARC Resource-coupled EXecution service
This package contains the ARC Control Tool with basic set of control
modules suitable for both server and client side.
Package: nordugrid-arc-arcctl-service
Architecture: any
Depends:
${python:Depends},
${python3:Depends},
libarccommon3 (>= ${source:Version}),
nordugrid-arc-arcctl (= ${source:Version}),
${pydeps:Depends},
lsb-base (>= 3.0-6)
XB-Python-Version: ${python:Versions}
Description: ARC Resource-coupled EXecution service
NorduGrid is a collaboration aiming at development, maintenance and
support of the middleware, known as the Advanced Resource
Connector (ARC).
.
This package contains the service control modules for ARC Contol Tool
that allow to work with server-side config and manage ARC services.
Package: nordugrid-arc-arex
Provides:
nordugrid-arc-cache-service,
......@@ -255,6 +275,7 @@ Depends:
libarccommon3 (= ${binary:Version}),
nordugrid-arc-hed (= ${binary:Version}),
nordugrid-arc-arcctl (= ${source:Version}),
nordugrid-arc-arcctl-service (= ${source:Version}),
nordugrid-arc-plugins-needed (= ${binary:Version}),
libjson-xs-perl,
libxml-simple-perl,
......@@ -485,6 +506,7 @@ Depends:
${python3:Depends},
libarccommon3 (>= ${source:Version}),
nordugrid-arc-acix-core (= ${source:Version}),
nordugrid-arc-arcctl-service (= ${source:Version}),
lsb-base (>= 3.0-6)
XB-Python-Version: ${python:Versions}
Description: ARC cache index - scanner server
......@@ -504,6 +526,7 @@ Depends:
${python3:Depends},
libarccommon3 (>= ${source:Version}),
nordugrid-arc-acix-core (= ${source:Version}),
nordugrid-arc-arcctl-service (= ${source:Version}),
lsb-base (>= 3.0-6)
XB-Python-Version: ${python:Versions}
Description: ARC cache index - index server
......
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Config.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/ServiceCommon.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Services.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/OSService.py*
......@@ -2,7 +2,6 @@ debian/tmp/usr/lib/python?.?/site-packages/arc/control/__init__.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/CertificateGenerator.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/ControlCommon.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/OSPackage.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/OSService.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/TestCA.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/ThirdPartyDeployment.py*
......
......@@ -79,13 +79,10 @@ debian/tmp/usr/lib/python?.?/site-packages/arc/control/AccountingLegacy.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/AccountingPublishing.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Accounting.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Cache.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Config.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/CECommon.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Jobs.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/JuraArchive.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/JuraArchiveSQLite.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/RunTimeEnvironment.py*
debian/tmp/usr/lib/python?.?/site-packages/arc/control/Services.py*
debian/tmp/usr/lib/arc/arccandypond
debian/tmp/usr/share/arc/rte/ENV/LRMS-SCRATCH
......
......@@ -357,6 +357,7 @@ Summary: ARC gridftp server
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}-plugins-gridftp = %{version}-%{release}
Requires: %{name}-arcctl-service = %{version}-%{release}
Requires(post): %{service_post_requires}
Requires(preun): %{service_preun_requires}
......@@ -377,6 +378,7 @@ Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-hed = %{version}-%{release}
Requires: %{name}-plugins-needed = %{version}-%{release}
Requires: %{name}-arcctl-service = %{version}-%{release}
Requires(post): %{service_post_requires}
Requires(preun): %{service_preun_requires}
......@@ -399,6 +401,7 @@ BuildArch: noarch
Requires: openldap-servers
Requires: glue-schema >= 2.0.10
Requires: bdii
Requires: %{name}-arcctl-service = %{version}-%{release}
Provides: %{name}-ldap-infosys = %{version}-%{release}
Obsoletes: %{name}-ldap-infosys < 6.0.0
Provides: %{name}-aris = %{version}-%{release}
......@@ -469,12 +472,28 @@ Connector (ARC).
This package contains the ARC Control Tool with basic set of control
modules suitable for both server and client side.
%package arcctl-service
Summary: ARC Control Tool - service control modules
Group: Applications/Internet
Requires: %{name} = %{version}-%{release}
Requires: %{name}-arcctl = %{version}-%{release}
BuildArch: noarch
%description arcctl-service
NorduGrid is a collaboration aiming at development, maintenance and
support of the middleware, known as the Advanced Resource
Connector (ARC).
This package contains the service control modules for ARC Contol Tool
that allow to work with server-side config and manage ARC services.
%package arex
Summary: ARC Resource-coupled EXecution service
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-hed = %{version}-%{release}
Requires: %{name}-arcctl = %{version}-%{release}
Requires: %{name}-arcctl-service = %{version}-%{release}
Requires: %{name}-plugins-needed = %{version}-%{release}
Requires: perl(JSON::XS)
Requires: perl(XML::Simple)
......@@ -774,6 +793,7 @@ BuildArch: noarch
%endif
Requires: %{name} = %{version}-%{release}
Requires: %{name}-acix-core = %{version}-%{release}
Requires: %{name}-arcctl-service = %{version}-%{release}
Obsoletes: %{name}-acix-cache < 6.0.0
Requires(post): %{service_post_requires}
......@@ -796,6 +816,7 @@ Group: System Environment/Libraries
BuildArch: noarch
%endif
Requires: %{name} = %{version}-%{release}
Requires: %{name}-arcctl-service = %{version}-%{release}
Requires: %{name}-acix-core = %{version}-%{release}
Requires(post): %{service_post_requires}
......@@ -1350,7 +1371,6 @@ service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
%{python3_sitearch}/%{pkgdir}/control/CertificateGenerator.py
%{python3_sitearch}/%{pkgdir}/control/ControlCommon.py
%{python3_sitearch}/%{pkgdir}/control/OSPackage.py
%{python3_sitearch}/%{pkgdir}/control/OSService.py
%{python3_sitearch}/%{pkgdir}/control/TestCA.py
%{python3_sitearch}/%{pkgdir}/control/ThirdPartyDeployment.py
%dir %{python3_sitearch}/%{pkgdir}/control/__pycache__
......@@ -1358,7 +1378,6 @@ service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
%{python3_sitearch}/%{pkgdir}/control/__pycache__/CertificateGenerator.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/ControlCommon.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/OSPackage.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/OSService.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/TestCA.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/ThirdPartyDeployment.*
%else
......@@ -1367,12 +1386,31 @@ service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
%{python2_sitearch}/%{pkgdir}/control/CertificateGenerator.py*
%{python2_sitearch}/%{pkgdir}/control/ControlCommon.py*
%{python2_sitearch}/%{pkgdir}/control/OSPackage.py*
%{python2_sitearch}/%{pkgdir}/control/OSService.py*
%{python2_sitearch}/%{pkgdir}/control/TestCA.py*
%{python2_sitearch}/%{pkgdir}/control/ThirdPartyDeployment.py*
%endif
%doc %{_mandir}/man1/arcctl.1*
%files arcctl-service
%if %{py3default}
%dir %{python3_sitearch}/%{pkgdir}/control
%{python3_sitearch}/%{pkgdir}/control/Config.py
%{python3_sitearch}/%{pkgdir}/control/ServiceCommon.py
%{python3_sitearch}/%{pkgdir}/control/Services.py
%{python3_sitearch}/%{pkgdir}/control/OSService.py
%dir %{python3_sitearch}/%{pkgdir}/control/__pycache__
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Config.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/ServiceCommon.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Services.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/OSService.*
%else
%dir %{python2_sitearch}/%{pkgdir}/control
%{python2_sitearch}/%{pkgdir}/control/Config.py*
%{python2_sitearch}/%{pkgdir}/control/ServiceCommon.py*
%{python2_sitearch}/%{pkgdir}/control/Services.py*
%{python2_sitearch}/%{pkgdir}/control/OSService.py*
%endif
%files arex
%defattr(-,root,root,-)
%if %{use_systemd}
......@@ -1464,26 +1502,20 @@ service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
%{python3_sitearch}/%{pkgdir}/control/AccountingPublishing.py
%{python3_sitearch}/%{pkgdir}/control/Accounting.py
%{python3_sitearch}/%{pkgdir}/control/Cache.py
%{python3_sitearch}/%{pkgdir}/control/Config.py
%{python3_sitearch}/%{pkgdir}/control/CECommon.py
%{python3_sitearch}/%{pkgdir}/control/Jobs.py
%{python3_sitearch}/%{pkgdir}/control/JuraArchive.py
%{python3_sitearch}/%{pkgdir}/control/JuraArchiveSQLite.py
%{python3_sitearch}/%{pkgdir}/control/RunTimeEnvironment.py
%{python3_sitearch}/%{pkgdir}/control/Services.py
%dir %{python3_sitearch}/%{pkgdir}/control/__pycache__
%{python3_sitearch}/%{pkgdir}/control/__pycache__/AccountingDB.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/AccountingLegacy.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/AccountingPublishing.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Accounting.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Cache.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Config.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/CECommon.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Jobs.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/JuraArchive.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/JuraArchiveSQLite.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/RunTimeEnvironment.*
%{python3_sitearch}/%{pkgdir}/control/__pycache__/Services.*
%else
%{python2_sitearch}/%{pkgdir}/ssm
%dir %{python2_sitearch}/%{pkgdir}/control
......@@ -1492,13 +1524,10 @@ service arc-infosys-ldap condrestart > /dev/null 2>&1 || :
%{python2_sitearch}/%{pkgdir}/control/AccountingPublishing.py*
%{python2_sitearch}/%{pkgdir}/control/Accounting.py*
%{python2_sitearch}/%{pkgdir}/control/Cache.py*
%{python2_sitearch}/%{pkgdir}/control/Config.py*
%{python2_sitearch}/%{pkgdir}/control/CECommon.py*
%{python2_sitearch}/%{pkgdir}/control/Jobs.py*
%{python2_sitearch}/%{pkgdir}/control/JuraArchive.py*
%{python2_sitearch}/%{pkgdir}/control/JuraArchiveSQLite.py*
%{python2_sitearch}/%{pkgdir}/control/RunTimeEnvironment.py*
%{python2_sitearch}/%{pkgdir}/control/Services.py*
%endif
%{_libexecdir}/%{pkgdir}/arccandypond
%dir %{_datadir}/%{pkgdir}/rte
......
......@@ -2,6 +2,7 @@ from __future__ import absolute_import
from .ControlCommon import *
from arc.utils import reference
import os
import sys
import subprocess
......@@ -107,7 +108,12 @@ class ConfigControl(ComponentControl):
sys.stdout.write(line)
def verify(self, args):
validator_cmd = [ARC_LIBEXEC_DIR + '/arc-config-check']
validator_script = ARC_LIBEXEC_DIR + '/arc-config-check'
if not os.path.exists(validator_script):
self.logger.error('The configuration check script is missing at %s. '
'Note that config validation is currently targeting A-REX only.', validator_script)
return 1
validator_cmd = [validator_script]
if args.config:
validator_cmd += ['--config', args.config]
if args.verbosity:
......
......@@ -9,11 +9,11 @@ from arc.utils import config
logger = logging.getLogger('ARCCTL.Common')
try:
from .CECommon import *
from .ServiceCommon import *
except ImportError:
arcctl_runtime_config = None
def arcctl_ce_mode():
def arcctl_server_mode():
return False
def remove_runtime_config():
......@@ -94,7 +94,7 @@ def get_parsed_arcconf(conf_f):
'Using /etc/arc.conf that exists.', def_conf_f)
runconf_load = True
else:
if arcctl_ce_mode():
if arcctl_server_mode():
logger.error('Cannot find ARC configuration file in the default location.')
return None
......@@ -126,7 +126,7 @@ def get_parsed_arcconf(conf_f):
arcconfig = config
arcconfig.conf_f = conf_f
except IOError:
if arcctl_ce_mode():
if arcctl_server_mode():
logger.error('Failed to open ARC configuration file %s', conf_f)
else:
logger.debug('arcctl is working in config-less mode relying on defaults only')
......
ACCOUNTINGCTLPY = Accounting.py AccountingDB.py AccountingPublishing.py AccountingLegacy.py JuraArchive.py JuraArchiveSQLite.py
SERVICESCTLPY = OSPackage.py OSService.py Services.py
SERVICESCTLPY = OSPackage.py OSService.py Services.py ServiceCommon.py
CACTLPY = TestCA.py CertificateGenerator.py
pkgpythondir = $(PYTHON_SITE_ARCH)/arc/control
pkgpython_PYTHON = __init__.py ControlCommon.py CECommon.py Config.py Jobs.py RunTimeEnvironment.py CommunityRTE.py Cache.py ThirdPartyDeployment.py $(ACCOUNTINGCTLPY) $(SERVICESCTLPY) $(CACTLPY)
pkgpython_PYTHON = __init__.py ControlCommon.py Config.py Jobs.py RunTimeEnvironment.py CommunityRTE.py Cache.py ThirdPartyDeployment.py $(ACCOUNTINGCTLPY) $(SERVICESCTLPY) $(CACTLPY)
import logging
from arc.paths import *
logger = logging.getLogger('ARCCTL.CECommon')
logger = logging.getLogger('ARCCTL.ServiceCommon')
# Runtime configuration (used for root only)
......@@ -10,13 +10,13 @@ if os.geteuid() != 0:
arcctl_runtime_config = None
def arcctl_ce_mode():
"""Just return True indicating that we are working in ARC CE mode with arc.conf in place"""
def arcctl_server_mode():
"""Just return True indicating that we are working in server mode with arc.conf in place"""
return True
def remove_runtime_config():
"""Remove ARC CE runtime configuration if defined"""
"""Remove ARC runtime configuration if defined"""
if arcctl_runtime_config is not None:
if os.path.exists(arcctl_runtime_config):
os.unlink(arcctl_runtime_config)
......@@ -50,7 +50,7 @@ class TestCAControl(ComponentControl):
# Use values from arc.conf if possible
self.arcconfig = arcconfig
if arcconfig is None:
if arcctl_ce_mode():
if arcctl_server_mode():
self.logger.info('Failed to parse arc.conf, using default CA certificates directory')
else:
self.logger.debug('Working in config-less mode. Default paths will be used.')
......@@ -253,7 +253,7 @@ class TestCAControl(ComponentControl):
usercertfiles.keyLocation,
os.getcwd()))
# add subject to allowed list
if arcctl_ce_mode():
if arcctl_server_mode():
if not args.no_auth:
try:
self.logger.info('Adding certificate subject name (%s) to allowed list at %s',
......@@ -323,5 +323,5 @@ class TestCAControl(ComponentControl):
testca_user.add_argument('-t', '--export-tar', action='store_true',
help='Export tar archive to use from another host')
testca_user.add_argument('-f', '--force', action='store_true', help='Overwrite files if exist')
if arcctl_ce_mode():
if arcctl_server_mode():
testca_user.add_argument('--no-auth', action='store_true', help='Do not add user subject to allowed list')
......@@ -28,7 +28,7 @@ class ThirdPartyControl(ComponentControl):
self.x509_cert_dir = '/etc/grid-security/certificates'
self.arcconfig = arcconfig
if arcconfig is None:
if arcctl_ce_mode():
if arcctl_server_mode():
self.logger.debug('Working in config-less mode. Default paths will be used.')
else:
self.logger.info('Failed to parse arc.conf, using default CA certificates path')
......@@ -530,7 +530,7 @@ deb http://dist.eugridpma.info/distribution/igtf/current igtf accredited
deploy_voms_lsc.add_argument('--pythonssl', action='store_true',
help='Use Python SSL module to establish TLS connection '
'(default is to call external OpenSSL binary)')
if arcctl_ce_mode():
if arcctl_server_mode():
iptables = deploy_actions.add_parser('iptables-config',
help='Generate iptables config to allow ARC CE configured services')
iptables.add_argument('--any-state', action='store_true',
......
......@@ -15,7 +15,7 @@ CTL_COMPONENTS = [
]
#
# arcctl controllers for A-REX
# arcctl controllers for ARC services
#
# arcctl config
......@@ -34,6 +34,10 @@ except ImportError:
else:
CTL_COMPONENTS.append(ServicesControl)
#
# arcctl controllers for A-REX
#
# arcctl rte
try:
from .RunTimeEnvironment import RTEControl
......
......@@ -45,7 +45,7 @@ class ArgumentParserHelpOnError(argparse.ArgumentParser):
def get_parser():
parser = ArgumentParserHelpOnError(description='NorduGrid ARC Control Tool')
config_help = 'config file location (default is {0})'.format(config.arcconf_defpath())
if not ControlCommon.arcctl_ce_mode():
if not ControlCommon.arcctl_server_mode():
config_help = argparse.SUPPRESS
parser.add_argument('-c', '--config', action='store', help=config_help)
parser.add_argument('-d', '--debug', action='store',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment