Skip to content
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
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
8 changes: 8 additions & 0 deletions Application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from worker.DataSerializer import DataSerializer
from worker.HadoopManager import HadoopManager


# function main():
# data_serializer = DataSerializer("data_path must be passed here")


23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dockerfile
FROM python:3.11-slim


WORKDIR /app

COPY wait-for-namenode.sh /wait-for-namenode.sh

RUN chmod +x /wait-for-namenode.sh

ENTRYPOINT ["/wait-for-namenode.sh"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security (dockerfile.security.missing-user-entrypoint): By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.

Suggested change
ENTRYPOINT ["/wait-for-namenode.sh"]
USER non-root
ENTRYPOINT ["/wait-for-namenode.sh"]

Source: opengrep



COPY . .

RUN pip install --timeout=120 hdfs
RUN pip install --timeout=120 pandas
RUN pip install --timeout=120 pyspark

Comment on lines +14 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Combine pip install commands to reduce image layers and improve build efficiency.

Combine all pip install commands into a single RUN statement to minimize image layers and improve build speed, e.g., RUN pip install --timeout=120 hdfs pandas pyspark.

Suggested change
COPY . .
RUN pip install --timeout=120 hdfs
RUN pip install --timeout=120 pandas
RUN pip install --timeout=120 pyspark
COPY . .
RUN pip install --timeout=120 hdfs pandas pyspark




CMD ["python", "worker/try.py"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security (dockerfile.security.missing-user): By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.

Suggested change
CMD ["python", "worker/try.py"]
USER non-root
CMD ["python", "worker/try.py"]

Source: opengrep

Empty file added Server.py
Empty file.
10 changes: 10 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
jupyter
pyspark
fastapi

hdfs
kazoo
uvicorn