Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Pilot submission with tokens #6750

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ jobs:
git show
# Create the tag
git tag "$NEW_VERSION"
echo ::set-output name=create-release::true
echo ::set-output name=new-version::"$NEW_VERSION"
echo "create-release=true" >> $GITHUB_OUTPUT
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
fi
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ exclude: |

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
exclude: |
Expand All @@ -44,7 +44,7 @@ repos:
)$

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py39-plus"]
Expand Down
2 changes: 1 addition & 1 deletion dirac.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Registry
VOMSName = lhcb

# Registered identity provider associated with VO
IdP = CheckIn
IdProvider = CheckIn

# Section to describe all the VOMS servers that can be used with the given VOMS VO
VOMSServers
Expand Down
2 changes: 1 addition & 1 deletion docs/diracdoctools/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def writeLinesToFile(filename, lines):
except AttributeError:
# ignore decode if newContent is python3 str
pass
except (UnicodeDecodeError) as e:
except UnicodeDecodeError as e:
LOG.error('Failed to decode newContent with "utf-8": %r', e)
raise
rst.write(newContent)
Expand Down
1 change: 0 additions & 1 deletion docs/diracdoctools/scripts/dirac-docs-get-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ def createRelease(self):


if __name__ == "__main__":

RUNNER = GithubInterface()
try:
RUNNER.parseOptions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class PingPongMindHandler(ExecutorMindHandler):

MSG_DEFINITIONS = {"StartReaction": {"numBounces": int}}

