Skip to content

Commit 12f9a4a

Browse files
committed
chore: update charts
1 parent fc901ab commit 12f9a4a

9 files changed

Lines changed: 268 additions & 89 deletions

File tree

ai-service/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

ai-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: ai-service
33
description: A Helm chart for Privado AI Service on Kubernetes
44
type: application
5-
version: 0.1.1
5+
version: 0.1.2
66
appVersion: "1.17.0"

ai-service/init.sh

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,44 @@
22

33
# Function to prompt the user for input with a default value
44
prompt() {
5-
local var_name=$1
6-
local prompt_text=$2
7-
local default_value=$3
5+
local prompt_text=$1
6+
local default_value=$2
87
read -p "$prompt_text ($default_value): " input
98
echo "${input:-$default_value}"
109
}
1110

1211
# File to update
13-
values_file="values.yaml"
12+
BASE_PATH=$(pwd)
13+
ai_values_file=$BASE_PATH/values.yaml
1414

1515
# Prompt the user for each value
16-
ai_service_andromeda_host=$(prompt "AI_SERVICE_ANDROMEDA_HOST" "Enter the AI Service Andromeda Host URL" "http://andromeda-service.privado.svc.cluster.local:6001")
17-
chroma_host=$(prompt "CHROMA_HOST" "Enter the Chroma Host (without 'http://' prefix)" "ai-service-chroma-chromadb.privado.svc.cluster.local")
18-
use_ecr=$(prompt "Use ECR to pull AiService container image? (true/false)" "false")
19-
secret_access_key_id=$(prompt "secretAccessKeyId" "Enter the AWS Secret Access Key ID (required if useECR:true)" "None")
20-
secret_access_key=$(prompt "secretAccessKey" "Enter the AWS Secret Access Key (required if useECR:true)" "None")
21-
node_instance_type=$(prompt "node.kubernetes.io/instance-type" "Enter the node instance type" "g5.xlarge")
22-
models_storage_class=$(prompt "aiServiceModelsPvc.storageClassName" "Enter the storage class name for models PVC" "gp2")
23-
log_storage_class=$(prompt "aiServiceLogPvc.storageClassName" "Enter the storage class name for log PVC" "gp2")
16+
cluster_domain=$(prompt "Enter the cluster domain" "cluster.local")
17+
use_ecr=$(prompt "Use Privado ECR to pull container images? (true/false)" "true")
18+
node_instance_type=$(prompt "Enter the GPU node instance type" "g5.xlarge")
19+
storage_class=$(prompt "Enter the storage class name that supports RWX" "efs-sc")
2420
enable_autoupdates=$(prompt "Enable auto-updates cronjob? (true/false)" "false")
2521
hf_access_token=$(prompt "Enter the Huggingface access token (provided by privado)" "None")
2622

