Skip to content

Commit 520bfb9

Browse files
authored
Merge pull request #8496 from maxnoe/fix-egg-install
fix(tests): Replace removed egg syntax for installing client in CI
2 parents 107503c + a8b735e commit 520bfb9

File tree

4 files changed

+50
-16
lines changed

4 files changed

+50
-16
lines changed

docs/source/AdministratorGuide/HowTo/SystemAdministratorInterface.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ A version can be:
256256

257257
* a PEP440 valid version of DIRAC.
258258
* a PEP440 valid version of a DIRAC extension.
259-
* "integration" or "devel" or "master" or "main" would all be interpreted as git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=DIRAC[server]
260-
* a git tag/branch like git+https://github.com/fstagni/DIRAC.git@test_branch#egg=DIRAC[server]
259+
* "integration" or "devel" or "master" or "main" would all be interpreted as ``DIRAC[server] @ git+https://github.com/DIRACGrid/DIRAC.git@integration``
260+
* a dependency link pointing to a git tag/branch like ``DIRAC[server] @ git+https://github.com/fstagni/DIRAC.git@test_branch``
261261

262262
Usage::
263263

@@ -267,4 +267,4 @@ For example::
267267

268268
update 9.0.18
269269
update integration
270-
update git+https://github.com/fstagni/DIRAC.git@test_branch#egg=DIRAC[server]
270+
update 'DIRAC[server] @ git+https://github.com/fstagni/DIRAC.git@test_branch'

integration_tests.py

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,38 @@ def prepare_environment(
278278

279279
typer.secho("Running docker compose to create containers", fg=c.GREEN)
280280
with _gen_docker_compose(modules, diracx_src_dir=diracx_src_dir) as docker_compose_fn:
281-
subprocess.run(
282-
[*DOCKER_COMPOSE_CMD, "-f", docker_compose_fn, "up", "-d", "dirac-server", "dirac-client", "dirac-pilot"]
283-
+ extra_services,
284-
check=True,
285-
env=docker_compose_env,
286-
)
281+
try:
282+
subprocess.run(
283+
[
284+
*DOCKER_COMPOSE_CMD,
285+
"-f",
286+
docker_compose_fn,
287+
"up",
288+
"-d",
289+
"dirac-server",
290+
"dirac-client",
291+
"dirac-pilot",
292+
]
293+
+ extra_services,
294+
check=True,
295+
env=docker_compose_env,
296+
)
297+
except subprocess.CalledProcessError:
298+
typer.secho(
299+
"docker compose up failed, dumping container logs for diagnosis",
300+
fg=c.RED,
301+
)
302+
subprocess.run(
303+
[*DOCKER_COMPOSE_CMD, "-f", docker_compose_fn, "ps", "-a"],
304+
check=False,
305+
env=docker_compose_env,
306+
)
307+
subprocess.run(
308+
[*DOCKER_COMPOSE_CMD, "-f", docker_compose_fn, "logs", "--no-color"],
309+
check=False,
310+
env=docker_compose_env,
311+
)
312+
raise
287313

288314
typer.secho("Creating users in server client and pilot containers", fg=c.GREEN)
289315
for container_name in ["server", "client", "pilot"]:

src/DIRAC/FrameworkSystem/Service/SystemAdministratorHandler.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ def export_updateSoftware(self, version):
259259
A version can be:
260260
- a PEP440 valid version of DIRAC.
261261
- a PEP440 valid version of a DIRAC extension.
262-
- "integration" or "devel" or "master" or "main" would all be interpreted as git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=DIRAC[server]
263-
- a git tag/branch like git+https://github.com/fstagni/DIRAC.git@test_branch#egg=DIRAC[server]
262+
- "integration" or "devel" or "master" or "main" would all be interpreted as "DIRAC[server] @ git+https://github.com/DIRACGrid/DIRAC.git@integration"
263+
- a git tag/branch like "DIRAC[server] @ git+https://github.com/fstagni/DIRAC.git@test_branch"
264264
"""
265265
# Validate and normalise the requested version
266266
primaryExtension = None
@@ -273,7 +273,7 @@ def export_updateSoftware(self, version):
273273
# Special cases (e.g. installing the integration/main branch)
274274
if version.lower() in ["integration", "devel", "master", "main"]:
275275
released_version = False
276-
version = "git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=DIRAC[server]"
276+
version = "DIRAC[server] @ git+https://github.com/DIRACGrid/DIRAC.git@integration"
277277

278278
if released_version:
279279
try:
@@ -340,8 +340,15 @@ def export_updateSoftware(self, version):
340340
else:
341341
# from here on we assume a version like git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=DIRAC[server]
342342
# is specified, for the primaryExtension
343-
if not version.startswith("git+"):
344-
version = f"git+{version}"
343+
if "#egg=" in version:
344+
if not version.startswith("git+"):
345+
version = f"git+{version}"
346+
347+
# pip removed support for egg= syntax, convert to current syntax but warn
348+
url, _, spec = version.rpartition("#egg=")
349+
version = f"{spec} @ {url}"
350+
self.log.warn("The #egg= syntax has been removed from pip, using:", version)
351+
345352
cmd += [version]
346353

347354
cmd += [f"{e}[server]" for e in otherExtensions]

tests/Jenkins/utilities.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ installDIRAC() {
297297

298298
if [[ -n "${INSTALLATION_BRANCH}" ]]; then
299299
# Use this for (e.g.) running backward-compatibility tests
300-
echo "pip-installing DIRAC from git+https://github.com/DIRACGrid/DIRAC.git@${INSTALLATION_BRANCH}#egg=DIRAC[client]"
301-
pip install "git+https://github.com/DIRACGrid/DIRAC.git@${INSTALLATION_BRANCH}#egg=DIRAC[client]"
300+
dirac_spec="DIRAC[client] @ git+https://github.com/DIRACGrid/DIRAC.git@${INSTALLATION_BRANCH}"
301+
echo "pip-installing DIRAC from $dirac_spec"
302+
pip install "$dirac_spec"
302303
else
303304
for module_path in "${ALTERNATIVE_MODULES[@]}"; do
304305
# Special handling for DIRAC with DIRACCommon subdirectory

0 commit comments

Comments
 (0)