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 5 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 setuptools wheel && \
pip install --no-cache-dir -r requirements.txt && \
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
39 changes: 39 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
app-common-python==0.2.5
attrs==23.1.0
boto3==1.29.3
botocore==1.32.3
CacheControl==0.13.1
ccx-messaging @ git+https://github.com/RedHatInsights/insights-ccx-messaging@v3.4.2
certifi==2023.11.17
charset-normalizer==3.3.2
confluent-kafka==2.3.0
decorator==5.1.1
defusedxml==0.7.1
filelock==3.13.1
fsspec==2023.10.0
idna==3.4
insights-core==3.2.23
insights-core-messaging @ git+https://github.com/RedHatInsights/insights-core-messaging@1.2.2
Jinja2==3.1.2
jmespath==1.0.1
jsonschema==4.20.0
jsonschema-specifications==2023.11.1
lockfile==0.12.2
MarkupSafe==2.1.3
msgpack==1.0.7
prometheus-client==0.18.0
py==1.11.0
python-dateutil==2.8.2
python-json-logger==2.0.7
PyYAML==6.0.1
redis==5.0.1
referencing==0.31.0
requests==2.31.0
retry==0.9.2
rpds-py==0.13.0
s3fs==0.4.2
s3transfer==0.7.0
six==1.16.0
urllib3==2.0.7
watchtower==3.0.1
.
epapbak marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 38 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
[metadata]
name = dvo-extractor
author = Red Hat Inc.
description-file = README.md
license = Apache 2.0
long_description_content_type = text/markdown
home-page = 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
ccx-messaging>=3.4.2
insights-core-messaging
setup_requires =
setuptools
setuptools_scm
wheel

[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