27-
23+
if [[ "$use_ecr" == "false" ]]; then
24+
echo "Using Privado ECR is disabled. This requires pre-emptively copying service images to a private repository."
25+
ai_service_image_repo_url=$(prompt "Enter the AI Service image repository URL" "None")
26+
secret_access_key_id=""
27+
secret_access_key=""
28+
else
29+
ai_service_image_repo_url="638117407428.dkr.ecr.eu-west-1.amazonaws.com/ai-service-on-premise"
30+
secret_access_key_id=$(prompt "Enter the AWS Secret Access Key ID (required if useECR:true)" "None")
31+
secret_access_key=$(prompt "Enter the AWS Secret Access Key (required if useECR:true)" "None")
32+
fi
2833
# Update the values.yaml file
29-
sed -i.bak -e "s/secretAccessKeyId: .*/secretAccessKeyId: \"$secret_access_key_id\"/" \
30-
-e "s/secretAccessKey: .*/secretAccessKey: \"$secret_access_key\"/" \
31-
-e "s/node.kubernetes.io\/instance-type: .*/node.kubernetes.io\/instance-type: $node_instance_type/" \
32-
-e "s/storageClassName: gp2 # NEEDS-CUSTOMER-INPUT.*/storageClassName: $models_storage_class # NEEDS-CUSTOMER-INPUT/" \
33-
-e "s/storageClassName: gp2 # NEEDS-CUSTOMER-INPUT.*/storageClassName: $log_storage_class # NEEDS-CUSTOMER-INPUT/" \
34-
-e "s|value: \"http://andromeda-service.privado.svc.cluster.local:6001\" # NEEDS-CUSTOMER-INPUT|value: \"$ai_service_andromeda_host\" # NEEDS-CUSTOMER-INPUT|" \
35-
-e "s|value: \"ai-service-chroma-chromadb.privado.svc.cluster.local\" # NEEDS-CUSTOMER-INPUT \[without 'http://'\ prefix\]|value: \"$chroma_host\" # NEEDS-CUSTOMER-INPUT \[without 'http://'\ prefix\]|" \
36-
-e "s|autoUpdateEnabled: false # NEEDS-CUSTOMER-INPUT|autoUpdateEnabled: $enable_autoupdates # NEEDS-CUSTOMER-INPUT|" \
37-
-e "s|HF_ACCESS_TOKEN_PLACEHOLDER|$hf_access_token|" \
38-
-e "s|useECR: false # NEEDS-CUSTOMER-INPUT|useECR: $use_ecr|" \
39-
"$values_file"
34+
sed -i.bak -e "s|useECR: true # NEEDS-CUSTOMER-INPUT|useECR: $use_ecr|" \
35+
-e "s/__CLUSTER_DOMAIN__/$cluster_domain/" \
36+
-e "s/__AWS_ACCESS_KEY_ID__/$secret_access_key_id/" \
37+
-e "s/__AWS_SECRET_ACCESS_KEY__/$secret_access_key/" \
38+
-e "s/node.kubernetes.io\/instance-type: .*/node.kubernetes.io\/instance-type: $node_instance_type/" \
39+
-e "s/storageClassName: gp2 # NEEDS-CUSTOMER-INPUT.*/storageClassName: $storage_class # NEEDS-CUSTOMER-INPUT/" \
40+
-e "s|autoUpdateEnabled: false # NEEDS-CUSTOMER-INPUT|autoUpdateEnabled: $enable_autoupdates # NEEDS-CUSTOMER-INPUT|" \
41+
-e "s|638117407428.dkr.ecr.eu-west-1.amazonaws.com/ai-service-on-premise|$ai_service_image_repo_url|" \
42+
-e "s|HF_ACCESS_TOKEN_PLACEHOLDER|$hf_access_token|" \
43+
"$ai_values_file"
4044

41-
echo "values.yaml has been updated with the provided values."
45+
echo "$ai_values_file has been updated with the provided values."

ai-service/values.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ service:
88
- name: DEPLOYMENT_GROUP_NAME
99
value: "enterprise-env"
1010
- name: AI_SERVICE_ANDROMEDA_HOST
11-
value: "http://andromeda-service.privado.svc.cluster.local:6001" # NEEDS-CUSTOMER-INPUT
11+
# The andromeda-service prefix corresponds to andromeda.serviceName: andromeda-service in code-analysis/values.yaml
12+
# Adjust the andromeda host URL to match your deployment configuration if necessary.
13+
value: http://andromeda-service.__ANDRO_NAMESPACE__.svc.__ANDRO_CLUSTER_DOMAIN__:6001
1214
- name: CHROMA_HOST
13-
value: "ai-service-chroma-chromadb.privado.svc.cluster.local" # NEEDS-CUSTOMER-INPUT [without 'http://' prefix]
15+
value: ai-service-chroma-chromadb.__AI_NAMESPACE__.svc.__AI_CLUSTER_DOMAIN__
1416
- name: NVIDIA_DRIVER_CAPABILITIES
1517
value: "all"
1618
- name: HF_ACCESS_TOKEN
@@ -25,10 +27,10 @@ image:
2527
imagePullSecret: ai-service-ecr-secret
2628

