Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c86f470
NiFi chart volume changes.
vladd-bit Dec 3, 2026
0cf6c29
Merge branch 'main' of https://github.com/CogStack/cogstack-platform …
vladd-bit Dec 3, 2026
3c1d608
Merge branch 'main' of https://github.com/CogStack/cogstack-platform …
vladd-bit Dec 3, 2026
ebdd703
Charts: NiFi chart updated replicaCount logic.
vladd-bit Dec 3, 2026
d855b88
NiFi: updated to v2.13.0.
vladd-bit Dec 3, 2026
2e549cd
NiFi: compose + Makefile updates.
vladd-bit Dec 3, 2026
ba9b61f
Merge branch 'main' of https://github.com/CogStack/cogstack-platform …
vladd-bit Dec 3, 2026
0f90cca
Merge branch 'main' into nifi_chart_updates
vladd-bit Dec 3, 2026
7c92e0e
Merge branch 'nifi_chart_updates' of https://github.com/CogStack/cogs…
vladd-bit Dec 3, 2026
0157305
NiFi docker image improvements.
vladd-bit Dec 3, 2026
551a407
NiFi: updated nifi.env.
vladd-bit Dec 3, 2026
5737362
NiFi docker image update, removed redudant symlinks....
vladd-bit Dec 3, 2026
f5383c5
NiFi dockerfile update + helm service update.
vladd-bit Dec 3, 2026
614aa63
NiFi : added custom entrypoint.
vladd-bit Dec 3, 2026
99a6316
NiFi: updated entrypoint for k8s.
vladd-bit Dec 3, 2026
9ef65f5
NiFi: simplified stateful set logic.
vladd-bit Dec 4, 2026
660de5f
NiFi: updated statefulset.
vladd-bit Dec 4, 2026
40f6417
NiFi Updated chart.
vladd-bit Dec 4, 2026
2d5de59
Nginx chart update.
vladd-bit Dec 4, 2026
638ba8e
NiFi + nginx conf udpates.
vladd-bit Dec 4, 2026
a77b1c1
Makefile command updates.
vladd-bit Dec 4, 2026
2767b33
Makefile updates.
vladd-bit Dec 4, 2026
2630273
Deployment makefile cert commands makefile revision.
vladd-bit Dec 4, 2026
810797a
Makefile updates.
vladd-bit Dec 4, 2026
f33dfed
Makefile updates.
vladd-bit Dec 4, 2026
d99b42f
Makefile updates.
vladd-bit Dec 4, 2026
1be6a0d
Makefile updates.
vladd-bit Dec 4, 2026
b24f3c1
Merge branch 'main' into nifi_chart_updates
vladd-bit Dec 4, 2026
d34262d
Makefile updates II.
vladd-bit Dec 4, 2026
4556623
Deployment makefile updates.
vladd-bit Dec 4, 2026
7a72821
Merge branch 'main' of https://github.com/CogStack/cogstack-platform …
vladd-bit Dec 4, 2026
e00c6cb
Merge branch 'nifi_chart_updates' of https://github.com/CogStack/cogs…
vladd-bit Dec 4, 2026
e02a6bb
Makefile update.
vladd-bit Dec 4, 2026
5cede2a
NiFi auth smoke test fix.
vladd-bit Dec 5, 2026
8c80b9b
Script simplifications.
vladd-bit Dec 5, 2026
9ef606a
Updated values.env.yaml for services.
vladd-bit Dec 5, 2026
34e5147
NiFi env updates.
vladd-bit Dec 5, 2026
c877788
Merge branch 'main' of https://github.com/CogStack/cogstack-platform …
vladd-bit Dec 5, 2026
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
7 changes: 4 additions & 3 deletions .github/workflows/helm_smoke_logins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- 'deployment/scripts/security/**'
- 'deployment/security/templates/**'
- 'apps/opensearch/**'
- '.github/scripts/smoke_nifi_login.sh'
- '.github/workflows/helm_smoke_logins.yml'
pull_request:
paths: *paths
Expand Down Expand Up @@ -95,7 +96,7 @@ jobs:
type: ClusterIP
YAML

- name: NGINX Helm proxy login
- name: NiFi login through NGINX
if: matrix.stack == 'nifi' || matrix.stack == 'nginx'
run: |
kubectl port-forward svc/cogstack-nginx 8443:443 &
Expand All @@ -104,8 +105,8 @@ jobs:
--retry 12 --retry-all-errors --retry-delay 2 --max-time 10)
api=https://127.0.0.1:8443/nifi-api/flow/current-user
[[ $("${request[@]}" -o /dev/null -w '%{http_code}' "$api") == 401 ]]
"${request[@]}" -f -u "$SINGLE_USER_CREDENTIALS_USERNAME:$SMOKE_PASSWORD" "$api" |
jq -e '.anonymous == true'
SINGLE_USER_CREDENTIALS_PASSWORD="$SMOKE_PASSWORD" \
bash .github/scripts/smoke_nifi_login.sh https://127.0.0.1:8443

