Skip to content

Commit

Permalink
still
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Aug 3, 2023
1 parent 75b9f48 commit 6cc4802
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 42 deletions.
13 changes: 11 additions & 2 deletions integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
"DIRACOSVER": "master",
"DIRACOS_TARBALL_PATH": None,
"TEST_HTTPS": "Yes",
"TEST_DIRACX": "No",
"DIRAC_FEWER_CFG_LOCKS": None,
"DIRAC_USE_JSON_ENCODE": None,
"INSTALLATION_BRANCH": "",
}
DEFAULT_MODULES = {"DIRAC": Path(__file__).parent.absolute(), "diracx": Path("/home/chaen/dirac/diracx-project/diracx")}
DIRACX_OPTIONS = ("DIRAC_ENABLE_DIRACX_JOB_MONITORING",)
DEFAULT_MODULES = {"DIRAC": Path(__file__).parent.absolute()}

# Static configuration
DB_USER = "Dirac"
Expand Down Expand Up @@ -191,7 +193,6 @@ def prepare_environment(
release_var: Optional[str] = None,
):
"""Prepare the local environment for installing DIRAC."""

_check_containers_running(is_up=False)
if editable is None:
editable = sys.stdout.isatty()
Expand Down Expand Up @@ -325,6 +326,8 @@ def install_server():
check=True,
)

# This runs a continuous loop that exports the config in yaml
# for the diracx container to use
typer.secho("Starting configuration export loop for diracx", fg=c.GREEN)
base_cmd = _build_docker_cmd("server", tty=False, daemon=True)
subprocess.run(
Expand Down Expand Up @@ -1017,6 +1020,12 @@ def _make_config(modules, flags, release_var, editable):
except KeyError:
typer.secho(f"Required feature variable {key!r} is missing", err=True, fg=c.RED)
raise typer.Exit(code=1)

# If we test DiracX, enable all the options
if config["TEST_DIRACX"].lower() in ("yes", "true"):
for key in DIRACX_OPTIONS:
config[key] = "Yes"

config["TESTREPO"] = [f"/home/dirac/LocalRepo/TestCode/{name}" for name in modules]
config["ALTERNATIVE_MODULES"] = [f"/home/dirac/LocalRepo/ALTERNATIVE_MODULES/{name}" for name in modules]

Expand Down
12 changes: 7 additions & 5 deletions src/DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
""" Class that contains client access to the job monitoring handler. """

import os
from DIRAC.Core.Base.Client import Client, createClient
from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning
from DIRAC.Core.Utilities.JEncode import strToIntDict

from DIRAC.WorkloadManagementSystem.FutureClient.JobMonitoringClient import (
JobMonitoringClient as futureJobMonitoringClient,
)


@createClient("WorkloadManagement/JobMonitoring")
class JobMonitoringClient(Client):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.setServer("WorkloadManagement/JobMonitoring")

httpsClient = futureJobMonitoringClient
if os.getenv("DIRAC_ENABLE_DIRACX_JOB_MONITORING", "No").lower() in ("yes", "true"):
from DIRAC.WorkloadManagementSystem.FutureClient.JobMonitoringClient import (
JobMonitoringClient as futureJobMonitoringClient,
)

httpsClient = futureJobMonitoringClient

@ignoreEncodeWarning
def getJobsStatus(self, jobIDs):
Expand Down
36 changes: 1 addition & 35 deletions tests/CI/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ services:
entrypoint: |
/dockerMicroMambaEntrypoint.sh ssh-keygen -P '' -trsa -b4096 -mPEM -f/signing-key/rs256.key
# diracx-init-empty-repo:
# image: gitlab-registry.cern.ch/chaen/chrissquare-hack-a-ton/diracx
# container_name: diracx-init-empty-repo
# environment:
# - DIRACX_CONFIG_BACKEND_URL="git+file:///cs_store/initialRepo"
# volumes:
# - diracx-cs-store:/cs_store/
# entrypoint: /dockerMicroMambaEntrypoint.sh
# command: mkdir -p /cs_store/initialRepo && cd /cs_store/initialRepo && git init



diracx-init-cs:
image: gitlab-registry.cern.ch/chaen/chrissquare-hack-a-ton/diracx
container_name: diracx-init-cs
Expand All @@ -125,28 +113,6 @@ services:
entrypoint: |
/dockerMicroMambaEntrypoint.sh dirac internal generate-cs /cs_store/initialRepo --vo=diracAdmin --user-group=admin --idp-url=http://dsdsd.csds/a/b
# diracx-init-cs-user:
# image: gitlab-registry.cern.ch/chaen/chrissquare-hack-a-ton/diracx
# container_name: diracx-init-cs-user
# depends_on:
# # dirac-server:
# # condition: service_healthy
# diracx-init-cs:
# condition: service_completed_successfully # Let the init container create the cs
# environment:
# - DIRACX_CONFIG_BACKEND_URL="git+file:///cs_store/initialRepo"
# - DIRACX_SERVICE_AUTH_TOKEN_KEY="file:///signing-key/rs256.key"
# volumes:
# - diracx-cs-store:/cs_store/
# - diracx-key-store:/signing-key/
# entrypoint: |
# /dockerMicroMambaEntrypoint.sh dirac internal add-user /cs_store/initialRepo --vo=diracAdmin --user-group=admin --sub=EgVsb2NhbA





diracx:
image: gitlab-registry.cern.ch/chaen/chrissquare-hack-a-ton/diracx
container_name: diracx
Expand All @@ -170,7 +136,7 @@ services:
# entrypoint: sleep 1000

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/.well-known/openid-configuration"]
test: ["CMD", "/dockerMicroMambaEntrypoint.sh", "curl", "-f", "http://localhost:8000/.well-known/openid-configuration"]
interval: 5s
timeout: 2s
retries: 15
Expand Down

0 comments on commit 6cc4802

Please sign in to comment.