Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,23 @@ build-cache:
.PHONY: process-examples
process-examples: | $(EXAMPLES_BUILD_DIR)
@echo "Processing YAML examples with version substitutions..."
@# Generate sed script from all variables in vars.rst
@grep -E '^\.\. \|.*\| replace::' docs/common/vars.rst | \
sed 's/\.\. |\(.*\)| replace:: \(.*\)/s@|\1|@\2@g/' > /tmp/vars.sed
@find examples/templates -name "*.yaml" -type f | while read -r file; do \
@command -v envsubst >/dev/null || { echo "envsubst is required for process-examples"; exit 1; }
@vars_env=$$(mktemp); \
grep -E '^\.\. \|.*\| replace::' docs/common/vars.rst | while read -r line; do \
name=$$(printf '%s\n' "$$line" | sed -E 's/^\.\. \|([^|]+)\| replace:: .*/\1/' | tr '[:lower:]-' '[:upper:]_'); \
value=$$(printf '%s\n' "$$line" | sed -E 's/^\.\. \|[^|]+\| replace:: //'); \
escaped_value=$$(printf '%s\n' "$$value" | sed "s/'/'\\\\''/g"); \
printf "export %s='%s'\n" "$$name" "$$escaped_value"; \
done > "$$vars_env"; \
set -a; . "$$vars_env"; set +a; \
rm -f "$$vars_env"; \
find examples/templates -name "*.yaml" -type f | while read -r file; do \
echo "Processing $$file"; \
relative_path=$$(echo "$$file" | sed 's|^examples/templates/||'); \
output_dir="$(EXAMPLES_BUILD_DIR)/$$(dirname "$$relative_path")"; \
mkdir -p "$$output_dir"; \
sed -f /tmp/vars.sed "$$file" > "$(EXAMPLES_BUILD_DIR)/$$relative_path"; \
envsubst < "$$file" > "$(EXAMPLES_BUILD_DIR)/$$relative_path"; \
done
@rm -f /tmp/vars.sed
@echo "Generating complete configuration files..."
@# Generate complete.yaml files by concatenating numbered files in order
@find $(EXAMPLES_BUILD_DIR) -mindepth 1 -maxdepth 1 -type d | while read -r dir; do \
Expand Down
16 changes: 8 additions & 8 deletions examples/templates/host-device-rdma/10-nicclusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
spec:
sriovDevicePlugin:
image: sriov-network-device-plugin
repository: |sriovnetop-sriov-device-plugin-repository|
version: |sriovnetop-sriov-device-plugin-version|
repository: $SRIOVNETOP_SRIOV_DEVICE_PLUGIN_REPOSITORY
version: $SRIOVNETOP_SRIOV_DEVICE_PLUGIN_VERSION
config: |
{
"resourceList": [
Expand All @@ -22,16 +22,16 @@ spec:
}
nvIpam:
image: nvidia-k8s-ipam
repository: |nvidia-ipam-repository|
version: |nvidia-ipam-version|
repository: $NVIDIA_IPAM_REPOSITORY
version: $NVIDIA_IPAM_VERSION
imagePullSecrets: []
enableWebhook: false
secondaryNetwork:
cniPlugins:
image: plugins
repository: |cni-plugins-repository|
version: |cni-plugins-version|
repository: $CNI_PLUGINS_REPOSITORY
version: $CNI_PLUGINS_VERSION
multus:
image: multus-cni
repository: |multus-repository|
version: |multus-version|
repository: $MULTUS_REPOSITORY
version: $MULTUS_VERSION
24 changes: 12 additions & 12 deletions examples/templates/ipoib-rdma-shared/10-nicclusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ metadata:
spec:
ofedDriver:
image: doca-driver
repository: |doca-driver-repository|
version: |doca-driver-version|
repository: $DOCA_DRIVER_REPOSITORY
version: $DOCA_DRIVER_VERSION
rdmaSharedDevicePlugin:
image: k8s-rdma-shared-dev-plugin
repository: |k8s-rdma-shared-dev-plugin-repository|
version: |k8s-rdma-shared-dev-plugin-version|
repository: $K8S_RDMA_SHARED_DEV_PLUGIN_REPOSITORY
version: $K8S_RDMA_SHARED_DEV_PLUGIN_VERSION
config: |
{
"configList": [
Expand Down Expand Up @@ -39,20 +39,20 @@ spec:
}
nvIpam:
image: nvidia-k8s-ipam
repository: |nvidia-ipam-repository|
version: |nvidia-ipam-version|
repository: $NVIDIA_IPAM_REPOSITORY
version: $NVIDIA_IPAM_VERSION
imagePullSecrets: []
enableWebhook: false
secondaryNetwork:
cniPlugins:
image: plugins
repository: |cni-plugins-repository|
version: |cni-plugins-version|
repository: $CNI_PLUGINS_REPOSITORY
version: $CNI_PLUGINS_VERSION
multus:
image: multus-cni
repository: |multus-repository|
version: |multus-version|
repository: $MULTUS_REPOSITORY
version: $MULTUS_VERSION
ipoib:
image: ipoib-cni
repository: |ipoib-cni-repository|
version: |ipoib-cni-version|
repository: $IPOIB_CNI_REPOSITORY
version: $IPOIB_CNI_VERSION
16 changes: 8 additions & 8 deletions examples/templates/macvlan-rdma-shared/10-nicclusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
spec:
rdmaSharedDevicePlugin:
image: k8s-rdma-shared-dev-plugin
repository: |k8s-rdma-shared-dev-plugin-repository|
version: |k8s-rdma-shared-dev-plugin-version|
repository: $K8S_RDMA_SHARED_DEV_PLUGIN_REPOSITORY
version: $K8S_RDMA_SHARED_DEV_PLUGIN_VERSION
config: |
{
"configList": [
Expand All @@ -21,16 +21,16 @@ spec:
}
nvIpam:
image: nvidia-k8s-ipam
repository: |nvidia-ipam-repository|
version: |nvidia-ipam-version|
repository: $NVIDIA_IPAM_REPOSITORY
version: $NVIDIA_IPAM_VERSION
imagePullSecrets: []
enableWebhook: false
secondaryNetwork:
cniPlugins:
image: plugins
repository: |cni-plugins-repository|
version: |cni-plugins-version|
repository: $CNI_PLUGINS_REPOSITORY
version: $CNI_PLUGINS_VERSION
multus:
image: multus-cni
repository: |multus-repository|
version: |multus-version|
repository: $MULTUS_REPOSITORY
version: $MULTUS_VERSION
16 changes: 8 additions & 8 deletions examples/templates/sriov-ib-rdma/10-nicclusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ metadata:
spec:
ofedDriver:
image: doca-driver
repository: |doca-driver-repository|
version: |doca-driver-version|
repository: $DOCA_DRIVER_REPOSITORY
version: $DOCA_DRIVER_VERSION
nvIpam:
image: nvidia-k8s-ipam
repository: |nvidia-ipam-repository|
version: |nvidia-ipam-version|
repository: $NVIDIA_IPAM_REPOSITORY
version: $NVIDIA_IPAM_VERSION
imagePullSecrets: []
enableWebhook: false
secondaryNetwork:
cniPlugins:
image: plugins
repository: |cni-plugins-repository|
version: |cni-plugins-version|
repository: $CNI_PLUGINS_REPOSITORY
version: $CNI_PLUGINS_VERSION
multus:
image: multus-cni
repository: |multus-repository|
version: |multus-version|
repository: $MULTUS_REPOSITORY
version: $MULTUS_VERSION
12 changes: 6 additions & 6 deletions examples/templates/sriov-network-rdma/10-nicclusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
spec:
nvIpam:
image: nvidia-k8s-ipam
repository: |nvidia-ipam-repository|
version: |nvidia-ipam-version|
repository: $NVIDIA_IPAM_REPOSITORY
version: $NVIDIA_IPAM_VERSION
enableWebhook: false
secondaryNetwork:
cniPlugins:
image: plugins
repository: |cni-plugins-repository|
version: |cni-plugins-version|
repository: $CNI_PLUGINS_REPOSITORY
version: $CNI_PLUGINS_VERSION
multus:
image: multus-cni
repository: |multus-repository|
version: |multus-version|
repository: $MULTUS_REPOSITORY
version: $MULTUS_VERSION
Loading