- name: OpenSearch and Dashboards through NGINX
if: matrix.stack == 'opensearch'
Expand Down
81 changes: 47 additions & 34 deletions apps/nifi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# syntax=docker/dockerfile:1
ARG NIFI_BASE_IMAGE=apache/nifi:2.12.0@sha256:6f7f2840dbf178c6dd3fa13435b9b358f3be3c6fb7417de467a35a267f4d28ad
ARG NIFI_BASE_IMAGE=apache/nifi:2.13.0@sha256:bc4f695c6ae29c51b68062a16463fb4f6c93ccac8609e774d5097af0be034672

FROM ${NIFI_BASE_IMAGE}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG NIFI_VERSION=2.12.0
# Match the downloaded NARs to the Apache NiFi version in NIFI_BASE_IMAGE.
ARG NIFI_VERSION=2.13.0
ARG GROOVY_VERSION=5.1.0

ARG HTTP_PROXY=""
Expand All @@ -16,6 +17,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG TZ="Europe/London"

ENV TZ=${TZ}
# Make the bundled Python dependencies and CogStack modules available to processors.
ENV PYTHONPATH=${NIFI_HOME}/python/framework

# python stuff
Expand All @@ -25,6 +27,7 @@ ENV PIP_NO_CACHE_DIR=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1


USER root

# Install system dependencies using the repositories provided by the base image.
Expand All @@ -39,11 +42,11 @@ RUN set -eux; \
git \
iputils-ping \
jq \
libpq-dev \
libsqlite3-dev \
libssl-dev \
make \
openssl \
postgresql-server-dev-all \
python3.11 \
python3.11-dev \
python3-dev \
Expand All @@ -58,17 +61,10 @@ RUN set -eux; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# install rust, medcat requirement, install UV
# Install uv as root.
ENV HOME=/root
ENV PATH="/root/.cargo/bin:${PATH}"
ENV UV_INSTALL_DIR=/usr/local/bin

RUN set -eux; \
curl -sSf https://sh.rustup.rs -o /tmp/rustup-init.sh; \
chmod +x /tmp/rustup-init.sh; \
/tmp/rustup-init.sh -y; \
rm /tmp/rustup-init.sh

# Install the exact or minimum uv version required by the repository.
COPY pyproject.toml /tmp/cogstack_nifi/pyproject.toml
RUN set -eux; \
Expand All @@ -82,9 +78,17 @@ RUN set -eux; \

RUN uv pip install --no-cache-dir --break-system-packages --system --upgrade pip setuptools wheel

# Install the locked runtime dependencies used by NiFi scripts and extensions.
# Install locked runtime dependencies before copying CogStack sources so code
# changes can reuse the dependency layer.
# Keep Rust available for source builds and remove it in the same layer.
COPY uv.lock /tmp/cogstack_nifi/uv.lock
RUN uv export \
RUN set -eux; \
rust_toolchain="$(mktemp -d)"; \
export CARGO_HOME="$rust_toolchain/cargo" RUSTUP_HOME="$rust_toolchain/rustup"; \
export PATH="$CARGO_HOME/bin:$PATH"; \
curl -fsSL https://sh.rustup.rs -o "$rust_toolchain/install.sh"; \
sh "$rust_toolchain/install.sh" -y --profile minimal --no-modify-path; \
uv export \
--project /tmp/cogstack_nifi \
--frozen \
--no-dev \
Expand All @@ -96,7 +100,8 @@ RUN uv export \
--break-system-packages \
--target=${NIFI_HOME}/python/framework \
-r /tmp/cogstack_nifi/requirements.txt \
--index-url https://pypi.org/simple
--index-url https://pypi.org/simple \
&& rm -rf "$rust_toolchain"

#######################################################################################################

Expand All @@ -108,8 +113,8 @@ ENV JAVA_OPTS="-Dhttp.proxyHost=${HTTP_PROXY} -Dhttps.proxyHost=${HTTPS_PROXY} -
WORKDIR /opt/nifi/groovy

RUN set -eux; \
url1="https://archive.apache.org/dist/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip"; \
url2="https://repo.maven.apache.org/maven2/org/apache/groovy/apache-groovy-binary/${GROOVY_VERSION}/apache-groovy-binary-${GROOVY_VERSION}.zip"; \
url1="https://repo.maven.apache.org/maven2/org/apache/groovy/groovy-binary/${GROOVY_VERSION}/groovy-binary-${GROOVY_VERSION}.zip"; \
url2="https://archive.apache.org/dist/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip"; \
curl -fsSL --retry 8 --retry-delay 3 --connect-timeout 20 -o groovy.zip "$url1" \
|| curl -fsSL --retry 8 --retry-delay 3 --connect-timeout 20 -o groovy.zip "$url2"; \
unzip groovy.zip; rm groovy.zip
Expand Down Expand Up @@ -159,34 +164,38 @@ RUN set -eu; \

