nif ci fix complie in ci

This commit is contained in:
Graham McIntire 2026-01-30 12:47:18 -06:00
parent de1ad8bc8a
commit b663d484cf
5 changed files with 31 additions and 9 deletions

View file

@ -44,3 +44,8 @@ erl_crash.dump
/assets/node_modules/
/priv/static/assets/
/priv/static/cache_manifest.json
# Compiled NIF binaries - should be built in container for target architecture
/priv/*.so
/priv/*.dylib
/c_src/*.o

5
.gitignore vendored
View file

@ -60,3 +60,8 @@ profiles.json
# Application MIB files (now committed to git and included in Docker image)
# Only ignore the top-level librenms mibs directory (symlink)
# Compiled NIF binaries (platform-specific, should be built in Docker)
/priv/*.so
/priv/*.dylib
/c_src/*.o

View file

@ -28,7 +28,7 @@ ENV TERM=dumb
# install build dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential git \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential git libsnmp-dev \
&& rm -rf /var/lib/apt/lists/*
# prepare build dir
@ -63,6 +63,8 @@ RUN --mount=type=cache,target=/root/.mix \
COPY priv priv
COPY c_src c_src
COPY lib lib
# Compile the release
@ -84,7 +86,7 @@ RUN mix release
FROM ${RUNNER_IMAGE} AS final
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 locales ca-certificates iputils-ping snmp \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 locales ca-certificates iputils-ping snmp libsnmp40 \
&& rm -rf /var/lib/apt/lists/*
# Set the locale

View file

@ -5,6 +5,8 @@ defmodule Towerops.Profiles.ProfileWatcher do
Uses FileSystem to monitor the priv/profiles directory for file changes.
When a .yaml or .yml file is created, modified, or deleted, triggers
a reload of all profiles via YamlProfiles.reload/0.
Note: Only available in development mode. FileSystem is a dev-only dependency.
"""
use GenServer
@ -20,16 +22,24 @@ defmodule Towerops.Profiles.ProfileWatcher do
@impl true
def init(_opts) do
# Get the absolute path to the profiles directory
profiles_path = Path.join(Application.app_dir(:towerops), @profiles_dir)
# Only start file watcher in development
# FileSystem is a dev-only dependency
if Code.ensure_loaded?(FileSystem) do
# Get the absolute path to the profiles directory
profiles_path = Path.join(Application.app_dir(:towerops), @profiles_dir)
# Start watching the profiles directory for changes
{:ok, watcher_pid} = FileSystem.start_link(dirs: [profiles_path])
FileSystem.subscribe(watcher_pid)
# Start watching the profiles directory for changes
{:ok, watcher_pid} = FileSystem.start_link(dirs: [profiles_path])
FileSystem.subscribe(watcher_pid)
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
else
# In production, FileSystem is not available
Logger.debug("ProfileWatcher: FileSystem not available, running in no-op mode")
{:ok, %{}}
end
end
@impl true

Binary file not shown.