-
Notifications
You must be signed in to change notification settings - Fork 79
[Metro-Vision]Trivy config fixes. #1142
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
Open
sowmiar1
wants to merge
8
commits into
release-2025.2.0
Choose a base branch
from
sowmya/fix_trivy_config
base: release-2025.2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3948a50
fix trivy for nginx-reverce-proxy
sowmiar1 924d998
fix trivy config error for smart intersession.
sowmiar1 dd88577
fix for loitering.
sowmiar1 f210bf9
fix for smart parking.
sowmiar1 2ca4497
Merge branch 'release-2025.2.0' into sowmya/fix_trivy_config
sowmiar1 9a2139e
reverting SI changes.
sowmiar1 36db297
Merge branch 'release-2025.2.0' into sowmya/fix_trivy_config
rohitkatakol 2e10fcf
reverting loitering nginx changes.
sowmiar1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
197 changes: 105 additions & 92 deletions
197
...ro-vision-ai-app-recipe/loitering-detection/helm-chart/templates/nginx-reverse-proxy.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,119 +1,132 @@ | ||
| # Copyright (c) 2024 Intel Corporation. | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: nginx-conf | ||
| namespace: {{ .Values.namespace }} | ||
| data: | ||
| nginx.conf: |- | ||
| {{ (.Files.Get "config/nginx/nginx.conf") | indent 4 }} | ||
| generate_certs.sh: | | ||
| #!/bin/sh | ||
| set -e | ||
| SSL_DIR="/etc/nginx/ssl" | ||
| mkdir -p "$SSL_DIR" | ||
| if ! command -v openssl >/dev/null 2>&1; then | ||
| echo "Installing openssl..." | ||
| apk add --no-cache openssl | ||
| fi | ||
| if [ ! -f "$SSL_DIR/server.crt" ] || [ ! -f "$SSL_DIR/server.key" ]; then | ||
| echo "🔐 Generating self-signed SSL certificate..." | ||
| openssl req -x509 -nodes -days 365 \ | ||
| -newkey rsa:2048 \ | ||
| -keyout "$SSL_DIR/server.key" \ | ||
| -out "$SSL_DIR/server.crt" \ | ||
| -subj "/C=US/ST=CA/L=San Francisco/O=Intel/OU=Edge AI/CN=localhost" | ||
| fi | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: nginx-reverse-proxy | ||
| namespace: {{ .Values.namespace }} | ||
| spec: | ||
| type: NodePort | ||
| selector: | ||
| app: nginx-reverse-proxy | ||
| ports: | ||
| - name: http | ||
| port: {{ .Values.config.nginx.int.http_port }} | ||
| targetPort: {{ .Values.config.nginx.int.http_port }} | ||
| nodePort: {{ .Values.config.nginx.ext.http_port }} | ||
| - name: https | ||
| port: {{ .Values.config.nginx.int.https_port }} | ||
| targetPort: {{ .Values.config.nginx.int.https_port }} | ||
| nodePort: {{ .Values.config.nginx.ext.https_port }} | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: deployment-node-red | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| app: nginx-reverse-proxy | ||
| name: deployment-nginx-reverse-proxy | ||
| namespace: {{ .Values.namespace }} | ||
| app: node-red | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: nginx-reverse-proxy | ||
| app: node-red | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: nginx-reverse-proxy | ||
| app: node-red | ||
| spec: | ||
| securityContext: | ||
| fsGroup: 1000 | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| initContainers: | ||
| - name: generate-certs | ||
| image: alpine/openssl:3.5.4 | ||
| command: | ||
| - name: intel-plugin-downloader | ||
| image: curlimages/curl:latest | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| runAsNonRoot: true | ||
| runAsUser: 1000 | ||
| runAsGroup: 1000 | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| command: | ||
| - /bin/sh | ||
| - /scripts/generate_certs.sh | ||
|
Contributor
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. We need this to generate certificates. Add only necessary changes. Do it similar to how it is done for smart-parking in the same PR |
||
| - -c | ||
| - | | ||
| mkdir -p /tmp/data | ||
| mkdir -p /tmp/data/public/videos/ | ||
| curl -L https://github.com/open-edge-platform/edge-ai-suites/archive/refs/tags/v1.0.0.zip -o /tmp/main.zip | ||
| unzip -q /tmp/main.zip -d /tmp && \ | ||
| cp -r /tmp/edge-ai-suites-1.0.0/metro-ai-suite/loitering-detection/node-red/* /tmp/data/ | ||
| rm -rf /tmp/main.zip /tmp/edge-ai-suites-1.0.0 | ||
| mkdir -p /tmp/data/public/videos | ||
| curl -L https://github.com/intel/metro-ai-suite/raw/refs/heads/videos/videos/VIRAT_S_000101.mp4 -o /tmp/data/public/videos/VIRAT_S_000101.mp4 | ||
| curl -L https://github.com/intel/metro-ai-suite/raw/refs/heads/videos/videos/VIRAT_S_000102.mp4 -o /tmp/data/public/videos/VIRAT_S_000102.mp4 | ||
| curl -L https://github.com/intel/metro-ai-suite/raw/refs/heads/videos/videos/VIRAT_S_000103.mp4 -o /tmp/data/public/videos/VIRAT_S_000103.mp4 | ||
| curl -L https://github.com/intel/metro-ai-suite/raw/refs/heads/videos/videos/VIRAT_S_000104.mp4 -o /tmp/data/public/videos/VIRAT_S_000104.mp4 | ||
| rm /tmp/data/flows.json | ||
| cp -f /tmp/flows.json /tmp/data/flows.json | ||
| env: | ||
| - name: http_proxy | ||
| value: {{ $.Values.env.http_proxy }} | ||
| - name: https_proxy | ||
| value: {{ $.Values.env.https_proxy }} | ||
| - name: no_proxy | ||
| value: "{{ $.Values.env.no_proxy }},{{ $.Values.env.HOST_IP }}" | ||
| volumeMounts: | ||
| - name: nginx-ssl | ||
| mountPath: /etc/nginx/ssl | ||
| - name: nginx-scripts | ||
| mountPath: /scripts | ||
| - name: node-red-data | ||
| mountPath: /tmp/data | ||
| - name: node-red-flows-config | ||
| mountPath: /tmp/flows.json | ||
| subPath: flows.json | ||
| - name: tmp | ||
| mountPath: /tmp | ||
| containers: | ||
| - name: nginx-reverse-proxy | ||
| image: {{ .Values.nginx.image }}:{{ .Values.nginx.imageTag }} | ||
| imagePullPolicy: IfNotPresent | ||
| - name: node-red | ||
| image: {{ $.Values.node_red.image }}:{{ $.Values.node_red.imageTag }} | ||
| command: ["/bin/bash", "-c"] | ||
| args: ["/data/install_package.sh && /usr/src/node-red/entrypoint.sh"] | ||
| ports: | ||
| - containerPort: {{ .Values.config.nginx.int.http_port }} | ||
| - containerPort: {{ .Values.config.nginx.int.https_port }} | ||
| - containerPort: {{ $.Values.config.node_red.int.web_ui_port }} | ||
sowmiar1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| name: http | ||
| env: | ||
| - name: http_proxy | ||
| value: {{ $.Values.env.http_proxy }} | ||
| - name: https_proxy | ||
| value: {{ $.Values.env.https_proxy }} | ||
| - name: no_proxy | ||
| value: "{{ $.Values.env.no_proxy }},{{ $.Values.env.HOST_IP }}" | ||
| - name: NO_PROXY | ||
| value: "{{ $.Values.env.no_proxy }},{{ $.Values.env.HOST_IP }}" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| runAsNonRoot: true | ||
| runAsUser: 1000 | ||
| runAsGroup: 1000 | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| volumeMounts: | ||
| - name: nginx-conf | ||
| mountPath: /etc/nginx/nginx.conf | ||
| subPath: nginx.conf | ||
| - name: nginx-ssl | ||
| mountPath: /etc/nginx/ssl | ||
| resources: | ||
| requests: | ||
| memory: "64Mi" | ||
| cpu: "100m" | ||
| limits: | ||
| memory: "128Mi" | ||
| cpu: "200m" | ||
| - name: node-red-data | ||
| mountPath: /data | ||
| - name: node-red-src | ||
| mountPath: /usr/src/node-red | ||
| - name: tmp | ||
| mountPath: /tmp | ||
| volumes: | ||
| - name: nginx-conf | ||
| configMap: | ||
| name: nginx-conf | ||
| items: | ||
| - key: nginx.conf | ||
| path: nginx.conf | ||
| - name: nginx-scripts | ||
| - name: node-red-data | ||
| emptyDir: {} | ||
| - name: node-red-flows-config | ||
| configMap: | ||
| name: nginx-conf | ||
| items: | ||
| - key: generate_certs.sh | ||
| path: generate_certs.sh | ||
| mode: 0755 | ||
| - name: nginx-ssl | ||
| emptyDir: {} | ||
| name: node-red-flows-config | ||
| - name: node-red-src | ||
| emptyDir: {} | ||
| - name: tmp | ||
| emptyDir: {} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: node-red | ||
| namespace: {{ $.Values.namespace }} | ||
| labels: | ||
| app: node-red | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - port: {{ $.Values.config.node_red.int.web_ui_port }} | ||
| targetPort: {{ $.Values.config.node_red.int.web_ui_port }} | ||
| protocol: TCP | ||
| name: http | ||
| selector: | ||
| app: node-red | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| namespace: {{ .Values.namespace }} | ||
| name: node-red-flows-config | ||
| data: | ||
| flows.json: |- | ||
| {{ .Files.Get "config/node-red/flows.json" | indent 4 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.