Skip to content

Commit

Permalink
Merge pull request #151 from epics-extensions/backport/141-to-nixos-2…
Browse files Browse the repository at this point in the history
…3.11

[Backport nixos-23.11] nixos/phoebus-alarm-logger: forward configuration to SpringBoot
  • Loading branch information
minijackson authored Sep 5, 2024
2 parents a3962b2 + fc6bf3c commit aca51c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 10 additions & 2 deletions nixos/modules/phoebus/alarm-logger.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,16 @@ in {

wantedBy = ["multi-user.target"];

# Weirdly not "phoebus.user"
environment.JAVA_OPTS = "-Djava.util.prefs.userRoot=/var/lib/phoebus-alarm-logger";
environment = {
# Weirdly not "phoebus.user"
JAVA_OPTS = "-Djava.util.prefs.userRoot=/var/lib/phoebus-alarm-logger";

# Our config file is both the config file for phoebus-alarm-logger,
# and for SpringBoot.
# The '-properties' command-line argument is only for phoebus-alarm-logger,
# *not* SpringBoot.
SPRING_CONFIG_IMPORT = configFile;
};

serviceConfig = {
ExecStart = let
Expand Down
6 changes: 4 additions & 2 deletions nixos/tests/phoebus/alarm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
};

server = {
config,
lib,
pkgs,
...
Expand All @@ -45,7 +44,10 @@
};
};

services.phoebus-alarm-logger.settings."bootstrap.servers" = kafkaListenSockAddr;
services.phoebus-alarm-logger.settings = {
"bootstrap.servers" = kafkaListenSockAddr;
"server.port" = 8082;
};

services.apache-kafka = {
enable = true;
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/phoebus/alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def wait_for_boot():
server.wait_for_unit("phoebus-alarm-logger.service")
server.wait_for_open_port(9092, "192.168.1.3")
server.wait_for_open_port(9200)
server.wait_for_open_port(8080)
server.wait_for_open_port(8082)

ioc.wait_for_unit("ioc.service")

Expand Down Expand Up @@ -47,7 +47,7 @@ def get_alarm() -> dict[str, Any]:


def get_logger(uri: str):
result_s = client.succeed(f"curl 'http://server:8080{uri}'")
result_s = client.succeed(f"curl 'http://server:8082{uri}'")
return json.loads(result_s)


Expand Down

0 comments on commit aca51c7

Please sign in to comment.