Skip to content

Commit

Permalink
Merge pull request #12150 from amaltaro/fix-11192-take2
Browse files Browse the repository at this point in the history
Move filter replication json document under etc/
  • Loading branch information
amaltaro authored Oct 22, 2024
2 parents 153b0ef + ec125dd commit 3917282
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"_deleted": {"$exists": false},
"type": "WMCore.WorkQueue.DataStructs.WorkQueueElement.WorkQueueElement",
"WMCore\\.WorkQueue\\.DataStructs\\.WorkQueueElement\\.WorkQueueElement":
{"ParentQueueUrl": "config.WorkQueueManager.queueParams['ParentQueueCouchUrl']",
"ChildQueueUrl": "config.WorkQueueManager.queueParams['QueueURL']"}
{"ChildQueueUrl": "config.WorkQueueManager.queueParams['QueueURL']"}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ def __init__(self, config):
self.hostPortAMQ = getattr(config.AgentStatusWatcher, "hostPortAMQ", [('cms-mb.cern.ch', 61313)])

# Load CouchDB replication filters
jsonDir = os.path.dirname(os.path.abspath(__file__))
replicationFile = os.path.join(jsonDir, "replication_selector.json")
# see: https://github.com/dmwm/CMSKubernetes/blob/69f0a02a52101ef/docker/pypi/wmagent/Dockerfile#L34
jsonDir = os.environ.get("WMA_DEPLOY_DIR", "/usr/local")
replicationFile = os.path.join(jsonDir, "etc/replication_selector.json")
if os.path.exists(replicationFile):
with open(replicationFile, 'r') as fd:
self.replicationDict = json.load(fd)
Expand Down Expand Up @@ -109,7 +110,6 @@ def setUpCouchDBReplication(self):
localQInboxURL = "%s_inbox" % self.config.AnalyticsDataCollector.localQueueURL
# Update the selector filter
workqueueEscapedKey = "WMCore\.WorkQueue\.DataStructs\.WorkQueueElement\.WorkQueueElement"
self.replicationDict['WorkQueue/queueFilter'][workqueueEscapedKey]["ParentQueueUrl"] = parentQueueUrl
self.replicationDict['WorkQueue/queueFilter'][workqueueEscapedKey]["ChildQueueUrl"] = childQueueUrl
self.replicatorDocs.append({'source': parentQueueUrl,
'target': localQInboxURL,
Expand Down
1 change: 1 addition & 0 deletions test/etc/UnstableTests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ WMCore_t.Services_t.pycurlFileUpload_t.PyCurlRESTServer:testFailingFileUpload
WMCore_t.Services_t.LogDB_t.LogDB_t.LogDBTest:test_heartbeat
WMCore_t.WorkerThreads_t.WorkerThreads_t.WorkerThreadsTest:testWorkerError
WMCore_t.ReqMgr_t.Service_t.Auxiliary_t.AuxiliaryTest:testAllTransferDocs
WMCore_t.Services_t.Rucio_t.RucioUtils_t.RucioUtilsTest:testWeightedChoice
### Starting here, we have the Python3 unstable tests
WMCore_t.JobSplitting_t.RunBased_t.RunBasedTest:testMultipleRunsCombine
WMCore_t.MicroService_t.MSRuleCleaner_t.MSRuleCleanerWflow_t.MSRuleCleanerWflowTest:testMultiPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"""
AgentStatusWatcher test
"""

from __future__ import print_function, division

import os
import threading
import unittest
from WMQuality.TestInitCouchApp import TestInitCouchApp as TestInit
Expand Down Expand Up @@ -82,6 +80,28 @@ def testAgentStatusPoller(self):
"""
threading.currentThread()
config = self.getConfig()
# change between RPM and Docker based tests
print(f"WMA_DEPLOY_DIR: {os.environ.get('WMA_DEPLOY_DIR')}")
print(f"WMCORE_ROOT: {os.environ.get('WMCORE_ROOT')}")
if os.environ.get('WMA_DEPLOY_DIR'):
## check for Alma9 docker
print(f"Found WMA_DEPLOY_DIR set to: {os.environ.get('WMA_DEPLOY_DIR')}")
elif os.environ.get('TEST_DIR'):
# check for CC7 docker
print(f"Found TEST_DIR set to: {os.environ.get('TEST_DIR')}")
os.environ["WMA_DEPLOY_DIR"] = os.path.join(os.environ.get('TEST_DIR'), "WMCore")
elif os.environ.get('WMCORE_ROOT'):
# check for CC7 RPM
print(f"Found WMCORE_ROOT set to: {os.environ.get('WMCORE_ROOT')}")
#os.environ["WMA_DEPLOY_DIR"] = os.path.join(os.environ.get('WMCORE_ROOT'), "install")
os.environ["WMA_DEPLOY_DIR"] = os.environ.get('WMCORE_ROOT')
else:
# last fallback path
fallbackDir = "/home/cmsbld/WMCore/"
print("Did not find any of the expected env vars: WMA_DEPLOY_DIR, TEST_DIR, WMCORE_ROOT")
print(f"Setting WMA_DEPLOY_DIR environment variable to: {fallbackDir}")
os.environ["WMA_DEPLOY_DIR"] = os.path.join(fallbackDir, "install")

watcher = AgentStatusPoller(config)
# Note:
# Should call: watcher.setup() and watcher.algorithm()
Expand All @@ -94,7 +114,7 @@ def testAgentStatusPoller(self):
# Check service certificate and proxy lifetimes
watcher.checkCredLifetime(agInfo, "proxy")
watcher.checkCredLifetime(agInfo, "certificate")
print("Agent Info:\n%s" % (agInfo))
print(f"Agent Info:\n{agInfo}")

if __name__ == '__main__':
unittest.main()

0 comments on commit 3917282

Please sign in to comment.