Skip to content

Commit e3c9245

Browse files
AhmedSeemalKpvishwanvhpintelsgurunatjaswanth8888
authored
Hotfix v1.5.1 (#70)
Signed-off-by: amberjain1 <amber.jain@intel.com> Signed-off-by: psurabh <pradeep.surabhi@intel.com> Signed-off-by: mdfaheem-intel <mohammad.faheem@intel.com> Signed-off-by: vivekrsintc <vivek.rs@intel.com> Signed-off-by: Github Actions <actions@github.com> Co-authored-by: pvishwan <pramodh.vishwanath@intel.com> Co-authored-by: vhpintel <vijay.kumar.h.p@intel.com> Co-authored-by: sgurunat <gurunath.s@intel.com> Co-authored-by: jaswanth8888 <jaswanth.karani@intel.com> Co-authored-by: sandeshk-intel <sandesh.kumar.s@intel.com> Co-authored-by: vinayK34 <vinay3.kumar@intel.com>
1 parent dcff633 commit e3c9245

File tree

9 files changed

+182
-4
lines changed

9 files changed

+182
-4
lines changed

core/helm-charts/genai-gateway/templates/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ spec:
6969
{{- range $key, $value := .Values.env }}
7070
- name: {{ $key }}
7171
value: "{{ $value }}"
72+
{{- end }}
73+
{{- if .Values.proxy.http_proxy }}
74+
- name: http_proxy
75+
value: {{ .Values.proxy.http_proxy | quote }}
76+
- name: https_proxy
77+
value: {{ .Values.proxy.https_proxy | quote }}
78+
- name: HTTP_PROXY
79+
value: {{ .Values.proxy.http_proxy | quote }}
80+
- name: HTTPS_PROXY
81+
value: {{ .Values.proxy.https_proxy | quote }}
82+
- name: no_proxy
83+
value: {{ .Values.proxy.no_proxy | quote }}
84+
- name: NO_PROXY
85+
value: {{ .Values.proxy.no_proxy | quote }}
7286
{{- end }}
7387
args:
7488
- "--config"

core/helm-charts/genai-gateway/templates/postgres-backup-cronjob.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ spec:
2323
value: "{{ .Values.backup.s3.secretAccessKey }}"
2424
- name: AWS_DEFAULT_REGION
2525
value: "{{ .Values.backup.s3.region }}"
26+
{{- if .Values.proxy.http_proxy }}
27+
- name: http_proxy
28+
value: {{ .Values.proxy.http_proxy | quote }}
29+
- name: https_proxy
30+
value: {{ .Values.proxy.https_proxy | quote }}
31+
- name: HTTP_PROXY
32+
value: {{ .Values.proxy.http_proxy | quote }}
33+
- name: HTTPS_PROXY
34+
value: {{ .Values.proxy.https_proxy | quote }}
35+
- name: no_proxy
36+
value: {{ .Values.proxy.no_proxy | quote }}
37+
- name: NO_PROXY
38+
value: {{ .Values.proxy.no_proxy | quote }}
39+
{{- end }}
2640
command:
2741
- "/bin/bash"
2842
- "-c"

core/helm-charts/genai-gateway/templates/postgres-restore-job.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ spec:
2020
value: "{{ .Values.backup.s3.secretAccessKey }}"
2121
- name: AWS_DEFAULT_REGION
2222
value: "{{ .Values.backup.s3.region }}"
23+
{{- if .Values.proxy.http_proxy }}
24+
- name: http_proxy
25+
value: {{ .Values.proxy.http_proxy | quote }}
26+
- name: https_proxy
27+
value: {{ .Values.proxy.https_proxy | quote }}
28+
- name: HTTP_PROXY
29+
value: {{ .Values.proxy.http_proxy | quote }}
30+
- name: HTTPS_PROXY
31+
value: {{ .Values.proxy.https_proxy | quote }}
32+
- name: no_proxy
33+
value: {{ .Values.proxy.no_proxy | quote }}
34+
- name: NO_PROXY
35+
value: {{ .Values.proxy.no_proxy | quote }}
36+
{{- end }}
2337
command:
2438
- "/bin/bash"
2539
- "-c"

core/helm-charts/genai-gateway/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ redis:
157157
- key: "node-role.kubernetes.io/master"
158158
operator: "Exists"
159159
effect: "NoSchedule"
160+
proxy:
161+
http_proxy: ""
162+
https_proxy: ""
163+
no_proxy: ""
160164
backup:
161165
enabled: false
162166
postgresBackupSchedule: "0 2 * * *" # Every day at 2am

core/playbooks/deploy-genai-gateway.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@
122122
--set postgresql.auth.password={{ postgresql_password }}
123123
--set postgresql.auth.postgresPassword={{ postgresql_password }}
124124
--set redis.auth.password={{ redis_password }}
125+
{% if env_proxy is defined and env_proxy.http_proxy | default('') != '' %}
126+
--set proxy.http_proxy="{{ env_proxy.http_proxy }}"
127+
{% if env_proxy.https_proxy | default('') != '' %}
128+
--set proxy.https_proxy="{{ env_proxy.https_proxy }}"
129+
{% endif %}
130+
{% if env_proxy.no_proxy | default('') != '' %}
131+
--set proxy.no_proxy="{{ env_proxy.no_proxy | replace(',', '\\,') }}"
132+
{% endif %}
133+
{% endif %}
125134
{% if kubernetes_platform == 'openshift' %}
126135
--set route.enabled=true
127136
--set route.host={{ secret_name }}

core/playbooks/deploy-inference-models.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,17 @@
485485
containers:
486486
- name: keycloak-setup
487487
image: ubuntu:22.04
488+
env: >-
489+
{{
490+
[
491+
{'name': 'http_proxy', 'value': env_proxy.http_proxy | default('')},
492+
{'name': 'https_proxy', 'value': env_proxy.https_proxy | default('')},
493+
{'name': 'HTTP_PROXY', 'value': env_proxy.http_proxy | default('')},
494+
{'name': 'HTTPS_PROXY', 'value': env_proxy.https_proxy | default('')},
495+
{'name': 'no_proxy', 'value': env_proxy.no_proxy | default('')},
496+
{'name': 'NO_PROXY', 'value': env_proxy.no_proxy | default('')}
497+
] if (env_proxy is defined and env_proxy.http_proxy | default('') != '') else []
498+
}}
488499
command: ["/bin/bash", "-c"]
489500
args:
490501
- |
@@ -601,10 +612,14 @@
601612
- name: Set proxy args if proxy is defined
602613
set_fact:
603614
helm_proxy_args: >-
604-
{% if env_proxy is defined %}
605-
--set global.http_proxy="{{ env_proxy.http_proxy | default('') | replace(',', '\\,') }}"
606-
--set global.https_proxy="{{ env_proxy.https_proxy | default('') | replace(',', '\\,') }}"
607-
--set global.no_proxy="{{ env_proxy.no_proxy | default('') | replace(',', '\\,') }}"
615+
{% if env_proxy is defined and env_proxy.http_proxy | default('') != '' %}
616+
--set global.http_proxy="{{ env_proxy.http_proxy | replace(',', '\\,') }}"
617+
{% if env_proxy.https_proxy | default('') != '' %}
618+
--set global.https_proxy="{{ env_proxy.https_proxy | replace(',', '\\,') }}"
619+
{% endif %}
620+
{% if env_proxy.no_proxy | default('') != '' %}
621+
--set global.no_proxy="{{ env_proxy.no_proxy | replace(',', '\\,') }}"
622+
{% endif %}
608623
{% else %}
609624
{{ '' }}
610625
{% endif %}

core/playbooks/deploy-keycloak-tls-cert.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,17 @@
512512
containers:
513513
- name: keycloak-setup
514514
image: ubuntu:22.04
515+
env: >-
516+
{{
517+
[
518+
{'name': 'http_proxy', 'value': env_proxy.http_proxy | default('')},
519+
{'name': 'https_proxy', 'value': env_proxy.https_proxy | default('')},
520+
{'name': 'HTTP_PROXY', 'value': env_proxy.http_proxy | default('')},
521+
{'name': 'HTTPS_PROXY', 'value': env_proxy.https_proxy | default('')},
522+
{'name': 'no_proxy', 'value': env_proxy.no_proxy | default('')},
523+
{'name': 'NO_PROXY', 'value': env_proxy.no_proxy | default('')}
524+
] if (env_proxy is defined and env_proxy.http_proxy | default('') != '') else []
525+
}}
515526
command: ["/bin/bash", "-c"]
516527
args:
517528
- |

core/roles/inference-tools/tasks/main.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,92 @@
1212
name: kubernetes
1313
state: present
1414
become: true
15+
ignore_errors: true
16+
register: pip_install_result
17+
tags: always
18+
- name: Install Kubernetes Python SDK Fallback
19+
ansible.builtin.pip:
20+
name: kubernetes
21+
state: present
22+
extra_args: "--break-system-packages"
23+
become: true
24+
when: pip_install_result is failed
25+
tags: always
26+
- name: Deploy fix script for kubernetes SDK no_proxy bug
27+
ansible.builtin.copy:
28+
dest: /tmp/_fix_k8s_no_proxy.py
29+
mode: '0644'
30+
content: |
31+
import re, sys, os
32+
path = sys.argv[1]
33+
with open(path, 'r') as f:
34+
original = f.read()
35+
# Remove the duplicate self.no_proxy = None that appears after the no_proxy
36+
# env-loading block (bug introduced in kubernetes SDK >= 34.x by code generator).
37+
# Pattern: the env-loading line is followed within 3 lines by a bare self.no_proxy = None
38+
fixed = re.sub(
39+
r'(if os\.getenv\("no_proxy"\)[^\n]+\n(?:.*\n){1,3}?)(\s+self\.no_proxy = None\n)',
40+
r'\1',
41+
original
42+
)
43+
if fixed == original:
44+
print("OK: no duplicate no_proxy line found, nothing to do")
45+
sys.exit(0)
46+
with open(path, 'w') as f:
47+
f.write(fixed)
48+
print("FIXED: removed duplicate self.no_proxy = None from " + path)
49+
sys.exit(2)
50+
become: true
51+
tags: always
52+
- name: Fix kubernetes SDK no_proxy bug (duplicate self.no_proxy = None after env-loading block)
53+
ansible.builtin.shell: |
54+
set -e
55+
KUBE_CFG=$(python3 -c "import kubernetes, os; print(os.path.join(os.path.dirname(kubernetes.__file__), 'client', 'configuration.py'))" 2>/dev/null) || exit 0
56+
python3 /tmp/_fix_k8s_no_proxy.py "$KUBE_CFG"
57+
args:
58+
executable: /bin/bash
59+
become: true
60+
register: _no_proxy_fix
61+
changed_when: _no_proxy_fix.rc == 2
62+
failed_when: _no_proxy_fix.rc not in [0, 2]
63+
tags: always
64+
- name: Deploy fix script for kubernetes SDK no_proxy bug
65+
ansible.builtin.copy:
66+
dest: /tmp/_fix_k8s_no_proxy.py
67+
mode: '0644'
68+
content: |
69+
import re, sys, os
70+
path = sys.argv[1]
71+
with open(path, 'r') as f:
72+
original = f.read()
73+
# Remove the duplicate self.no_proxy = None that appears after the no_proxy
74+
# env-loading block (bug introduced in kubernetes SDK >= 34.x by code generator).
75+
# Pattern: the env-loading line is followed within 3 lines by a bare self.no_proxy = None
76+
fixed = re.sub(
77+
r'(if os\.getenv\("no_proxy"\)[^\n]+\n(?:.*\n){1,3}?)(\s+self\.no_proxy = None\n)',
78+
r'\1',
79+
original
80+
)
81+
if fixed == original:
82+
print("OK: no duplicate no_proxy line found, nothing to do")
83+
sys.exit(0)
84+
with open(path, 'w') as f:
85+
f.write(fixed)
86+
print("FIXED: removed duplicate self.no_proxy = None from " + path)
87+
sys.exit(2)
88+
become: true
89+
tags: always
90+
- name: Fix kubernetes SDK no_proxy bug (duplicate self.no_proxy = None after env-loading block)
91+
ansible.builtin.shell: |
92+
set -e
93+
KUBE_CFG=$(python3 -c "import kubernetes, os; print(os.path.join(os.path.dirname(kubernetes.__file__), 'client', 'configuration.py'))" 2>/dev/null) || exit 0
94+
python3 /tmp/_fix_k8s_no_proxy.py "$KUBE_CFG"
95+
args:
96+
executable: /bin/bash
97+
become: true
98+
register: _no_proxy_fix
99+
changed_when: _no_proxy_fix.rc == 2
100+
failed_when: _no_proxy_fix.rc not in [0, 2]
15101
tags: always
16102
- name: Install Deployment Client
17103
ansible.builtin.shell: |

core/roles/utils/tasks/get_optimized_cpu_topology.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@
4343
containers:
4444
- name: ubuntu
4545
image: ubuntu:22.04
46+
env: >-
47+
{{
48+
[
49+
{'name': 'http_proxy', 'value': env_proxy.http_proxy | default('')},
50+
{'name': 'https_proxy', 'value': env_proxy.https_proxy | default('')},
51+
{'name': 'HTTP_PROXY', 'value': env_proxy.http_proxy | default('')},
52+
{'name': 'HTTPS_PROXY', 'value': env_proxy.https_proxy | default('')},
53+
{'name': 'no_proxy', 'value': env_proxy.no_proxy | default('')},
54+
{'name': 'NO_PROXY', 'value': env_proxy.no_proxy | default('')}
55+
] if (env_proxy is defined and env_proxy.http_proxy | default('') != '') else []
56+
}}
4657
command: ["/bin/sh", "-c"]
4758
args:
4859
- |

0 commit comments

Comments
 (0)