Skip to content

Commit

Permalink
[bitnami/milvus] feat: ♻️ Use os-shell for config generation (#31460)
Browse files Browse the repository at this point in the history
* [bitnami/milvus] feat: ♻️ Use os-shell for config generation

Signed-off-by: Javier J. Salmerón García <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <[email protected]>

* chore: ♻️ Remove unnecessary extra cp operation

Signed-off-by: Javier J. Salmerón García <[email protected]>

* Update bitnami/milvus/templates/_helpers.tpl

Co-authored-by: Juan Ariza Toledano <[email protected]>
Signed-off-by: Javier J. Salmerón García <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <[email protected]>

* chore: 🐛 Fix incorrect empty-dir folder

Signed-off-by: Javier J. Salmerón García <[email protected]>

* chore: ♻️ Remove extra shebang

Signed-off-by: Javier J. Salmerón García <[email protected]>

---------

Signed-off-by: Javier J. Salmerón García <[email protected]>
Signed-off-by: Bitnami Containers <[email protected]>
Co-authored-by: Bitnami Containers <[email protected]>
Co-authored-by: Juan Ariza Toledano <[email protected]>
  • Loading branch information
3 people authored Jan 20, 2025
1 parent 422b3a7 commit fcf8bff
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
8 changes: 6 additions & 2 deletions bitnami/milvus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 10.1.6 (2025-01-17)
## 10.1.7 (2025-01-20)

* [bitnami/milvus] Release 10.1.6 ([#31432](https://github.com/bitnami/charts/pull/31432))
* [bitnami/milvus] feat: :recycle: Use os-shell for config generation ([#31460](https://github.com/bitnami/charts/pull/31460))

## <small>10.1.6 (2025-01-17)</small>

* [bitnami/milvus] Release 10.1.6 (#31432) ([e006414](https://github.com/bitnami/charts/commit/e0064149e9a00d882be4c891bef34dbd055734c5)), closes [#31432](https://github.com/bitnami/charts/issues/31432)

## <small>10.1.5 (2025-01-14)</small>

Expand Down
2 changes: 1 addition & 1 deletion bitnami/milvus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ maintainers:
name: milvus
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/milvus
version: 10.1.6
version: 10.1.7
32 changes: 23 additions & 9 deletions bitnami/milvus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ Init container definition for waiting for the database to be ready
- bash
- -ec
- |
#!/bin/bash
retry_while() {
local -r cmd="${1:?cmd is missing}"
local -r retries="${2:-12}"
Expand Down Expand Up @@ -797,7 +796,6 @@ Init container definition for waiting for the database to be ready
- bash
- -ec
- |
#!/bin/bash
retry_while() {
local -r cmd="${1:?cmd is missing}"
local -r retries="${2:-12}"
Expand Down Expand Up @@ -870,7 +868,6 @@ Init container definition for waiting for the database to be ready
- bash
- -ec
- |
#!/bin/bash
retry_while() {
local -r cmd="${1:?cmd is missing}"
local -r retries="${2:-12}"
Expand Down Expand Up @@ -937,7 +934,6 @@ Init container definition for waiting for the database to be ready
- bash
- -ec
- |
#!/bin/bash
retry_while() {
local -r cmd="${1:?cmd is missing}"
local -r retries="${2:-12}"
Expand Down Expand Up @@ -980,10 +976,32 @@ Init container definition for waiting for the database to be ready
Init container definition for waiting for the database to be ready
*/}}
{{- define "milvus.prepareMilvusInitContainer" -}}
- name: copy-default-configuration
image: {{ template "milvus.image" .context }}
imagePullPolicy: {{ .context.Values.milvus.image.pullPolicy }}
{{- $block := index .context.Values .component }}
{{- if $block.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" $block.containerSecurityContext "context" .context) | nindent 4 }}
{{- end }}
{{- if $block.resources }}
resources: {{- toYaml $block.resources | nindent 4 }}
{{- else if ne $block.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" $block.resourcesPreset) | nindent 4 }}
{{- end }}
command:
- bash
- -ec
- |
echo "Copying milvus default configuration"
cp -r /opt/bitnami/milvus/configs/. /bitnami/milvus/rendered-conf
volumeMounts:
- name: empty-dir
mountPath: /bitnami/milvus/rendered-conf
subPath: app-rendered-conf-dir
# This init container renders and merges the Milvus configuration files.
# We need to use a volume because we're working with ReadOnlyRootFilesystem
- name: prepare-milvus
image: {{ template "milvus.image" .context }}
image: {{ template "milvus.wait-container.image" .context }}
imagePullPolicy: {{ .context.Values.milvus.image.pullPolicy }}
{{- $block := index .context.Values .component }}
{{- if $block.containerSecurityContext.enabled }}
Expand All @@ -998,10 +1016,6 @@ Init container definition for waiting for the database to be ready
- bash
- -ec
- |
#!/bin/bash
# Remove previously existing files and copy the default configuration files to ensure they are present in mounted configs directory
rm -rf /bitnami/milvus/rendered-conf/*
cp -r /opt/bitnami/milvus/configs/. /bitnami/milvus/rendered-conf
# Build final milvus.yaml with the sections of the different files
find /bitnami/milvus/conf -type f -name *.yaml -print0 | sort -z | xargs -0 yq eval-all '. as $item ireduce ({}; . * $item )' /bitnami/milvus/rendered-conf/milvus.yaml > /bitnami/milvus/rendered-conf/pre-render-config_00.yaml

Expand Down

0 comments on commit fcf8bff

Please sign in to comment.