Skip to content

Commit

Permalink
Merge pull request #232 from minijackson/phoebus-olog-ferretdb
Browse files Browse the repository at this point in the history
nixos/phoebus-olog: use FerretDB intead of MongoDB
  • Loading branch information
minijackson authored Jan 15, 2025
2 parents 61a4ad2 + af8f170 commit 2b01605
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
37 changes: 37 additions & 0 deletions docs/release-notes/2411.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,40 @@ Breaking changes
but if you used it by mistake,
make sure to include ``modbusSupport.dbd``,
and ``drvAsynIPPort.dbd`` or ``drvAsynSerialPort.dbd`` instead.

- :nix:option:`services.phoebus-olog` now uses FerretDB instead of MongoDB,
which prevents having to compile a resource intensive project
due to its license.
Migrate your data by following :ref:`mongodb-to-ferretdb`.

Detailed migration information
------------------------------

.. _mongodb-to-ferretdb:

From MongoDB to FerretDB
^^^^^^^^^^^^^^^^^^^^^^^^

Before upgrading to ``nixos-24.11``,
install the ``mongodb-tools`` package,
by adding it to your ``environment.systemPackages``.

On the target machine,
run:

.. code-block:: bash
mkdir mongodb-dump
cd mongodb-dump
mongodump
Then,
upgrade your system to ``nixos-24.11``.

On the target machine,
run:

.. code-block:: bash
cd mongodb-dump
mongorestore
7 changes: 5 additions & 2 deletions nixos/modules/phoebus/olog.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ in {
description = "Phoebus Alarm Server";

wantedBy = ["multi-user.target"];
after = ["elasticsearch.service" "mongodb.service"];
after = ["elasticsearch.service" "ferretdb.service"];

serviceConfig = {
ExecStart = "${lib.getExe pkgs.epnix.phoebus-olog} --spring.config.location=file://${configFile}";
DynamicUser = true;
# TODO: systemd hardening. Currently level 8.2 EXPOSED
};
};
services.mongodb.enable = true;
services.ferretdb = {
enable = true;
settings.FERRETDB_TELEMETRY = "disable";
};
};

meta.maintainers = with epnixLib.maintainers; [minijackson];
Expand Down
5 changes: 1 addition & 4 deletions nixos/tests/phoebus/olog.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
# not open-source. But as we're using it run tests, not exposing
# any service, this should be fine.
"elasticsearch"

# MongoDB also uses the SSPL.
"mongodb"
];

networking.firewall.allowedTCPPorts = [8181];
Expand Down Expand Up @@ -56,7 +53,7 @@
with subtest("Olog connected to ElasticSearch"):
assert status["elastic"]["status"] == "Connected"
with subtest("Olog connected to MongoDB"):
with subtest("Olog connected to MongoDB (FerretDB)"):
assert "state=CONNECTED" in status["mongoDB"]
def get(uri: str) -> Any:
Expand Down

0 comments on commit 2b01605

Please sign in to comment.