########################################################################################################

# Baseline resources work without a repository checkout. Processor directories
# can still be overridden by writable, deployment-owned volumes.
COPY __init__.py /tmp/cogstack_nifi/__init__.py
COPY user_scripts /tmp/cogstack_nifi/user_scripts
COPY user_python_extensions /tmp/cogstack_nifi/user_python_extensions
RUN uv pip install --no-cache-dir --break-system-packages --no-deps \
--target=${NIFI_HOME}/python/framework /tmp/cogstack_nifi

ARG NIFI_UID=1000
ARG NIFI_GID=1000

# Establish the nifi Python package on the framework's import path.
COPY --chown=${NIFI_UID}:${NIFI_GID} __init__.py ${NIFI_HOME}/python/framework/nifi/__init__.py

# Use the resource paths referenced by flows. NiFi discovers native Python
# processors in its python_extensions directory.
COPY --chown=${NIFI_UID}:${NIFI_GID} drivers /opt/nifi/drivers
COPY --chown=${NIFI_UID}:${NIFI_GID} user_schemas /opt/nifi/user_schemas
COPY --chown=${NIFI_UID}:${NIFI_GID} user_templates /opt/nifi/user_templates
COPY --chown=${NIFI_UID}:${NIFI_GID} user_scripts /opt/nifi/user_scripts
COPY --chown=${NIFI_UID}:${NIFI_GID} user_python_extensions /opt/nifi/nifi-current/python_extensions
COPY --chmod=755 docker/healthcheck.sh /opt/nifi/scripts/cogstack-healthcheck.sh

# Keep Apache's configuration defaults and startup script. Deployment credentials
# and mutable configuration from the checkout never enter the image.
# Tune Apache's default configuration to reload TLS stores and give active
# processors time to stop. Supply deployment credentials and configuration at runtime.
RUN sed -i \
-e 's|^nifi.security.autoreload.enabled=.*|nifi.security.autoreload.enabled=true|' \
-e 's|^nifi.flowcontroller.graceful.shutdown.period=.*|nifi.flowcontroller.graceful.shutdown.period=30 sec|' \
"${NIFI_HOME}/conf/nifi.properties" \
&& sed -i 's|^graceful.shutdown.seconds=.*|graceful.shutdown.seconds=60|' "${NIFI_HOME}/conf/bootstrap.conf" \
&& cp -a "${NIFI_HOME}/conf" /tmp/cogstack_nifi/conf
&& sed -i 's|^graceful.shutdown.seconds=.*|graceful.shutdown.seconds=60|' "${NIFI_HOME}/conf/bootstrap.conf"


# Apache ships owner-only executables; remap them only for custom UID builds.
# We keep a copy of the image conf folder because we use it later in Helm to copy contents directly to the PVC
# rather than doing the weird trick where we create a init container to copy contents, no more initContainer needed :)
RUN cp -a "${NIFI_HOME}/conf" /tmp/cogstack_nifi/conf && chown -R "${NIFI_UID}:${NIFI_GID}" /tmp/cogstack_nifi/conf

# Remap Apache's NiFi account for custom UID/GID builds. The owner-only
# executables must follow the account when its UID changes.
# Point nifi.user_scripts at /opt/nifi/user_scripts so imports use the same
# files as the Compose development bind mount.
RUN set -eux; \
if [ "$(id -g nifi)" != "${NIFI_GID}" ]; then groupmod -o -g "${NIFI_GID}" nifi; fi; \
if [ "$(id -u nifi)" != "${NIFI_UID}" ]; then \
Expand All @@ -196,23 +205,27 @@ RUN set -eux; \
mkdir -p "${NIFI_HOME}/run" "${NIFI_HOME}/work/python" \
"${NIFI_HOME}/logs/user_scripts" "${NIFI_HOME}/state/user_scripts/db" \
/opt/nifi/pipeline/flowfile-errors /data /opt/models; \
rm -rf "${NIFI_HOME}/python/framework/nifi/user_scripts"; \
ln -s /opt/nifi/user_scripts "${NIFI_HOME}/python/framework/nifi/user_scripts"; \
ln -s /opt/nifi/drivers /tmp/cogstack_nifi/drivers; \
ln -s /opt/nifi/user_schemas /tmp/cogstack_nifi/user_schemas; \
ln -s /opt/nifi/user_templates /tmp/cogstack_nifi/user_templates; \
ln -sT /opt/nifi/user_scripts "${NIFI_HOME}/python/framework/nifi/user_scripts"; \
chown -R "${NIFI_UID}:${NIFI_GID}" \
"${NIFI_HOME}"/{conf,logs,run,work,database_repository,flowfile_repository,content_repository,provenance_repository,state,nar_extensions,python_extensions} \
/home/nifi /opt/nifi/pipeline/flowfile-errors /data /opt/models

