Skip to content

Commit

Permalink
#370 V3/V4 distinction (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj authored Mar 6, 2025
1 parent 1f87283 commit 1e93b3e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 38 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [1.5.0] - 2025-03-06

### Added in 1.5.0

- Support for Senzing V4

## [1.4.12] - 2024-06-24

### Changed in 1.4.12
Expand Down
65 changes: 27 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BASE_IMAGE=senzing/senzingapi-tools:3.10.3
ARG BASE_IMAGE=senzing/senzingapi-tools:3.12.5

ARG IMAGE_NAME="senzing/sshd"
ARG IMAGE_MAINTAINER="[email protected]"
ARG IMAGE_VERSION="1.4.12"
ARG IMAGE_VERSION="1.5.0"

# -----------------------------------------------------------------------------
# Stage: builder
Expand All @@ -12,7 +12,7 @@ FROM ${BASE_IMAGE} AS builder

# Set Shell to use for RUN commands in builder step.

ENV REFRESHED_AT=2024-06-24
ENV REFRESHED_AT=2025-03-06

# Run as "root" for system installation.

Expand All @@ -39,27 +39,27 @@ RUN apt-get update \

RUN mkdir /tmp/fio \
&& cd /tmp/fio \
&& wget https://github.com/axboe/fio/archive/refs/tags/fio-3.30.zip \
&& unzip fio-3.30.zip \
&& cd fio-fio-3.30/ \
&& wget https://github.com/axboe/fio/archive/refs/tags/fio-3.39.zip \
&& unzip fio-3.39.zip \
&& cd fio-fio-3.39/ \
&& ./configure \
&& make \
&& make install \
&& fio --version \
&& cd \
&& rm -rf /tmp/fio
# Create and activate virtual environment.
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
# pip install Python dependencies.
COPY requirements.txt .
RUN pip3 install --upgrade pip \
&& pip3 install -r requirements.txt \
&& rm /requirements.txt

# Create and activate virtual environment.

RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"

# pip install Python dependencies.

COPY requirements.txt .
RUN pip3 install --upgrade pip \
&& pip3 install -r requirements.txt \
&& rm /requirements.txt

# -----------------------------------------------------------------------------
# Stage: Final
Expand Down Expand Up @@ -111,37 +111,26 @@ RUN apt-get update \
&& apt-get -y install postgresql-client-14 \
&& rm -rf /var/lib/apt/lists/*

# Copy python virtual environment from the builder image.
# Copy python virtual environment from the builder image.

COPY --from=builder /app/venv /app/venv

COPY --from=builder /app/venv /app/venv

# Activate virtual environment.
# Activate virtual environment.

ENV VIRTUAL_ENV=/app/venv
ENV PATH="/app/venv/bin:${PATH}"
ENV VIRTUAL_ENV=/app/venv
ENV PATH="/app/venv/bin:${PATH}"

# Configure sshd.

RUN mkdir /var/run/sshd \
&& sed -i -e '$aPermitRootLogin yes' /etc/ssh/sshd_config \
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
&& echo "export LANGUAGE=C" >> /etc/profile \
&& echo "export LC_ALL=C.UTF-8" >> /etc/profile \
&& echo "export LD_LIBRARY_PATH=/opt/senzing/g2/lib" >> /etc/profile \
&& echo "export PATH=${PATH}" >> /etc/profile \
&& echo "export PYTHONPATH=/opt/senzing/g2/python:/opt/senzing/g2/sdk/python" >> /etc/profile \
&& echo "export PYTHONUNBUFFERED=1" >> /etc/profile \
&& echo "export NOTVISIBLE='in users profile'" >> /etc/profile \
&& echo "export ROOT_PASSWORD=senzingsshdpassword" >> /etc/profile \
&& echo "export SENZING_DOCKER_LAUNCHED=true" >> /etc/profile \
&& echo "export SENZING_SKIP_DATABASE_PERFORMANCE_TEST=true" >> /etc/profile \
&& echo "export SENZING_SSHD_SHOW_PERFORMANCE_WARNING=true" >> /etc/profile \
&& echo "export VISIBLE=now" >> /etc/profile
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

# Copy files from repository.

COPY ./rootfs /
RUN /app/update-motd.sh
RUN /app/update-motd.sh \
&& /app/update-etc-profile.sh

# Copy files from prior stages.

Expand Down
38 changes: 38 additions & 0 deletions rootfs/app/update-etc-profile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

SIGNAL_V3=/opt/senzing/g2/g2BuildVersion.json
SIGNAL_V4=/opt/senzing/er/szBuildVersion.json

OUTFILE=/etc/profile

# Common values.

{
echo "export LANGUAGE=C"
echo "export LC_ALL=C.UTF-8"
echo "export PATH=${PATH}"
echo "export PYTHONUNBUFFERED=1"
echo "export NOTVISIBLE='in users profile'"
echo "export ROOT_PASSWORD=senzingsshdpassword"
echo "export SENZING_DOCKER_LAUNCHED=true"
echo "export SENZING_SKIP_DATABASE_PERFORMANCE_TEST=true"
echo "export SENZING_SSHD_SHOW_PERFORMANCE_WARNING=true"
echo "export VISIBLE=now"
} >> ${OUTFILE}

# Senzing Version 3 values.

if test -f ${SIGNAL_V3}; then
{
echo "export LD_LIBRARY_PATH=/opt/senzing/g2/lib"
echo "export PYTHONPATH=/opt/senzing/g2/python:/opt/senzing/g2/sdk/python"
} >> ${OUTFILE}
exit 0
fi

# Default values.

{
echo "export LD_LIBRARY_PATH=/opt/senzing/er/lib"
echo "export PYTHONPATH=/opt/senzing/er/bin:/opt/senzing/er/sdk/python"
} >> ${OUTFILE}

0 comments on commit 1e93b3e

Please sign in to comment.