Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archiver-appliance: 1.1.0 -> 2.0.5 #249

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/nixos-services/tutorials/archiver-appliance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ enabling you to go back to a previous configuration.

You have now configured Archiver Appliance on NixOS.

.. _Archiver Appliance Details: https://slacmshankar.github.io/epicsarchiver_docs/details.html
.. _various tables: https://github.com/slacmshankar/epicsarchiverap/blob/master/src/main/org/epics/archiverappliance/config/persistence/archappl_mysql.sql
.. _Archiver Appliance Details: https://epicsarchiver.readthedocs.io/en/stable/developer/details.html#architecture
.. _various tables: https://github.com/archiver-appliance/epicsarchiverap/blob/master/src/main/org/epics/archiverappliance/config/persistence/archappl_mysql.sql

Next steps
----------
Expand Down
17 changes: 17 additions & 0 deletions docs/release-notes/2505.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
25.05 Release notes
===================

.. default-domain:: nix

.. role:: nix(code)
:language: nix

Highlights
----------

- Archiver Appliance was upgrade from 1.1.0 -> 2.0.5,
see the `Archiver Appliance 2.0.5 release notes`_.
None of the breaking change should affect users of the
:option:`services.archiver-appliance` NixOS options.

.. _Archiver Appliance 2.0.5 release notes: https://github.com/archiver-appliance/epicsarchiverap/releases/tag/2.0.5
22 changes: 15 additions & 7 deletions nixos/modules/archiver-appliance.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@
.handlers = java.util.logging.ConsoleHandler
'';

log4jProperties = pkgs.writeTextDir "/log4j.properties" ''
log4j.rootLogger = ERROR, stdout
log4j.logger.config.org.epics.archiverappliance = INFO
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
log4j2Xml = pkgs.writeTextDir "/log4j2.xml" ''
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%p %m (%c)%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.apache.log4j.xml" level="info"/>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
'';
in {
options.services.archiver-appliance = {
Expand Down Expand Up @@ -284,7 +292,7 @@ in {
];

commonLibs = [
"${log4jProperties}/log4j.properties"
"${log4j2Xml}/log4j2.xml"

# We use the mariadb connecter, since it supports UNIX socket connection,
# which allows us not not store the password in plaintext in the config.
Expand Down
4 changes: 3 additions & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ in

# EPICS related tools and extensions

archiver-appliance = callPackage ./epnix/tools/archiver-appliance {};
archiver-appliance = callPackage ./epnix/tools/archiver-appliance {
jdk = prev.jdk17;
};

ca-gateway = callPackage ./epnix/tools/ca-gateway {};

Expand Down
60 changes: 38 additions & 22 deletions pkgs/epnix/tools/archiver-appliance/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
stdenvNoCC,
lib,
epnix,
epnixLib,
fetchFromGitHub,
jdk,
ant,
dos2unix,
gradle,
sphinx,
tomcat9,
python3Packages,
python3,
}:
stdenvNoCC.mkDerivation (self: {
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "archiver-appliance";
version = "1.1.0";
version = "2.0.5";

src = fetchFromGitHub {
owner = "archiver-appliance";
repo = "epicsarchiverap";
rev = self.version;
rev = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-ezsjqp23BMLpqA6cdd6k0wXhAR1imOm0tyWJUaSWmiA=>";
hash = "sha256-X1q87+3QZaNv4bY9UjTEEr0Jrv9AEIezhygI9jgNay0=";
};

patches = [
Expand All @@ -27,41 +29,50 @@ stdenvNoCC.mkDerivation (self: {

# Messes up the shebang auto-patching
./fix-policies-shebang.patch

./fix-docs-build-script.patch
];

nativeBuildInputs = [jdk ant dos2unix];
nativeBuildInputs = [
jdk
gradle
sphinx
python3Packages.myst-parser
python3Packages.sphinx-rtd-theme
];
buildInputs = [python3];

TOMCAT_HOME = "${tomcat9}";
gradleFlags = [
"-PprojVersion=${finalAttrs.version}"
"-Dorg.gradle.java.home=${jdk}"
];

buildPhase = ''
runHook preBuild
# Update by running `nix build .#archiver-appliance.mitmCache.updateScript && ./result`
mitmCache = gradle.fetchDeps {
pkg = epnix.archiver-appliance;
data = ./deps.json;
};

ant
# Some PV tests fail
#doCheck = true;

runHook postBuild
'';
TOMCAT_HOME = "${tomcat9}";

installPhase = ''
runHook preInstall

install -Dt $out/webapps ../retrieval.war ../engine.war ../etl.war ../mgmt.war
install -Dt $out/share/doc/archappl LICENSE NOTICE
cp -R docs $out/share/doc/archappl
install -Dt $out/webapps build/libs/{retrieval,engine,etl,mgmt}.war
install --mode=644 -Dt $out/share/doc/archappl LICENSE NOTICE

install -Dt $out/share/archappl/sql src/main/org/epics/archiverappliance/config/persistence/*.sql
install --mode=644 -Dt $out/share/archappl/sql src/main/org/epics/archiverappliance/config/persistence/*.sql
install -Dt $out/share/archappl/ src/sitespecific/tests/classpathfiles/policies.py
# DOS-style line-ending messes up shebang auto-patching
dos2unix $out/share/archappl/policies.py

install -Dt $out ../archappl*.tar.gz

runHook postInstall
'';

meta = {
description = "Implementation of an archiver for EPICS control systems that aims to archive millions of PVs";
homepage = "https://slacmshankar.github.io/epicsarchiver_docs/index.html";
homepage = "https://epicsarchiver.readthedocs.io/en/stable/";
license = with lib.licenses;
with epnixLib.licenses; [
epics
Expand All @@ -75,5 +86,10 @@ stdenvNoCC.mkDerivation (self: {
];
maintainers = with epnixLib.maintainers; [minijackson];
inherit (jdk.meta) platforms;
sourceProvenance = with lib.sourceTypes; [
fromSource
# gradle dependencies
binaryBytecode
];
};
})
Loading
Loading