2729
privadoAwsSecrets:
28-
useECR: false # NEEDS-CUSTOMER-INPUT
30+
useECR: true # NEEDS-CUSTOMER-INPUT
2931
secretName: ai-service-ecr-secret
30-
secretAccessKeyId: "_CUSTOMER_AWS_ACCESS_KEY_ID_" # NEEDS-CUSTOMER-INPUT
31-
secretAccessKey: "_CUSTOMER_AWS_SECRET_ACCESS_KEY_" # NEEDS-CUSTOMER-INPUT
32+
secretAccessKeyId: __AWS_ACCESS_KEY_ID__ # NEEDS-CUSTOMER-INPUT
33+
secretAccessKey: __AWS_SECRET_ACCESS_KEY__ # NEEDS-CUSTOMER-INPUT
3234
annotations: { } # Add custom labels here
3335

3436
serviceAccount:
@@ -113,18 +115,18 @@ volumeMounts:
113115
persistentVolumeClaim:
114116
aiServiceModelsPvc:
115117
name: ai-service-models-pvc
116-
accessModes: "ReadWriteOnce" # Update ReadWriteMany if autoscaling is enabled
118+
accessModes: "ReadWriteMany" # Update ReadWriteMany if autoscaling is enabled
117119
resources:
118120
requests:
119121
storage: 80Gi
120-
storageClassName: gp2 # NEEDS-CUSTOMER-INPUT. Adjust the storageClassName as needed.
122+
storageClassName: efs-sc # NEEDS-CUSTOMER-INPUT.
121123
aiServiceLogPvc:
122124
name: ai-service-log-pvc
123-
accessModes: "ReadWriteOnce"
125+
accessModes: "ReadWriteMany"
124126
resources:
125127
requests:
126128
storage: 10Gi
127-
storageClassName: gp2 # NEEDS-CUSTOMER-INPUT
129+
storageClassName: efs-sc # NEEDS-CUSTOMER-INPUT
128130

129131
podAnnotations: { } # Add custom labels here
130132
podLabels: { } # Add custom labels here

code-analysis/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.2.3
19+
version: 0.2.4
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to
2323
# follow Semantic Versioning. They should reflect the version the application is using.
24-
# It is recommended to use it with quotes.
25-
appVersion: "1.0"
24+
# It is recommended to use it with quotes.
25+
appVersion: "1.0"

code-analysis/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ In the [values.yaml](./values.yaml) file, verify the following attribute:
1111
4. Resources: All `cpu` and `memory` values.
1212
5. Storage: All `storage` values to set storage size. As well as the `storageClass` to configure which storage will be used.
1313
6. Update values in `enterpriseConf`.
14-
15-
16-
## Releasing Charts:
17-
Charts will be released everytime "Chart.version" is updated. To trigger a release, upgrade the version.

