rucio 35.7.0__py3-none-any.whl → 37.0.0rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rucio might be problematic. Click here for more details.
- rucio/alembicrevision.py +1 -1
- rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
- rucio/cli/account.py +216 -0
- rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
- rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
- rucio/cli/command.py +272 -0
- rucio/cli/config.py +72 -0
- rucio/cli/did.py +191 -0
- rucio/cli/download.py +128 -0
- rucio/cli/lifetime_exception.py +33 -0
- rucio/cli/replica.py +162 -0
- rucio/cli/rse.py +293 -0
- rucio/cli/rule.py +158 -0
- rucio/cli/scope.py +40 -0
- rucio/cli/subscription.py +73 -0
- rucio/cli/upload.py +60 -0
- rucio/cli/utils.py +226 -0
- rucio/client/accountclient.py +0 -1
- rucio/client/baseclient.py +33 -24
- rucio/client/client.py +45 -1
- rucio/client/didclient.py +5 -3
- rucio/client/downloadclient.py +6 -8
- rucio/client/replicaclient.py +0 -2
- rucio/client/richclient.py +317 -0
- rucio/client/rseclient.py +4 -4
- rucio/client/uploadclient.py +26 -12
- rucio/common/bittorrent.py +234 -0
- rucio/common/cache.py +66 -29
- rucio/common/checksum.py +168 -0
- rucio/common/client.py +122 -0
- rucio/common/config.py +22 -35
- rucio/common/constants.py +61 -3
- rucio/common/didtype.py +72 -24
- rucio/common/dumper/__init__.py +45 -38
- rucio/common/dumper/consistency.py +75 -30
- rucio/common/dumper/data_models.py +63 -19
- rucio/common/dumper/path_parsing.py +19 -8
- rucio/common/exception.py +65 -8
- rucio/common/extra.py +5 -10
- rucio/common/logging.py +13 -13
- rucio/common/pcache.py +8 -7
- rucio/common/plugins.py +59 -27
- rucio/common/policy.py +12 -3
- rucio/common/schema/__init__.py +84 -34
- rucio/common/schema/generic.py +0 -17
- rucio/common/schema/generic_multi_vo.py +0 -17
- rucio/common/stomp_utils.py +383 -119
- rucio/common/test_rucio_server.py +12 -6
- rucio/common/types.py +132 -52
- rucio/common/utils.py +93 -643
- rucio/core/account_limit.py +14 -12
- rucio/core/authentication.py +2 -2
- rucio/core/config.py +23 -42
- rucio/core/credential.py +14 -15
- rucio/core/did.py +5 -1
- rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
- rucio/core/did_meta_plugins/filter_engine.py +62 -3
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +43 -30
- rucio/core/did_meta_plugins/postgres_meta.py +75 -39
- rucio/core/identity.py +6 -5
- rucio/core/importer.py +4 -3
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +8 -7
- rucio/core/message.py +6 -0
- rucio/core/monitor.py +30 -29
- rucio/core/naming_convention.py +2 -2
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +11 -9
- rucio/core/permission/__init__.py +79 -37
- rucio/core/permission/generic.py +1 -7
- rucio/core/permission/generic_multi_vo.py +1 -7
- rucio/core/quarantined_replica.py +4 -3
- rucio/core/replica.py +464 -139
- rucio/core/replica_sorter.py +55 -59
- rucio/core/request.py +34 -32
- rucio/core/rse.py +301 -97
- rucio/core/rse_counter.py +1 -2
- rucio/core/rse_expression_parser.py +7 -7
- rucio/core/rse_selector.py +9 -7
- rucio/core/rule.py +41 -40
- rucio/core/rule_grouping.py +42 -40
- rucio/core/scope.py +5 -4
- rucio/core/subscription.py +26 -28
- rucio/core/topology.py +11 -11
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +29 -15
- rucio/core/volatile_replica.py +4 -3
- rucio/daemons/atropos/atropos.py +1 -1
- rucio/daemons/auditor/__init__.py +2 -2
- rucio/daemons/auditor/srmdumps.py +6 -6
- rucio/daemons/automatix/automatix.py +32 -21
- rucio/daemons/badreplicas/necromancer.py +2 -2
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +26 -90
- rucio/daemons/common.py +15 -25
- rucio/daemons/conveyor/finisher.py +2 -2
- rucio/daemons/conveyor/poller.py +18 -28
- rucio/daemons/conveyor/receiver.py +53 -123
- rucio/daemons/conveyor/stager.py +1 -0
- rucio/daemons/conveyor/submitter.py +3 -3
- rucio/daemons/hermes/hermes.py +129 -369
- rucio/daemons/judge/evaluator.py +2 -2
- rucio/daemons/oauthmanager/oauthmanager.py +3 -3
- rucio/daemons/reaper/dark_reaper.py +7 -3
- rucio/daemons/reaper/reaper.py +12 -16
- rucio/daemons/rsedecommissioner/config.py +1 -1
- rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
- rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
- rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
- rucio/daemons/storage/consistency/actions.py +8 -6
- rucio/daemons/tracer/kronos.py +117 -142
- rucio/db/sqla/constants.py +5 -0
- rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
- rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
- rucio/db/sqla/models.py +157 -154
- rucio/db/sqla/session.py +58 -27
- rucio/db/sqla/types.py +2 -2
- rucio/db/sqla/util.py +2 -2
- rucio/gateway/account.py +18 -12
- rucio/gateway/account_limit.py +137 -60
- rucio/gateway/authentication.py +18 -12
- rucio/gateway/config.py +30 -20
- rucio/gateway/credential.py +9 -10
- rucio/gateway/did.py +70 -53
- rucio/gateway/dirac.py +6 -4
- rucio/gateway/exporter.py +3 -2
- rucio/gateway/heartbeat.py +6 -4
- rucio/gateway/identity.py +36 -51
- rucio/gateway/importer.py +3 -2
- rucio/gateway/lifetime_exception.py +3 -2
- rucio/gateway/meta_conventions.py +17 -6
- rucio/gateway/permission.py +4 -1
- rucio/gateway/quarantined_replica.py +3 -2
- rucio/gateway/replica.py +31 -22
- rucio/gateway/request.py +27 -18
- rucio/gateway/rse.py +69 -37
- rucio/gateway/rule.py +46 -26
- rucio/gateway/scope.py +3 -2
- rucio/gateway/subscription.py +14 -11
- rucio/gateway/vo.py +12 -8
- rucio/rse/__init__.py +3 -3
- rucio/rse/protocols/bittorrent.py +11 -1
- rucio/rse/protocols/cache.py +0 -11
- rucio/rse/protocols/dummy.py +0 -11
- rucio/rse/protocols/gfal.py +14 -9
- rucio/rse/protocols/globus.py +1 -1
- rucio/rse/protocols/http_cache.py +1 -1
- rucio/rse/protocols/posix.py +2 -2
- rucio/rse/protocols/protocol.py +84 -317
- rucio/rse/protocols/rclone.py +2 -1
- rucio/rse/protocols/rfio.py +10 -1
- rucio/rse/protocols/ssh.py +2 -1
- rucio/rse/protocols/storm.py +2 -13
- rucio/rse/protocols/webdav.py +74 -30
- rucio/rse/protocols/xrootd.py +2 -1
- rucio/rse/rsemanager.py +170 -53
- rucio/rse/translation.py +260 -0
- rucio/tests/common.py +23 -13
- rucio/tests/common_server.py +26 -9
- rucio/transfertool/bittorrent.py +15 -14
- rucio/transfertool/bittorrent_driver.py +5 -7
- rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
- rucio/transfertool/fts3.py +20 -16
- rucio/transfertool/mock.py +2 -3
- rucio/vcsversion.py +4 -4
- rucio/version.py +7 -0
- rucio/web/rest/flaskapi/v1/accounts.py +17 -3
- rucio/web/rest/flaskapi/v1/auth.py +5 -5
- rucio/web/rest/flaskapi/v1/credentials.py +3 -2
- rucio/web/rest/flaskapi/v1/dids.py +21 -15
- rucio/web/rest/flaskapi/v1/identities.py +33 -9
- rucio/web/rest/flaskapi/v1/redirect.py +5 -4
- rucio/web/rest/flaskapi/v1/replicas.py +12 -8
- rucio/web/rest/flaskapi/v1/rses.py +15 -4
- rucio/web/rest/flaskapi/v1/traces.py +56 -19
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.template +3 -19
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/requirements.server.txt +97 -68
- rucio-37.0.0rc2.data/scripts/rucio +133 -0
- rucio-37.0.0rc2.data/scripts/rucio-admin +97 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-atropos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-auditor +2 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-automatix +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-client +17 -10
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-receiver +1 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-kronos +1 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos-temporary-expiration +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-necromancer +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-reaper +6 -6
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-transmogrifier +2 -2
- rucio-37.0.0rc2.dist-info/METADATA +92 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/RECORD +239 -245
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/AUTHORS.rst +3 -0
- rucio/common/schema/atlas.py +0 -413
- rucio/common/schema/belleii.py +0 -408
- rucio/common/schema/domatpc.py +0 -401
- rucio/common/schema/escape.py +0 -426
- rucio/common/schema/icecube.py +0 -406
- rucio/core/permission/atlas.py +0 -1348
- rucio/core/permission/belleii.py +0 -1077
- rucio/core/permission/escape.py +0 -1078
- rucio/daemons/c3po/algorithms/__init__.py +0 -13
- rucio/daemons/c3po/algorithms/simple.py +0 -134
- rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
- rucio/daemons/c3po/c3po.py +0 -371
- rucio/daemons/c3po/collectors/agis.py +0 -108
- rucio/daemons/c3po/collectors/free_space.py +0 -81
- rucio/daemons/c3po/collectors/jedi_did.py +0 -57
- rucio/daemons/c3po/collectors/mock_did.py +0 -51
- rucio/daemons/c3po/collectors/network_metrics.py +0 -71
- rucio/daemons/c3po/collectors/workload.py +0 -112
- rucio/daemons/c3po/utils/__init__.py +0 -13
- rucio/daemons/c3po/utils/dataset_cache.py +0 -50
- rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
- rucio/daemons/c3po/utils/expiring_list.py +0 -62
- rucio/daemons/c3po/utils/popularity.py +0 -85
- rucio/daemons/c3po/utils/timeseries.py +0 -89
- rucio/rse/protocols/gsiftp.py +0 -92
- rucio-35.7.0.data/scripts/rucio-c3po +0 -85
- rucio-35.7.0.dist-info/METADATA +0 -72
- /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-account +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-bb8 +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dumper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-follower +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-hermes +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-injector +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-undertaker +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/WHEEL +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/LICENSE +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Copyright European Organization for Nuclear Research (CERN) since 2012
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
import logging
|
|
16
|
-
from json import dumps, loads
|
|
17
|
-
from typing import TYPE_CHECKING, Optional
|
|
18
|
-
|
|
19
|
-
from requests import post
|
|
20
|
-
from requests.auth import HTTPBasicAuth
|
|
21
|
-
|
|
22
|
-
from rucio.common.config import config_get, config_get_options
|
|
23
|
-
|
|
24
|
-
if TYPE_CHECKING:
|
|
25
|
-
from rucio.common.types import InternalScope
|
|
26
|
-
|
|
27
|
-
ELASTIC_URL = config_get('es-atlas', 'url')
|
|
28
|
-
|
|
29
|
-
ELASTIC_OPTIONS = config_get_options('es-atlas')
|
|
30
|
-
|
|
31
|
-
AUTH = None
|
|
32
|
-
if ('username' in ELASTIC_OPTIONS) and ('password' in ELASTIC_OPTIONS):
|
|
33
|
-
AUTH = HTTPBasicAuth(config_get('es-atlas', 'username'), config_get('es-atlas', 'password'))
|
|
34
|
-
|
|
35
|
-
if 'ca_cert' in ELASTIC_OPTIONS:
|
|
36
|
-
ELASTIC_CA_CERT = config_get('es-atlas', 'ca_cert')
|
|
37
|
-
else:
|
|
38
|
-
ELASTIC_CA_CERT = False
|
|
39
|
-
|
|
40
|
-
URL = ELASTIC_URL + '/atlas_rucio-popularity-*/_search'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def get_popularity(did: tuple['InternalScope', str]) -> Optional[int]:
|
|
44
|
-
"""
|
|
45
|
-
Query the popularity for a given DID in the ElasticSearch popularity db.
|
|
46
|
-
"""
|
|
47
|
-
query = {
|
|
48
|
-
"query": {
|
|
49
|
-
"bool": {
|
|
50
|
-
"must": [{
|
|
51
|
-
"range": {
|
|
52
|
-
"timestamp": {
|
|
53
|
-
"gt": "now-7d",
|
|
54
|
-
"lt": "now"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}]
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"aggs": {
|
|
61
|
-
"pop": {"sum": {"field": "ops"}}
|
|
62
|
-
},
|
|
63
|
-
"size": 0
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
query['query']['bool']['must'].append({"term": {"scope": did[0].external}})
|
|
67
|
-
query['query']['bool']['must'].append({"term": {"name": did[1]}})
|
|
68
|
-
|
|
69
|
-
logging.debug(query)
|
|
70
|
-
if AUTH:
|
|
71
|
-
res = post(URL, data=dumps(query), auth=AUTH, verify=ELASTIC_CA_CERT)
|
|
72
|
-
else:
|
|
73
|
-
res = post(URL, data=dumps(query), verify=ELASTIC_CA_CERT)
|
|
74
|
-
|
|
75
|
-
if res.status_code != 200:
|
|
76
|
-
return None
|
|
77
|
-
|
|
78
|
-
result = loads(res.text)
|
|
79
|
-
|
|
80
|
-
if 'aggregations' in result:
|
|
81
|
-
if 'pop' in result['aggregations']:
|
|
82
|
-
if 'value' in result['aggregations']['pop']:
|
|
83
|
-
return result['aggregations']['pop']['value']
|
|
84
|
-
|
|
85
|
-
return None
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Copyright European Organization for Nuclear Research (CERN) since 2012
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
"""
|
|
16
|
-
Redis time series abstraction
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
from time import time
|
|
20
|
-
from typing import TYPE_CHECKING
|
|
21
|
-
|
|
22
|
-
from redis import StrictRedis
|
|
23
|
-
|
|
24
|
-
if TYPE_CHECKING:
|
|
25
|
-
from redis.commands.core import ResponseT
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class RedisTimeSeries:
|
|
29
|
-
"""
|
|
30
|
-
Redis time series abstraction
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
def __init__(
|
|
34
|
-
self,
|
|
35
|
-
redis_host: str,
|
|
36
|
-
redis_port: int,
|
|
37
|
-
window: int,
|
|
38
|
-
prefix: str
|
|
39
|
-
):
|
|
40
|
-
self._redis = StrictRedis(host=redis_host, port=redis_port)
|
|
41
|
-
self._prefix = prefix
|
|
42
|
-
self._window = window * 1000000
|
|
43
|
-
|
|
44
|
-
def add_point(
|
|
45
|
-
self,
|
|
46
|
-
key: str,
|
|
47
|
-
value: int
|
|
48
|
-
) -> None:
|
|
49
|
-
"""
|
|
50
|
-
Add a point
|
|
51
|
-
"""
|
|
52
|
-
r_key = self._prefix + key
|
|
53
|
-
score = int(time() * 1000000)
|
|
54
|
-
self._redis.zadd(r_key, score, "%d:%d" % (value, score)) # type: ignore
|
|
55
|
-
|
|
56
|
-
def get_series(self, key: str) -> tuple[int]:
|
|
57
|
-
"""
|
|
58
|
-
Return a time series tuple
|
|
59
|
-
"""
|
|
60
|
-
r_key = self._prefix + key
|
|
61
|
-
r_series = self._redis.zrange(r_key, 0, -1)
|
|
62
|
-
series = []
|
|
63
|
-
for val in r_series: # type: ignore
|
|
64
|
-
values, _ = val.split(':')
|
|
65
|
-
series.append(int(values))
|
|
66
|
-
|
|
67
|
-
return tuple(series)
|
|
68
|
-
|
|
69
|
-
def trim(self) -> None:
|
|
70
|
-
"""
|
|
71
|
-
Trim the time series
|
|
72
|
-
"""
|
|
73
|
-
now = time()
|
|
74
|
-
max_score = int(now * 1000000 - self._window)
|
|
75
|
-
for key in self.get_keys(): # type: ignore
|
|
76
|
-
self._redis.zremrangebyscore(key, 0, max_score)
|
|
77
|
-
|
|
78
|
-
def get_keys(self) -> "ResponseT":
|
|
79
|
-
"""
|
|
80
|
-
Return matching keys
|
|
81
|
-
"""
|
|
82
|
-
return self._redis.keys(pattern=self._prefix + "*")
|
|
83
|
-
|
|
84
|
-
def delete_keys(self) -> None:
|
|
85
|
-
"""
|
|
86
|
-
Delete keys
|
|
87
|
-
"""
|
|
88
|
-
for key in self.get_keys(): # type: ignore
|
|
89
|
-
self._redis.zremrangebyrank(key, 0, -1)
|
rucio/rse/protocols/gsiftp.py
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Copyright European Organization for Nuclear Research (CERN) since 2012
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
import json
|
|
16
|
-
import os
|
|
17
|
-
|
|
18
|
-
import requests
|
|
19
|
-
|
|
20
|
-
from rucio.common import exception
|
|
21
|
-
from rucio.rse.protocols import protocol
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class Default(protocol.RSEProtocol):
|
|
25
|
-
""" Implementing access to RSEs using gsiftp."""
|
|
26
|
-
|
|
27
|
-
def __init__(self, protocol_attr, rse_settings, logger=None):
|
|
28
|
-
""" Initializes the object with information about the referred RSE.
|
|
29
|
-
|
|
30
|
-
:param props: Properties derived from the RSE Repository
|
|
31
|
-
"""
|
|
32
|
-
super(Default, self).__init__(protocol_attr, rse_settings, logger=logger)
|
|
33
|
-
|
|
34
|
-
def connect(self):
|
|
35
|
-
"""
|
|
36
|
-
Establishes the actual connection to the referred RSE.
|
|
37
|
-
If we decide to use gfal, init should be done here.
|
|
38
|
-
|
|
39
|
-
:raises RSEAccessDenied
|
|
40
|
-
"""
|
|
41
|
-
pass
|
|
42
|
-
|
|
43
|
-
def close(self):
|
|
44
|
-
"""
|
|
45
|
-
Closes the connection to RSE.
|
|
46
|
-
"""
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
def get_space_usage(self):
|
|
50
|
-
"""
|
|
51
|
-
Get RSE space usage information.
|
|
52
|
-
|
|
53
|
-
:returns: a list with dict containing 'totalsize' and 'unusedsize'
|
|
54
|
-
|
|
55
|
-
:raises ServiceUnavailable: if some generic error occurred in the library.
|
|
56
|
-
"""
|
|
57
|
-
rse_name = self.rse['rse']
|
|
58
|
-
dest = '/tmp/rucio-gsiftp-site-size_' + rse_name
|
|
59
|
-
space_usage_url = ''
|
|
60
|
-
# url of space usage json, would be nicer to have it in rse_settings
|
|
61
|
-
agis = requests.get('http://atlas-agis-api.cern.ch/request/ddmendpoint/query/list/?json').json()
|
|
62
|
-
agis_token = ''
|
|
63
|
-
for res in agis:
|
|
64
|
-
if rse_name == res['name']:
|
|
65
|
-
agis_token = res['token']
|
|
66
|
-
space_usage_url = res['space_usage_url']
|
|
67
|
-
|
|
68
|
-
import gfal2 # pylint: disable=import-error
|
|
69
|
-
gfal2.set_verbose(gfal2.verbose_level.normal) # pylint: disable=no-member
|
|
70
|
-
try:
|
|
71
|
-
if os.path.exists(dest):
|
|
72
|
-
os.remove(dest)
|
|
73
|
-
ctx = gfal2.creat_context() # pylint: disable=no-member
|
|
74
|
-
ctx.set_opt_string_list("SRM PLUGIN", "TURL_PROTOCOLS", ["gsiftp", "rfio", "gsidcap", "dcap", "kdcap"])
|
|
75
|
-
params = ctx.transfer_parameters()
|
|
76
|
-
params.timeout = 3600
|
|
77
|
-
ret = ctx.filecopy(params, str(space_usage_url), str('file://' + dest))
|
|
78
|
-
|
|
79
|
-
if ret == 0:
|
|
80
|
-
data_file = open(dest)
|
|
81
|
-
data = json.load(data_file)
|
|
82
|
-
data_file.close()
|
|
83
|
-
if agis_token not in list(data.keys()):
|
|
84
|
-
print('ERROR: space usage json has different token as key')
|
|
85
|
-
else:
|
|
86
|
-
totalsize = int(data[agis_token]['total_space'])
|
|
87
|
-
used = int(data[agis_token]['used_space'])
|
|
88
|
-
unusedsize = totalsize - used
|
|
89
|
-
return totalsize, unusedsize
|
|
90
|
-
except Exception as error:
|
|
91
|
-
print(error)
|
|
92
|
-
raise exception.ServiceUnavailable(error)
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!python
|
|
2
|
-
# Copyright European Organization for Nuclear Research (CERN) since 2012
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
"""
|
|
17
|
-
C-3PO is a dynamic data placement daemon.
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
import argparse
|
|
21
|
-
import signal
|
|
22
|
-
|
|
23
|
-
from rucio.common.utils import StoreAndDeprecateWarningAction
|
|
24
|
-
from rucio.daemons.c3po.c3po import run, stop
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def get_parser():
|
|
28
|
-
"""
|
|
29
|
-
Returns the argparse parser.
|
|
30
|
-
"""
|
|
31
|
-
parser = argparse.ArgumentParser(description="The C3PO daemon is responsible for dynamic data placement.")
|
|
32
|
-
parser.add_argument("--run-once", action="store_true", default=False, help='One iteration only')
|
|
33
|
-
parser.add_argument("--threads", action="store", default=1, type=int, help='Concurrency control: number of threads')
|
|
34
|
-
parser.add_argument("--only-workload", action="store_true", default=False, help='Only run the workload collector')
|
|
35
|
-
parser.add_argument("--dry_run", "--dry-run", new_option_string="--dry-run", action=StoreAndDeprecateWarningAction, default=False, help='Do not create any rules')
|
|
36
|
-
parser.add_argument("--sampling", action="store_true", default=False, help='In the end flip a to decide to create a rule or not')
|
|
37
|
-
parser.add_argument("--algorithms", action="store", default="t2_free_space_only_pop_with_network", type=str, help='The placement algorithm or, if in dry_run, a comma separated list of algorithms')
|
|
38
|
-
parser.add_argument("--datatypes", action="store", default="NTUP,DAOD", type=str, help='Comma separated list of datatype that should trigger the placement')
|
|
39
|
-
parser.add_argument("--dest_rse_expr", "--dest-rse-expr", new_option_string="--dest-rse-expr", action=StoreAndDeprecateWarningAction, default="type=DATADISK", type=str, help='RSE expression defining the allowed destination RSEs')
|
|
40
|
-
parser.add_argument("--max_bytes_hour", "--max-bytes-hour", new_option_string="--max-bytes-hour", action=StoreAndDeprecateWarningAction, default=100000000000000, type=int, help='Max number of bytes that c3po is allow to replicate per hour')
|
|
41
|
-
parser.add_argument("--max_files_hour", "--max-files-hour", new_option_string="--max-files-hour", action=StoreAndDeprecateWarningAction, default=100000, type=int, help='Max number of files that c3po is allow to replicate per hour')
|
|
42
|
-
parser.add_argument("--max_bytes_hour_rse", "--max-bytes-hour-rse", new_option_string="--max-bytes-hour-rse", action=StoreAndDeprecateWarningAction, default=50000000000000, type=int, help='Max number of bytes that c3po is allow to replicate per hour per rse') # NOQA: E501
|
|
43
|
-
parser.add_argument("--max_files_hour_rse", "--max-files-hour-rse", new_option_string="--max-files-hour-rse", action=StoreAndDeprecateWarningAction, default=10000, type=int, help='Max number of files that c3po is allow to replicate per hour prse_rse')
|
|
44
|
-
parser.add_argument("--min_popularity", "--min-popularity", new_option_string="--min-popularity", action=StoreAndDeprecateWarningAction, default=8, type=int, help='Min number of popularity accesses for a DID in the last 7 days to trigger')
|
|
45
|
-
parser.add_argument("--min_recent_requests", "--min-recent-requests", new_option_string="--min-recent-requests", action=StoreAndDeprecateWarningAction, default=5, type=int, help='Min number of times a DID has to be requested in the last hour to trigger') # NOQA: E501
|
|
46
|
-
parser.add_argument("--max_replicas", "--max-replicas", new_option_string="--max-replicas", action=StoreAndDeprecateWarningAction, default=5, type=int, help='Max number of replicas above which not to trigger anymore')
|
|
47
|
-
parser.add_argument('--waiting-time-read-free-space', action="store", default=1800, type=int, help='Waiting time for reading free space')
|
|
48
|
-
parser.add_argument('--waiting-time-read-workload', action="store", default=1800, type=int, help='Waiting time for reading workload')
|
|
49
|
-
parser.add_argument('--waiting-time-print-workload', action="store", default=600, type=int, help='Waiting time for printing workload')
|
|
50
|
-
parser.add_argument('--waiting-time-read-dids', action="store", default=60, type=int, help='Waiting time for reading dids')
|
|
51
|
-
parser.add_argument('--waiting-time-place-replica', action="store", default=100, type=int, help='Waiting time for placing replicas')
|
|
52
|
-
parser.add_argument('--sleep-time', action="store", default=10, type=int, help='Concurrency control: thread sleep time after each chunk of work')
|
|
53
|
-
return parser
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if __name__ == "__main__":
|
|
57
|
-
|
|
58
|
-
signal.signal(signal.SIGTERM, stop)
|
|
59
|
-
parser = get_parser()
|
|
60
|
-
args = parser.parse_args()
|
|
61
|
-
|
|
62
|
-
try:
|
|
63
|
-
run(once=args.run_once,
|
|
64
|
-
threads=args.threads,
|
|
65
|
-
only_workload=args.only_workload,
|
|
66
|
-
dry_run=args.dry_run,
|
|
67
|
-
sampling=args.sampling,
|
|
68
|
-
algorithms=args.algorithms,
|
|
69
|
-
datatypes=args.datatypes,
|
|
70
|
-
dest_rse_expr=args.dest_rse_expr,
|
|
71
|
-
max_bytes_hour=args.max_bytes_hour,
|
|
72
|
-
max_files_hour=args.max_files_hour,
|
|
73
|
-
max_bytes_hour_rse=args.max_bytes_hour_rse,
|
|
74
|
-
max_files_hour_rse=args.max_files_hour_rse,
|
|
75
|
-
min_popularity=args.min_popularity,
|
|
76
|
-
min_recent_requests=args.min_recent_requests,
|
|
77
|
-
max_replicas=args.max_replicas,
|
|
78
|
-
waiting_time_read_free_space=args.waiting_time_read_free_space,
|
|
79
|
-
waiting_time_read_workload=args.waiting_time_read_workload,
|
|
80
|
-
waiting_time_print_workload=args.waiting_time_print_workload,
|
|
81
|
-
waiting_time_read_dids=args.waiting_time_read_dids,
|
|
82
|
-
waiting_time_place_replica=args.waiting_time_place_replica,
|
|
83
|
-
sleep_time=args.sleep_time)
|
|
84
|
-
except KeyboardInterrupt:
|
|
85
|
-
stop()
|
rucio-35.7.0.dist-info/METADATA
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: rucio
|
|
3
|
-
Version: 35.7.0
|
|
4
|
-
Summary: Rucio Package
|
|
5
|
-
Home-page: https://rucio.cern.ch/
|
|
6
|
-
Author: Rucio
|
|
7
|
-
Author-email: rucio-dev@cern.ch
|
|
8
|
-
License: Apache License, Version 2.0
|
|
9
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
-
Classifier: Intended Audience :: Information Technology
|
|
12
|
-
Classifier: Intended Audience :: System Administrators
|
|
13
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
-
Classifier: Natural Language :: English
|
|
15
|
-
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Environment :: No Input/Output (Daemon)
|
|
20
|
-
Requires-Python: >=3.9, <4
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
License-File: AUTHORS.rst
|
|
23
|
-
Requires-Dist: alembic==1.13.2
|
|
24
|
-
Requires-Dist: argcomplete==3.4.0
|
|
25
|
-
Requires-Dist: boto3==1.34.142
|
|
26
|
-
Requires-Dist: dogpile-cache==1.2.2
|
|
27
|
-
Requires-Dist: flask==3.0.3
|
|
28
|
-
Requires-Dist: geoip2==4.8.0
|
|
29
|
-
Requires-Dist: google-auth==2.32.0
|
|
30
|
-
Requires-Dist: jsonschema==4.23.0
|
|
31
|
-
Requires-Dist: oic==1.7.0
|
|
32
|
-
Requires-Dist: paramiko==3.4.0
|
|
33
|
-
Requires-Dist: prometheus-client==0.20.0
|
|
34
|
-
Requires-Dist: pymemcache==4.0.0
|
|
35
|
-
Requires-Dist: python-dateutil==2.9.0.post0
|
|
36
|
-
Requires-Dist: python-magic==0.4.27
|
|
37
|
-
Requires-Dist: redis==5.0.7
|
|
38
|
-
Requires-Dist: requests==2.32.3
|
|
39
|
-
Requires-Dist: sqlalchemy==2.0.31
|
|
40
|
-
Requires-Dist: statsd==4.0.1
|
|
41
|
-
Requires-Dist: stomp-py==8.1.2
|
|
42
|
-
Requires-Dist: tabulate==0.9.0
|
|
43
|
-
Requires-Dist: urllib3==1.26.19
|
|
44
|
-
Provides-Extra: oracle
|
|
45
|
-
Requires-Dist: cx-oracle==8.3.0; extra == "oracle"
|
|
46
|
-
Provides-Extra: mongo
|
|
47
|
-
Requires-Dist: pymongo==4.8.0; extra == "mongo"
|
|
48
|
-
Provides-Extra: postgresql
|
|
49
|
-
Requires-Dist: psycopg2-binary==2.9.9; extra == "postgresql"
|
|
50
|
-
Provides-Extra: mysql
|
|
51
|
-
Requires-Dist: pymysql==1.1.1; extra == "mysql"
|
|
52
|
-
Provides-Extra: kerberos
|
|
53
|
-
Requires-Dist: kerberos==1.3.1; extra == "kerberos"
|
|
54
|
-
Requires-Dist: pykerberos==1.2.4; extra == "kerberos"
|
|
55
|
-
Requires-Dist: requests-kerberos==0.15.0; extra == "kerberos"
|
|
56
|
-
Provides-Extra: globus
|
|
57
|
-
Requires-Dist: globus-sdk==3.41.0; extra == "globus"
|
|
58
|
-
Requires-Dist: pyyaml==6.0.1; extra == "globus"
|
|
59
|
-
Provides-Extra: saml
|
|
60
|
-
Requires-Dist: python3-saml==1.16.0; extra == "saml"
|
|
61
|
-
Provides-Extra: dev
|
|
62
|
-
Requires-Dist: pyyaml==6.0.1; extra == "dev"
|
|
63
|
-
Dynamic: author
|
|
64
|
-
Dynamic: author-email
|
|
65
|
-
Dynamic: classifier
|
|
66
|
-
Dynamic: home-page
|
|
67
|
-
Dynamic: license
|
|
68
|
-
Dynamic: license-file
|
|
69
|
-
Dynamic: provides-extra
|
|
70
|
-
Dynamic: requires-dist
|
|
71
|
-
Dynamic: requires-python
|
|
72
|
-
Dynamic: summary
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl
RENAMED
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl
RENAMED
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl
RENAMED
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl
RENAMED
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl
RENAMED
|
File without changes
|
{rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|