Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile setup #8

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Expand Up @@ -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:
Expand Down
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"]
Expand Down
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

epapbak marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion tools/run_pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down