Skip to content

Commit

Permalink
Merge branch 'tickets/DM-43282'
Browse files Browse the repository at this point in the history
  • Loading branch information
iagaponenko committed May 10, 2024
2 parents 5e37279 + 4693d00 commit 5d27f05
Show file tree
Hide file tree
Showing 41 changed files with 1,889 additions and 128 deletions.
2 changes: 1 addition & 1 deletion admin/local/docker/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ services:
expose:
- "4048"
ports:
- "0.0.0.0:4048:4048"
- "0.0.0.0:${QSERV_HTTP_FRONTEND_PORT:-4048}:4048"
repl_mariadb:
image: "${QSERV_MARIADB_IMAGE:?err}"
init: true
Expand Down
6 changes: 6 additions & 0 deletions src/admin/python/lsst/qserv/admin/qservCli/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from .opt import (
env_dashboard_port,
env_http_frontend_port,
env_mariadb_image,
env_qserv_image,
env_dh_user,
Expand Down Expand Up @@ -1462,6 +1463,7 @@ def up(
qserv_image: str,
mariadb_image: str,
dashboard_port: Optional[int],
http_frontend_port: Optional[int],
) -> None:
"""Send docker-compose up and down commands.
Expand All @@ -1479,6 +1481,8 @@ def up(
The name of the mariadb image to use.
dashboard_port : `int` or `None`
The host port to use for the qserv dashboard.
http_frontend_port : `int` or `None`
The host port to use for the qserv HTTP frontend.
"""
args = ["docker-compose", "-f", yaml_file]
if project:
Expand All @@ -1490,6 +1494,8 @@ def up(
}
if dashboard_port:
env_override[env_dashboard_port.env_var] = str(dashboard_port)
if http_frontend_port:
env_override[env_http_frontend_port.env_var] = str(http_frontend_port)
if dry:
env_str = " ".join([f"{k}={v}" for k, v in env_override.items()])
print(f"{env_str} {' '.join(args)}")
Expand Down
12 changes: 11 additions & 1 deletion src/admin/python/lsst/qserv/admin/qservCli/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ def dockerfiles(self) -> Optional[List[str]]:
env_qserv_build_root = FlagEnvVal("--qserv-build-root", "QSERV_BUILD_ROOT", "/home/{user}/code/qserv")
env_project = FlagEnvVal("--project", "QSERV_PROJECT", getpass.getuser())
env_outdir = FlagEnvVal("--outdir", "OUTDIR", "/tmp")
env_dashboard_port = FlagEnvVal("--dashboard-port", "QSERV_DASHBOARD_PORT", None)
env_dashboard_port = FlagEnvVal("--dashboard-port", "QSERV_DASHBOARD_PORT", "25081")
env_http_frontend_port = FlagEnvVal("--http-frontend-port", "QSERV_HTTP_FRONTEND_PORT", "4048")
env_dh_user = EnvVal("QSERV_DH_USER", "CI only; the dockerhub user for pushing and pulling images")
env_dh_token = EnvVal(
"QSERV_DH_TOKEN",
Expand Down Expand Up @@ -533,6 +534,7 @@ def describe(self) -> str:
env_qserv_build_root,
env_project,
env_dashboard_port,
env_http_frontend_port,
env_dh_user,
env_dh_token,
env_ltd_user,
Expand Down Expand Up @@ -665,6 +667,14 @@ def describe(self) -> str:
)


option_http_frontend_port = partial(
click.option,
env_http_frontend_port.opt,
help=env_http_frontend_port.help("The host port to use for the qserv HTTP frontend."),
default=env_http_frontend_port.val(),
)


option_unit_test = partial(
click.option,
"--unit-test/--no-unit-test",
Expand Down
4 changes: 4 additions & 0 deletions src/admin/python/lsst/qserv/admin/qservCli/qserv_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
option_cmake,
option_compose_file,
option_dashboard_port,
option_http_frontend_port,
option_debuggable,
env_dh_user,
env_dh_token,
Expand Down Expand Up @@ -744,6 +745,7 @@ def update_schema(
@option_compose_file()
@option_project()
@option_dashboard_port()
@option_http_frontend_port()
@option_dry()
def up(
yaml_file: str,
Expand All @@ -752,6 +754,7 @@ def up(
qserv_image: str,
mariadb_image: str,
dashboard_port: int,
http_frontend_port: int,
) -> None:
"""Launch a docker compose cluster."""
launch.up(
Expand All @@ -761,6 +764,7 @@ def up(
qserv_image=qserv_image,
mariadb_image=mariadb_image,
dashboard_port=dashboard_port,
http_frontend_port=http_frontend_port,
)


Expand Down
2 changes: 1 addition & 1 deletion src/admin/python/lsst/qserv/admin/replicationInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __init__(
self.repl_ctrl = urlparse(repl_ctrl_uri)
self.auth_key = auth_key
self.admin_auth_key = admin_auth_key
self.repl_api_version = 33
self.repl_api_version = 34
_log.debug(f"ReplicationInterface %s", self.repl_ctrl)

def version(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions src/czar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_library(czar OBJECT)

target_sources(czar PRIVATE
Czar.cc
HttpCzarIngestModule.cc
HttpCzarSvc.cc
HttpCzarQueryModule.cc
HttpModule.cc
Expand Down
4 changes: 3 additions & 1 deletion src/czar/Czar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "czar/MessageTable.h"
#include "global/LogContext.h"
#include "http/Client.h"
#include "http/MetaModule.h"
#include "http/Method.h"
#include "proto/worker.pb.h"
#include "qdisp/CzarStats.h"
Expand Down Expand Up @@ -97,7 +98,8 @@ void registryUpdateLoop(shared_ptr<cconfig::CzarConfig> const& czarConfig) {
string const url = "http://" + czarConfig->replicationRegistryHost() + ":" +
to_string(czarConfig->replicationRegistryPort()) + "/czar";
vector<string> const headers = {"Content-Type: application/json"};
json const request = json::object({{"instance_id", czarConfig->replicationInstanceId()},
json const request = json::object({{"version", http::MetaModule::version},
{"instance_id", czarConfig->replicationInstanceId()},
{"auth_key", czarConfig->replicationAuthKey()},
{"czar",
{{"name", czarConfig->name()},
Expand Down
Loading

0 comments on commit 5d27f05

Please sign in to comment.