COPY --chmod=755 docker/entrypoint.sh /opt/nifi/scripts/cogstack-entrypoint.sh


ENV COGSTACK_NIFI_MODE=docker
ENV HOME=/home/nifi
ENV NIFI_WEB_HTTPS_HOST="0.0.0.0"
ENV PATH=/usr/local/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
ENV UV_CACHE_DIR=/opt/nifi/nifi-current/work/python/uv-cache
ENV PYTHONPYCACHEPREFIX=/opt/nifi/nifi-current/work/python/pycache
ENV NIFI_USER_SCRIPT_LOGS_DIR=/opt/nifi/nifi-current/logs/user_scripts
ENV NIFI_USER_SCRIPT_DB_DIR=/opt/nifi/nifi-current/state/user_scripts/db

WORKDIR /opt/nifi/nifi-current
USER ${NIFI_UID}:${NIFI_GID}

HEALTHCHECK --interval=30s --timeout=10s --start-period=300s --retries=3 \
CMD ["/opt/nifi/scripts/cogstack-healthcheck.sh", "ready"]

ENTRYPOINT ["/opt/nifi/scripts/cogstack-entrypoint.sh"]
24 changes: 13 additions & 11 deletions apps/nifi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Preserve `NIFI_SENSITIVE_PROPS_KEY` with the flow configuration so NiFi can
decrypt saved sensitive properties. For a non-local deployment, set
`NIFI_WEB_PROXY_HOST` to the browser-facing host and port. If you change
`NIFI_EXTERNAL_PORT_NGINX`, update that allowlist entry as well. See
[Apache's startup script](https://github.com/apache/nifi/blob/rel/nifi-2.12.0/nifi-docker/dockerhub/sh/start.sh)
and [Docker setup guide](https://github.com/apache/nifi/blob/rel/nifi-2.12.0/nifi-docker/dockerhub/README.md)
[Apache's startup script](https://github.com/apache/nifi/blob/rel/nifi-2.13.0/nifi-docker/dockerhub/sh/start.sh)
and [Docker setup guide](https://github.com/apache/nifi/blob/rel/nifi-2.13.0/nifi-docker/dockerhub/README.md)
for additional settings.

### TLS certificates
Expand Down Expand Up @@ -88,10 +88,10 @@ Run these commands from `apps/nifi/docker/`:
| Command | Configuration |
| --- | --- |
| `make check-config` | Resolve and validate all three Compose configurations using the env files. |
| `make start-nifi` | Use `docker-compose.yml` to start published images with a Compose-managed `cogstack-net`. |
| `make start-nifi-dev` | Start NiFi and NGINX with the dev settings. |
| `make start-nifi-dev-build` | Apply `docker-compose.dev.yml` over the base, build both images locally, mount editable NiFi resources and dev data, and use `nifi-dev-net`. |
| `make start-nifi-prod` | Apply `docker-compose.prod.yml` over the base and start published images on an existing `cogstack-net`. |
| `make start` | Use `docker-compose.yml` to start published images with a Compose-managed `cogstack-net`. |
| `make start-dev` | Start NiFi and NGINX with the dev settings. |
| `make start-dev-build` | Apply `docker-compose.dev.yml` over the base, build both images locally, mount editable NiFi resources and dev data, and use `nifi-dev-net`. |
| `make start-prod` | Apply `docker-compose.prod.yml` over the base and start published images on an existing `cogstack-net`. |

Default and prod use Compose project `nifi` and share its named volumes. Dev uses
separate volumes by default. To pin the published images, set `NIFI_IMAGE` and
Expand Down Expand Up @@ -122,11 +122,13 @@ host data.

The base configuration keeps seven named volumes for configuration, state,
logs, and the database, FlowFile, content, and provenance repositories. Use
`make stop-nifi-dev`, `make stop-nifi-prod`, or `docker compose stop` for the
default stack after sourcing the env files. `make delete-nifi` removes the
**dev** containers and preserves their volumes. `make delete-nifi-dev-volumes`
also deletes their named storage, including saved flows and queued data. Back
up FlowFile and content repositories together when preserving queues.
`make stop-dev`, `make stop-prod`, or `docker compose stop` for the
default stack after sourcing the env files. `make delete-dev` removes the
**dev** containers and preserves their volumes. `make delete-all` stops and
removes the NiFi and NGINX containers across the default, dev, and prod stacks.
`make delete-dev-volumes` also deletes the dev volumes, including saved flows
and queued data. Back up FlowFile and content repositories together when
preserving queues.

## Build the image

Expand Down
Loading
Loading