Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #8 from epapbak/dockerfile-setup
Browse files Browse the repository at this point in the history
Dockerfile setup
epapbak authored Nov 20, 2023
2 parents a1f96ce + 18e72f8 commit 90576e5
Showing 5 changed files with 75 additions and 4 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM registry.access.redhat.com/ubi9-minimal:latest

ENV CONFIG_PATH=/dvo-extractor/config.yaml \
VENV=/dvo-extractor-venv \
HOME=/dvo-extractor \
REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt

WORKDIR $HOME

COPY . $HOME

ENV PATH="$VENV/bin:$PATH"

RUN microdnf install --nodocs -y python3.11 unzip tar git-core && \
python3.11 -m venv $VENV && \
curl -ksL https://certs.corp.redhat.com/certs/2015-IT-Root-CA.pem -o /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt && \
curl -ksL https://certs.corp.redhat.com/certs/2022-IT-Root-CA.pem -o /etc/pki/ca-trust/source/anchors/2022-IT-Root-CA.pem && \
update-ca-trust && \
pip install --no-cache-dir -U pip && \
pip install --no-cache-dir . && \
microdnf remove -y git-core && \
microdnf clean all && \
rpm -e --nodeps sqlite-libs krb5-libs libxml2 readline pam openssh openssh-clients && \
chmod -R g=u $HOME $VENV /etc/passwd && \
chgrp -R 0 $HOME $VENV


USER 1001

CMD ["sh", "-c", "dvo-extractor $CONFIG_PATH"]

6 changes: 3 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -26,13 +26,13 @@ service:
kwargs:
max_archive_size: 100MiB
engine:
name: ccx_messaging.engines.sha_extractor_engine.DVOExtractorEngine
name: ccx_messaging.engines.dvo_extractor_engine.DVOExtractorEngine
kwargs:
extract_timeout: 10
publisher:
name: ccx_messaging.publishers.sha_publisher.DVOPublisher
name: ccx_messaging.publishers.dvo_publisher.DVOPublisher
kwargs:
outgoing_topic: ${CDP_OUTGOING_TOPIC:archive-results}
outgoing_topic: ${CDP_OUTGOING_TOPIC:ccx.ocp.results}
bootstrap_servers: ${CDP_PUBLISHER_SERVER:["10.34.129.172:9092"]}

logging:
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"

[tool.ruff]
select = ["E", "F", "W", "UP", "C", "D"]
ignore = ["D211", "C401", "D213", "UP006", "UP007", "UP009", "UP015", "UP035"]
36 changes: 36 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
[metadata]
name = dvo-extractor
version = 0.1.0
author = Red Hat Inc.
long_description = file: README.md
license = Apache 2.0
long_description_content_type = text/markdown
url = https://github.com/RedHatInsights/dvo-extractor
classifier =
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
zip_safe = False
packages = find:
install_requires =
app-common-python>=0.2.6
ccx-messaging @ git+https://github.com/RedHatInsights/insights-ccx-messaging@v3.4.2
insights-core>=3.2.23
insights-core-messaging @ git+https://github.com/RedHatInsights/insights-core-messaging

[options.packages.find]
exclude =
test*

[options.entry_points]
console_scripts =
dvo-extractor = dvo_extractor.command_line:insights_dvo_extractor

[pycodestyle]
max-line-length = 100

2 changes: 1 addition & 1 deletion tools/run_pycodestyle.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ def main():
# Find all files in current directory and subdirectories with '*.py' extension.
# Files are found recursivelly in all subdirectories as well.
files = list(Path(".").rglob("*.py"))
files = [f for f in files if not str(f).startswith("venv/")]
files = [f for f in files if "venv/" not in str(f)]
print("Files to check:")
print("\n".join(str(f) for f in files))
print("\nChecks:")

0 comments on commit 90576e5

Please sign in to comment.