Skip to content

Commit

Permalink
Release ops for STF 1.5.1 (#17)
Browse files Browse the repository at this point in the history
* Remove invalid addition to requirements.txt (#11)

When I rebased I inadvertently added an invalid reference which breaks
cachito. Imports require requirements.txt to be pinned to a version.

* Clean up hadolint output (#15)

* Clean up hadolint output

Clean up hadolint output which causes failures testing in GitHub
Actions. Remove unnecessary upgrades (which are reverted by requirements
files) and package installation (satisfied by requirements).

Resolves: STF-1256

* Syncronize versions across requirements files

* Extend available options to prometheus-webhook-snmp (#14)

* Extend available options to prometheus-webhook-snmp

Related: STF-559

* Adjust Dockerfile to conform to hadolint checks

* Set pip installation version

* Various fixes for linting and build warnings

- Complete clean up of the linting and verify everything continues to
  build
- Clean up the Dockerfile for python package updates which were just
  being overridden by the requirements-built.txt

* Use proper .hadolint.yaml file

* Don't Dockerfile lint error on info

* Allow shell meta-character problems in SNMP vars (#16)

* Allow shell meta-characters in SNMP vars

---------

Signed-off-by: Leif Madsen <[email protected]>
Co-authored-by: Leif Madsen <[email protected]>
  • Loading branch information
csibbitt and leifmadsen authored Mar 6, 2023
1 parent a955305 commit 9e9173c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/linters/.hadolint.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
failure-threshold: warning
ignored:
- DL3041
- DL3013
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM quay.io/centos/centos:stream8

# >> ignore SC2086 because passing quoted env vars to dnf causes issues (fail to install)
# hadolint ignore=SC2086
RUN INSTALL_PKGS="\
procps-ng \
telnet \
Expand All @@ -15,14 +17,14 @@ COPY . /source/app
WORKDIR /source/app

RUN alternatives --set python /usr/bin/python3 && \
python -m pip install --upgrade setuptools pip && \
python -m pip install wheel && \
python -m pip install -r requirements-build.txt && \
python -m pip install . && \
python -m pip install --no-cache-dir -r requirements-build.txt && \
python -m pip install --no-cache-dir . && \
python -m pip freeze

# Cleanup
RUN UNINSTALL_PKGS="\
# >> ignore SC2086 because passing quoted env vars to dnf causes issues (fail to install)
# hadolint ignore=SC2086
RUN UNINSTALL_PKGS="\
gcc \
" && \
dnf remove -y $UNINSTALL_PKGS && \
Expand All @@ -34,7 +36,10 @@ ENV SNMP_HOST="localhost"
ENV SNMP_RETRIES=5
ENV SNMP_TIMEOUT=1
ENV ALERT_OID_LABEL="oid"
ENV TRAP_OID_PREFIX="1.3.6.1.4.1.50495.15"
ENV TRAP_DEFAULT_OID="1.3.6.1.4.1.50495.15.1.2.1"
ENV TRAP_DEFAULT_SEVERITY=""

EXPOSE 9099

CMD ["sh", "-c", "/usr/local/bin/prometheus-webhook-snmp --debug --snmp-port=$SNMP_PORT --snmp-host=$SNMP_HOST --snmp-community=$SNMP_COMMUNITY --alert-oid-label=$ALERT_OID_LABEL run"]
CMD ["sh", "-c", "/usr/local/bin/prometheus-webhook-snmp --debug --snmp-port=\"${SNMP_PORT}\" --snmp-host=\"${SNMP_HOST}\" --snmp-community=\"${SNMP_COMMUNITY}\" --snmp-retries=\"${SNMP_RETRIES}\" --snmp-timeout=\"${SNMP_TIMEOUT}\" --alert-oid-label=\"${ALERT_OID_LABEL}\" --trap-oid-prefix=\"${TRAP_OID_PREFIX}\" --trap-default-oid=\"${TRAP_DEFAULT_OID}\" --trap-default-severity=\"${TRAP_DEFAULT_SEVERITY}\" run"]
1 change: 1 addition & 0 deletions requirements-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ setuptools_scm<6.0,>=3.3.1
setuptools_scm>=1.15
setuptools_scm[toml]>=3.4.1
setuptools_scm_git_archive>=1.0
pip>=21
toml
wheel
12 changes: 6 additions & 6 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile --allow-unsafe --output-file=requirements-build.txt requirements-build.in
#
pip==21.1.1
# for Cachito debugging
cython==0.29.23
# via -r requirements-build.in
setuptools-scm-git-archive==1.1
# via -r requirements-build.in
setuptools-scm[toml]==5.0.2
# via -r requirements-build.in
setuptools-scm-git-archive==1.1
# via -r requirements-build.in
toml==0.10.2
# via
# -r requirements-build.in
Expand All @@ -20,7 +18,9 @@ wheel==0.36.2
# via -r requirements-build.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==56.2.0
pip==21.3.1
# via -r requirements-build.in
setuptools==59.6.0
# via
# -r requirements-build.in
# setuptools-scm
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pysnmp==4.4.8
pytest==4.4.0
pytest-runner==5.3.1
python-dateutil==2.8.0
pip==21.3.1
16 changes: 11 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile --output-file=requirements.txt requirements.in
# pip-compile --allow-unsafe --output-file=requirements.txt requirements.in
#
astroid==2.5.6
# via pylint
Expand Down Expand Up @@ -58,10 +58,10 @@ pysmi==0.3.4
# via pysnmp
pysnmp==4.4.8
# via -r requirements.in
pytest-runner==5.3.1
# via -r requirements.in
pytest==4.4.0
# via -r requirements.in
pytest-runner==5.3.1
# via -r requirements.in
python-dateutil==2.8.0
# via -r requirements.in
pytz==2021.1
Expand All @@ -86,5 +86,11 @@ zc.lockfile==2.0
# via cherrypy
zipp==3.4.1
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
pip==21.3.1
# via -r requirements.in
setuptools==59.6.0
# via
# pytest
# zc.lockfile

0 comments on commit 9e9173c

Please sign in to comment.