auth_msg_StartReaction = ["all"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class PingPongHandler(RequestHandler):

MSG_DEFINITIONS = {"Ping": {"id": int}, "Pong": {"id": int}}

auth_conn_connected = ["all"]
Expand Down
2 changes: 0 additions & 2 deletions src/DIRAC/AccountingSystem/Agent/NetworkAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class NetworkAgent(AgentModule):
BUFFER_TIMEOUT = 3600

def initialize(self):

self.log = gLogger.getSubLogger(self.__class__.__name__)

# API initialization is required to get an up-to-date configuration from the CS
Expand Down Expand Up @@ -113,7 +112,6 @@ def checkConsumers(self):

# recreate consumers if there are any problems
if not self.consumers or self.messagesCount == self.messagesCountOld:

for consumer in self.consumers:
consumer.close()

Expand Down
3 changes: 0 additions & 3 deletions src/DIRAC/AccountingSystem/Agent/test/Test_NetworkAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class NetworkAgentSuccessTestCase(unittest.TestCase):
"""Test class to check success scenarios."""

def setUp(self):

# external dependencies
module.datetime = MagicMock()

Expand All @@ -62,7 +61,6 @@ def tearDownClass(cls):
sys.modules.pop("DIRAC.AccountingSystem.Agent.NetworkAgent")

def test_updateNameDictionary(self):

module.gConfig.getConfigurationTree.side_effect = [
{"OK": True, "Value": INITIAL_CONFIG},
{"OK": True, "Value": UPDATED_CONFIG},
Expand All @@ -85,7 +83,6 @@ def test_updateNameDictionary(self):
self.assertRaises(KeyError, lambda: self.agent.nameDictionary[SITE2_HOST1])

def test_agentExecute(self):

module.NetworkAgent.am_getOption.return_value = f"{MQURI1}, {MQURI2}"
module.gConfig.getConfigurationTree.return_value = {"OK": True, "Value": INITIAL_CONFIG}

Expand Down
1 change: 0 additions & 1 deletion src/DIRAC/AccountingSystem/Client/ReportsClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def listReports(self, typeName):
return result

def getReport(self, typeName, reportName, startTime, endTime, condDict, grouping, extraArgs=None):

if not isinstance(extraArgs, dict):
extraArgs = {}
plotRequest = {
Expand Down
1 change: 0 additions & 1 deletion src/DIRAC/AccountingSystem/DB/test/Test_AccountingDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class TestCase(unittest.TestCase):
"""Base class for the AccountingDB test cases"""

def setUp(self):

self.moduleTested = moduleTested
self.testClass = self.moduleTested.AccountingDB

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class BaseReporter(DBUtils):

_PARAM_CHECK_FOR_NONE = "checkNone"
_PARAM_CALCULATE_PROPORTIONAL_GAUGES = "calculateProportionalGauges"
_PARAM_CONVERT_TO_GRANULARITY = "convertToGranularity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class DataOperationPlotter(BaseReporter):

_typeName = "DataOperation"
_typeKeyFields = [dF[0] for dF in DataOperation().definitionKeyFields]

Expand Down
1 change: 0 additions & 1 deletion src/DIRAC/AccountingSystem/private/Plotters/JobPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class JobPlotter(BaseReporter):

_typeName = "Job"
_typeKeyFields = [dF[0] for dF in Job().definitionKeyFields]

Expand Down
8 changes: 0 additions & 8 deletions src/DIRAC/AccountingSystem/private/Plotters/NetworkPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@


class NetworkPlotter(BaseReporter):

_typeName = "Network"
_typeKeyFields = [dF[0] for dF in Network().definitionKeyFields]

_reportPacketLossRateName = "Packet loss rate"

def _reportPacketLossRate(self, reportRequest):

selectFields = (
self._getSelectStringForGrouping(reportRequest["groupingFields"]) + ", %s, %s, 100 - SUM(%s)/SUM(%s), 100",
reportRequest["groupingFields"][1] + ["startTime", "bucketLength", "PacketLossRate", "entriesInBucket"],
Expand All @@ -43,7 +41,6 @@ def _reportPacketLossRate(self, reportRequest):
return S_OK({"data": dataDict, "granularity": granularity})

def _plotPacketLossRate(self, reportRequest, plotInfo, filename):

# prepare custom scale (10,20,...,100)
scale_data = dict(zip(range(0, 101), range(100, -1, -1)))
scale_ticks = list(range(0, 101, 10))
Expand All @@ -63,7 +60,6 @@ def _plotPacketLossRate(self, reportRequest, plotInfo, filename):
_reportMagnifiedPacketLossRateName = "Packet loss rate (magnified)"

def _reportMagnifiedPacketLossRate(self, reportRequest):

selectFields = (
self._getSelectStringForGrouping(reportRequest["groupingFields"])
+ ", %s, %s, 100 - IF(SUM(%s)/SUM(%s)*10 > 100, 100, SUM(%s)/SUM(%s)*10), 100",
Expand Down Expand Up @@ -94,7 +90,6 @@ def _reportMagnifiedPacketLossRate(self, reportRequest):
return S_OK({"data": dataDict, "granularity": granularity})

def _plotMagnifiedPacketLossRate(self, reportRequest, plotInfo, filename):

# prepare custom scale (1..10, 100)
boundaries = list(np.arange(0, 10, 0.1))
boundaries.extend(range(10, 110, 10))
Expand All @@ -120,7 +115,6 @@ def _plotMagnifiedPacketLossRate(self, reportRequest, plotInfo, filename):
_reportAverageOneWayDelayName = "One-way delay (average)"

def _reportAverageOneWayDelay(self, reportRequest):

selectFields = (
self._getSelectStringForGrouping(reportRequest["groupingFields"]) + ", %s, %s, SUM(%s)/SUM(%s)",
reportRequest["groupingFields"][1] + ["startTime", "bucketLength", "OneWayDelay", "entriesInBucket"],
Expand Down Expand Up @@ -158,7 +152,6 @@ def _plotAverageOneWayDelay(self, reportRequest, plotInfo, filename):
_reportJitterName = "Jitter"

def _reportJitter(self, reportRequest):

selectFields = (
self._getSelectStringForGrouping(reportRequest["groupingFields"]) + ", %s, %s, SUM(%s)/SUM(%s)",
reportRequest["groupingFields"][1] + ["startTime", "bucketLength", "Jitter", "entriesInBucket"],
Expand Down Expand Up @@ -196,7 +189,6 @@ def _plotJitter(self, reportRequest, plotInfo, filename):
_reportJitterDelayRatioName = "Jitter/Delay"

def _reportJitterDelayRatio(self, reportRequest):

selectFields = (
self._getSelectStringForGrouping(reportRequest["groupingFields"]) + ", %s, %s, SUM(%s)/SUM(%s)",
reportRequest["groupingFields"][1] + ["startTime", "bucketLength", "Jitter", "OneWayDelay"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class PilotPlotter(BaseReporter):

_typeName = "Pilot"
_typeKeyFields = [dF[0] for dF in Pilot().definitionKeyFields]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class WMSHistoryPlotter(BaseReporter):

_typeName = "WMSHistory"
_typeKeyFields = [dF[0] for dF in WMSHistory().definitionKeyFields]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class FilterExecutor:

ALLKW = "all"

def __init__(self):
Expand Down
2 changes: 0 additions & 2 deletions src/DIRAC/ConfigurationSystem/Agent/Bdii2CSAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def __lookForNewCEs(self):
return S_OK()

def __getGlue2CEInfo(self, vo):

if vo in self.voBdiiCEDict:
return S_OK(self.voBdiiCEDict[vo])
self.log.info("Check for available CEs for VO", vo)
Expand Down Expand Up @@ -279,7 +278,6 @@ def __purgeSites(self, ceBdiiDict):
return

def __updateCS(self, bdiiChangeSet):

queueVODict = {}
changeSet = set()
for entry in bdiiChangeSet:
Expand Down
1 change: 0 additions & 1 deletion src/DIRAC/ConfigurationSystem/Agent/GOCDB2CSAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def __updateConfiguration(self, setElements=None, delElements=None):

# assure existence and proper value of a section or an option
for path, value in setElements.items():

if value is None:
section = path
else:
Expand Down
2 changes: 0 additions & 2 deletions src/DIRAC/ConfigurationSystem/Agent/VOMS2CSAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def initialize(self):
return S_OK()

def execute(self):

for vo in self.voList:
voAdminUser = getVOOption(vo, "VOAdmin")
voAdminMail = None
Expand Down Expand Up @@ -198,7 +197,6 @@ def __syncCSWithVOMS(self, vomsSync):

@executeWithUserProxy
def __addHomeDirectory(self, vo, newUsers):

fc = FileCatalog(vo=vo)
defaultVOGroup = getVOOption(vo, "DefaultGroup", "%s_user" % vo)

Expand Down
4 changes: 0 additions & 4 deletions src/DIRAC/ConfigurationSystem/Agent/test/Test_Bdii2CS.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def tearDown(self):
pass

def test__getGlue2CEInfo_success(self):

expectedResult = {}
expectedResult.update(ALTBDII)
expectedResult.update(MAINBDII)
Expand All @@ -61,7 +60,6 @@ def test__getGlue2CEInfo_success(self):
self.assertNotIn("ce2b", ret["Value"]["site2"]["CEs"])

def test__getGlue2CEInfo_fail_10(self):

self.agent.alternativeBDIIs = ["server2"]
with patch(
MODNAME + ".getGlue2CEInfo",
Expand All @@ -86,7 +84,6 @@ def test__getGlue2CEInfo_fail_10(self):
self.assertEqual(ALTBDII, ret["Value"])

def test__getGlue2CEInfo_fail_01(self):

self.agent.alternativeBDIIs = ["server2"]
with patch(
MODNAME + ".getGlue2CEInfo",
Expand All @@ -111,7 +108,6 @@ def test__getGlue2CEInfo_fail_01(self):
self.assertEqual(MAINBDII, ret["Value"])

def test__getGlue2CEInfo_fail_11(self):

self.agent.alternativeBDIIs = ["server2"]
with patch(
MODNAME + ".getGlue2CEInfo",
Expand Down
Loading