code-analysis/templates/config.andromeda-nginx-conf.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ data:
2323
listen 80 default_server;
2424
server_name {{ .Values.base.host }} {{ .Values.andromeda.serviceName }}.{{ .Release.Namespace }}.svc.{{ .Values.base.clusterDomain }} localhost 127.0.0.1;
2525
26+
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
27+
2628
location /ce/ml/ {
2729
limit_req zone=limitmagiclinkcalls burst=10 nodelay;
2830
add_header Access-Control-Max-Age 3600;
2931
add_header Access-Control-Expose-Headers Content-Length;
3032
add_header Access-Control-Allow-Methods *;
3133
add_header Access-Control-Allow-Headers *;
3234
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'";
33-
add_header Strict-Transport-Security "max-age=63072000;";
3435
include uwsgi_params;
3536
uwsgi_pass unix:/home/ubuntu/install/code/andromeda-on-premise/andromeda-on-premise.sock;
3637
proxy_read_timeout 180s;
@@ -44,11 +45,23 @@ data:
4445
add_header Access-Control-Allow-Methods *;
4546
add_header Access-Control-Allow-Headers *;
4647
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'";
47-
add_header Strict-Transport-Security "max-age=63072000;";
4848
include uwsgi_params;
4949
uwsgi_pass unix:/home/ubuntu/install/code/andromeda-on-premise/andromeda-on-premise.sock;
50-
proxy_read_timeout 420s;
51-
client_max_body_size 800M;
50+
proxy_read_timeout 180s;
51+
client_max_body_size 100M;
52+
}
53+
54+
location /ce/mobilescans/ {
55+
limit_req zone=apilimit burst=40 nodelay;
56+
add_header Access-Control-Max-Age 3600;
57+
add_header Access-Control-Expose-Headers Content-Length;
58+
add_header Access-Control-Allow-Methods *;
59+
add_header Access-Control-Allow-Headers *;
60+
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'";
61+
include uwsgi_params;
62+
uwsgi_pass unix:/home/ubuntu/install/code/andromeda-on-premise/andromeda-on-premise.sock;
63+
proxy_read_timeout 180s;
64+
client_max_body_size 1000M;
5265
}
5366
5467
location /ac/ {
@@ -58,7 +71,6 @@ data:
5871
add_header Access-Control-Allow-Methods *;
5972
add_header Access-Control-Allow-Headers *;
6073
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'";
61-
add_header Strict-Transport-Security "max-age=63072000;";
6274
include uwsgi_params;
6375
uwsgi_pass unix:/home/ubuntu/install/code/andromeda-on-premise/andromeda-on-premise.sock;
6476
proxy_read_timeout 180s;

code-analysis/values.yaml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# --- My values below this
32
base:
43
isProduction: true
@@ -15,16 +14,16 @@ base:
1514
# values related to Privado's registry secrets & cron
1615
registry:
1716
# enables or disables usage of privado's Registry
18-
# disabling this would also mean that the organization
17+
# disabling this would also mean that the organization
1918
# would use self-maintained secrets with the deployment
20-
enable: true
19+
enable: true # NEEDS-CUSTOMER-INPUT use_privado_registry
2120
region: "{{ if .Values.base.isProduction }} {{ .Values.base.prodRegion }} {{ else }} {{ .Values.base.testRegion }} {{ end }}"
2221
roleName: ecr-token-helper
2322
serviceAccountName: sa-ecr-token-helper
2423
roleBindingName: ecr-token-helper
2524
cronName: ecr-token-helper
2625
cronSchedule: "0 */6 * * *"
27-
cronPodRestartPolicy: OnFailure
26+
cronPodRestartPolicy: OnFailure
2827
cronjobLabels: # key: value
2928
cronjobAnnotations: # key: value
3029
image:
@@ -36,8 +35,8 @@ registry:
3635
name: ecr-iam-secrets
3736
labels: # key: value
3837
annotations: # key: value
39-
AWS_ACCESS_KEY_ID:
40-
AWS_SECRET_ACCESS_KEY:
38+
AWS_ACCESS_KEY_ID: __AWS_ACCESS_KEY_ID__ # NEEDS-CUSTOMER-INPUT
39+
AWS_SECRET_ACCESS_KEY: __AWS_SECRET_ACCESS_KEY__ # NEEDS-CUSTOMER-INPUT
4140
dockerhub:
4241
# keep value of below flag as true if you are using images from dockerhub
4342
enable: false
@@ -52,7 +51,7 @@ autoupdates:
5251
# enables or disables autoupdates for deployment
5352
# supports ECR and DockerHub
5453
# registry.secrets need to be configured
55-
enable: true
54+
enable: true # NEEDS-CUSTOMER-INPUT enable_auto_updates
5655
annotationName: "checksum/image-sha256"
5756
roleName: updater-role
5857
serviceAccountName: updater-sa
@@ -88,7 +87,7 @@ ingress:
8887
# needs this value from customer for their ingressClass
8988
# since most annotation-based support for controllers is now deprecated
9089
ingressClassName: "" # NEEDS-CUSTOMER-INPUT
91-
annotations: # NEEDS-CUSTOMER-INPUT
90+
annotations: # NEEDS-CUSTOMER-INPUT
9291
kubernetes.io/ingress.class: alb # may receive deprecated warning
9392
alb.ingress.kubernetes.io/scheme: internet-facing
9493
alb.ingress.kubernetes.io/target-type: ip
@@ -97,9 +96,9 @@ ingress:
9796
# Values related to mongo.yaml
9897
mongo:
9998
statefulSetName: mongo
100-
statefulSetLabels: # key: value
101-
statefulSetAnnotations: # key: value
102-
image:
99+
statefulSetLabels: # key: value
100+
statefulSetAnnotations: # key: value
101+
image:
103102
name: percona/percona-server-mongodb
104103
tag: "5.0"
105104
runAsUser: 0
@@ -154,13 +153,13 @@ config:
154153
SCANNER_APP_INSPECTOR_IMAGE_URL:
155154

156155

157-
# Values related to andromeda.yaml
156+
# Values related to andromeda.yaml
158157
andromeda:
159158
deploymentName: andromeda
160-
deploymentLabels: # key: value
161-
deploymentAnnotations: # key: value
159+
deploymentLabels: # key: value
160+
deploymentAnnotations: # key: value
162161
replicas: 1
163-
image:
162+
image:
164163
name: "638117407428.dkr.ecr.{{ if .Values.base.isProduction }}{{ .Values.base.prodRegion }}{{ else }}{{ .Values.base.testRegion }}{{ end }}.amazonaws.com/andromeda"
165164
tag: latest
166165
podAppLabel: andromeda
@@ -177,7 +176,7 @@ andromeda:
177176
limits:
178177
cpu:
179178
memory:
180-
node: # overrides the global node configs
179+
node: # overrides the global node configs
181180
hostname: "" # if customer has NFS storage attached then keep this field empty else keep node's "hostname" having larger resources
182181
affinity:
183182
enable: false
@@ -253,10 +252,12 @@ andromeda:
253252
CUSTOMER_EMAIL_SSL_KEYFILE: "__EMAIL_SSL_KEY__"
254253

255254
CONFIG_AI_SERVICE_AVAILABLE: "false"
256-
CONFIG_AI_SERVICE_PATH: ""
255+
# Adjust AI service host URL to match your deployment configuration if necessary.
256+
# The ai-service prefix corresponds to the ai-service module service name.
257+
CONFIG_AI_SERVICE_PATH: http://ai-service.__AI_NAMESPACE__.svc.__AI_CLUSTER_DOMAIN__:8080
257258

258259

259-
# Values related to janus.yaml
260+
# Values related to janus.yaml
260261
# for each provisioned code-scanner
261262
janus:
262263
resources:
@@ -281,13 +282,13 @@ janus:
281282
mountPath: "/root/.gradle"
282283

283284

284-
# Values related to bishamonten.yaml
285+
# Values related to bishamonten.yaml
285286
bishamonten:
286287
deploymentName: bishamonten
287288
deploymentLabels: # key: value
288289
deploymentAnnotations: # key: value
289290
replicas: 1
290-
image:
291+
image:
291292
name: "638117407428.dkr.ecr.{{ if .Values.base.isProduction }}{{ .Values.base.prodRegion }}{{ else }}{{ .Values.base.testRegion }}{{ end }}.amazonaws.com/bishamonten"
292293
tag: latest
293294
podAppLabel: bishamonten
@@ -310,13 +311,13 @@ bishamonten:
310311
mountPath: "/home/bishamonten/build/{{ .Values.bishamonten.volumeHostConfig.subPath }}" # use with tpl
311312
config:
312313
hostConfig:
313-
host: '{{ .Values.base.protocol }}://{{ required "A valid .Values.base.host is required" .Values.base.host }}' # use with tpl
314+
host: '{{ .Values.base.protocol }}://{{ required "A valid .Values.base.host is required" .Values.base.host }}' # use with tpl
314315
accountHost: '{{ .Values.base.protocol }}://{{ required "A valid .Values.base.host is required" .Values.base.host }}' # use with tpl
315316
isPremiseVersion: 1
316317

317318

318319
mastervendor:
319-
enable: false
320+
enable: false # NEEDS-CUSTOMER-INPUT enable_master_vendor
320321
image:
321322
name: "638117407428.dkr.ecr.{{ if .Values.base.isProduction }}{{ .Values.base.prodRegion }}{{ else }}{{ .Values.base.testRegion }}{{ end }}.amazonaws.com/master-vendor-base-image"
322323
tag: latest

0 commit comments

Comments
 (0)