Skip to content

Commit 020fb93

Browse files
author
Robin VAN DE MERGHEL
committed
feat: Add in CI new legacy adapted services.
1 parent cfba462 commit 020fb93

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/integration.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ jobs:
5757
requests \
5858
typer
5959
- name: Prepare environment
60-
run: ./integration_tests.py prepare-environment ${{ matrix.ARGS }}
60+
run: |
61+
./integration_tests.py prepare-environment ${{ matrix.ARGS }} \
62+
--legacy-adapted-services WorkloadManagement/JobMonitoring \
63+
--legacy-adapted-services WorkloadManagement/JobStateUpdate
6164
- name: Install server
6265
run: ./integration_tests.py install-server
66+
- name: Get legacy adaptors
67+
run: ./integration_tests.py list-legacy-adapted-services
6368
- name: Install client
6469
run: ./integration_tests.py install-client
6570
- name: Install pilot

integration_tests.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,15 @@ def list_services():
538538
typer.secho(f"* {service}", err=True)
539539

540540

541+
@app.command()
542+
def list_legacy_adapted_services():
543+
"""List the services which are adapted with legacy adaptor."""
544+
_check_containers_running()
545+
typer.secho("Known legacy adapted services:", err=True)
546+
for service in _list_legacy_adaptedservices()[1]:
547+
typer.secho(f"* {service}", err=True)
548+
549+
541550
@app.command()
542551
def runsvctrl(command: str, pattern: str):
543552
"""Execute runsvctrl inside the server container."""
@@ -1259,6 +1268,28 @@ def _list_services():
12591268
raise typer.Exit(1)
12601269

12611270

1271+
def _list_legacy_adaptedservices():
1272+
# Code to get the CFG, and extract the legacy adapted services
1273+
# The Python 3 runit dir ends up in /diracos
1274+
for runit_dir in ["ServerInstallDIR/runit", "ServerInstallDIR/diracos/runit"]:
1275+
cmd = _build_docker_cmd("server")
1276+
cmd += [
1277+
"bash",
1278+
"-c",
1279+
f". $HOME/CONFIG && "
1280+
". $HOME/ServerInstallDIR/bashrc && "
1281+
"python $HOME/LocalRepo/TestCode/DIRAC/tests/Integration/dirac-cfg-get-legacy-adapted-services.py",
1282+
]
1283+
ret = subprocess.run(cmd, check=False, stdout=subprocess.PIPE, text=True)
1284+
if not ret.returncode:
1285+
return runit_dir, ret.stdout.split()
1286+
else:
1287+
typer.secho("Failed to find list of adapted services", err=True, fg=c.RED)
1288+
typer.secho(f"stdout was: {ret.stdout!r}", err=True)
1289+
typer.secho(f"stderr was: {ret.stderr!r}", err=True)
1290+
raise typer.Exit(1)
1291+
1292+
12621293
def _log_popen_stdout(p):
12631294
while p.poll() is None:
12641295
line = p.stdout.readline().rstrip()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from diraccfg import CFG
2+
3+
# Get the file
4+
cfg = CFG().loadFromFile("/home/dirac/ServerInstallDIR/etc/Production.cfg")
5+
6+
# Read it
7+
diracx = cfg.getAsDict("DiracX") or {}
8+
# Extract the legacy enabled clients
9+
legacy_enabled = diracx.get("LegacyClientEnabled", None)
10+
print(legacy_enabled)

0 commit comments

Comments
 (0)