Repository navigation
some additional code snippet added #3
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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") | ||
|
|
||
|
|
| 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 . . | ||||||||||||||||||||
|
|
||||||||||||||||||||
| RUN pip install --timeout=120 hdfs | ||||||||||||||||||||
| RUN pip install --timeout=120 pandas | ||||||||||||||||||||
| RUN pip install --timeout=120 pyspark | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
Comment on lines
+14
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| CMD ["python", "worker/try.py"] | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Source: opengrep |
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| jupyter | ||
| pyspark | ||
| fastapi | ||
|
|
||
| hdfs | ||
| kazoo | ||
| uvicorn | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
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'.
Source: opengrep