Skip to content
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

Add partial rebuild disable and various fixes #471

Merged
merged 5 commits into from
Apr 10, 2024
Merged
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
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pipeline {
}
agent { label 'nixos-mayastor' }
steps {
sh 'printenv'
sh './scripts/nix/git-submodule-init.sh --force'
sh './scripts/release.sh --skip-publish --debug --build-bins'
}
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Usage:
{{ include "csi_node_init_containers" . }}
*/}}
{{- define "csi_node_init_containers" -}}
{{- if .Values.csi.node.initContainers.enabled }}
{{- if (.Values.csi.node.initContainers).enabled }}
{{- include "render" (dict "value" .Values.csi.node.initContainers.containers "context" $) | nindent 8 }}
{{- end }}
{{- end -}}
Expand Down Expand Up @@ -250,4 +250,4 @@ Usage:
{{ $param | quote }}: {{ $val | quote }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ spec:
- "--ansi-colors={{ .Values.base.logging.color }}"
- "--create-volume-limit={{ .Values.agents.core.maxCreateVolume }}"{{ if .Values.agents.core.maxRebuilds }}
- "--max-rebuilds={{ .Values.agents.core.maxRebuilds }}"{{ end }}
{{- if .Values.agents.core.partialRebuildDisable }}
- "--disable-partial-rebuild"
{{- end }}
ports:
- containerPort: 50051
env:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/mayastor/csi/csi-node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
fieldPath: status.podIP
- name: RUST_BACKTRACE
value: "1"
{{- if .Values.csi.node.mkfs_args.xfs }}
{{- if (.Values.csi.node.mkfs_args).xfs }}
- name: MKFS_XFS_ARGS
value: {{ .Values.csi.node.mkfs_args.xfs | quote }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ agents:
# faster depending on the log size. Otherwise, the replica will be fully rebuilt.
# A blank value "" means internally derived value will be used.
partialRebuildWaitPeriod: ""
# Set to true to disable partial rebuilds.
partialRebuildDisable:
# The maximum number of system-wide rebuilds permitted at any given time.
# If set to an empty string, there are no limits.
maxRebuilds: ""
Expand Down
2 changes: 1 addition & 1 deletion dependencies/control-plane
Submodule control-plane updated 34 files
+2 −0 Cargo.lock
+4 −4 control-plane/agents/src/bin/core/controller/io_engine/v0/translation.rs
+7 −1 control-plane/agents/src/bin/core/controller/reconciler/nexus/mod.rs
+1 −1 control-plane/agents/src/bin/core/controller/reconciler/volume/hot_spare.rs
+10 −1 control-plane/agents/src/bin/core/controller/registry.rs
+5 −1 control-plane/agents/src/bin/core/controller/scheduling/pool.rs
+1 −1 control-plane/agents/src/bin/core/controller/scheduling/volume_policy/mod.rs
+13 −8 control-plane/agents/src/bin/core/controller/scheduling/volume_policy/node.rs
+2 −2 control-plane/agents/src/bin/core/controller/scheduling/volume_policy/pool.rs
+5 −0 control-plane/agents/src/bin/core/main.rs
+7 −5 control-plane/agents/src/bin/core/nexus/operations_helper.rs
+7 −2 control-plane/agents/src/bin/core/node/service.rs
+16 −1 control-plane/agents/src/bin/core/node/wrapper.rs
+124 −8 control-plane/agents/src/bin/core/tests/rebuild/mod.rs
+1 −0 control-plane/agents/src/bin/core/tests/volume/mod.rs
+3 −3 control-plane/agents/src/bin/core/tests/volume/snapshot.rs
+50 −6 control-plane/agents/src/bin/core/volume/operations.rs
+2 −1 control-plane/agents/src/bin/ha/node/detector.rs
+11 −7 control-plane/agents/src/bin/ha/node/server.rs
+9 −1 control-plane/csi-driver/src/bin/controller/controller.rs
+15 −7 control-plane/csi-driver/src/bin/node/filesystem_ops.rs
+18 −0 control-plane/csi-driver/src/context.rs
+7 −0 control-plane/stor-port/src/types/v0/transport/nexus.rs
+13 −2 deployer/src/infra/csi-driver/node.rs
+17 −0 deployer/src/lib.rs
+1 −0 terraform/cluster/mod/k8s/repo.sh
+10 −3 tests/bdd/features/node/label/test_label_unlabel_node.py
+65 −34 tests/bdd/features/volume/topology/node-topology.feature
+4 −5 tests/bdd/features/volume/topology/test_feature.py
+197 −61 tests/bdd/features/volume/topology/test_node_topology.py
+9 −16 tests/bdd/features/volume/topology/test_pool_topology.py
+2 −0 tests/io-engine/Cargo.toml
+346 −0 tests/io-engine/tests/upgrade.rs
+29 −6 utils/deployer-cluster/src/lib.rs
4 changes: 2 additions & 2 deletions scripts/helm/publish-chart-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ if [ -n "$CHECK_BRANCH" ]; then
elif [ -n "$DEVELOP_TO_REL" ]; then
if [ "$CHART_VERSION" == "0.0.0" ]; then
output_yaml "$APP_TAG" "$APP_TAG" "${CHECK_BRANCH////-}" "Always"
else
die "ERROR: source chart is not from develop branch"
elif [ "$CHART_VERSION" != "$APP_TAG" ]; then
die "ERROR: Already on $CHART_VERSION which does not match $APP_TAG"
fi
exit 0
fi
Expand Down
17 changes: 16 additions & 1 deletion scripts/helm/test-publish-chart-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@ NEW_CHART_VERSION: $NEW_CHART_VERSION
NEW_CHART_APP_VERSION: $NEW_CHART_APP_VERSION
EOF
elif [ -n "$DEVELOP_TO_REL" ]; then
cat <<EOF
if [ -n "$NEW_CHART_VERSION" ]; then
cat <<EOF
APP_TAG: $APP_TAG
CHART_VERSION: $CHART_VERSION
CHART_APP_VERSION: $CHART_APP_VERSION
NEW_CHART_VERSION: $NEW_CHART_VERSION
NEW_CHART_APP_VERSION: $NEW_CHART_APP_VERSION
EOF
else
cat <<EOF
APP_TAG: $APP_TAG
CHART_VERSION: $CHART_VERSION
CHART_APP_VERSION: $CHART_APP_VERSION
EOF
fi
else
cat <<EOF
APP_TAG: $APP_TAG
Expand Down Expand Up @@ -267,6 +275,13 @@ NEW_CHART_VERSION=2.0.1
NEW_CHART_APP_VERSION=2.0.1
test_one "Upgrade from develop to release"

CHECK_BRANCH=release/2.0.1
DEVELOP_TO_REL=1
APP_TAG=2.0.1
CHART_VERSION=2.0.1
CHART_APP_VERSION=2.0.1
test_one "Already on release, no new version"

APP_TAG=2.0.0-a.0
CHART_VERSION=2.0.0
CHART_APP_VERSION=2.0.0
Expand Down
16 changes: 9 additions & 7 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CI=${CI-}

set -euo pipefail
trap 'cleanup_and_exit "$?"' EXIT

# Test if the image already exists in dockerhub
dockerhub_tag_exists() {
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 1>/dev/null 2>&1
Expand All @@ -34,7 +34,7 @@ cleanup_and_exit() {
local -r status=${1}

# Remove helm subcharts, if `helm dependency update` was run.
if [ "$_helm_dependencies_updated" = "true" ]; then
if [ "$HELM_DEPS_UPDATED" = "true" ]; then
echo "Cleaning up helm chart dependencies..."
for dep_chart in "$CHART_DIR"/charts/*; do
if [ "$dep_chart" = "$CHART_DIR/charts/crds" ]; then
Expand Down Expand Up @@ -99,6 +99,9 @@ DEFAULT_BINARIES="kubectl-plugin"
BUILD_BINARIES=
BIN_TARGET_PLAT="linux-musl"
BINARY_OUT_LINK="."
# This variable will be used to flag if the helm chart dependencies have been
# been updated.
HELM_DEPS_UPDATED="false"

# Check if all needed tools are installed
curl --version >/dev/null
Expand Down Expand Up @@ -192,6 +195,8 @@ while [ "$#" -gt 0 ]; do
esac
done

trap 'cleanup_and_exit "$?"' EXIT

cd $SCRIPTDIR/..

if [ -z "$IMAGES" ]; then
Expand Down Expand Up @@ -243,9 +248,6 @@ if [ -n "$BUILD_BINARIES" ]; then
done
fi

# This variable will be used to flag if the helm chart dependencies have been
# been updated.
_helm_dependencies_updated="false"
for name in $IMAGES; do
image_basename=$($NIX_EVAL -f . images.$BUILD_TYPE.$name.imageName | xargs)
image=$image_basename
Expand All @@ -257,7 +259,7 @@ for name in $IMAGES; do
fi
fi

if [ "$_helm_dependencies_updated" = "false" ]; then
if [ "$HELM_DEPS_UPDATED" = "false" ]; then
for helm_chart_user in ${IMAGES_THAT_REQUIRE_HELM_CHART[@]}; do
if [ "$name" = "$helm_chart_user" ]; then
echo "Updating helm chart dependencies..."
Expand All @@ -276,7 +278,7 @@ for name in $IMAGES; do
done

# Set flag to true
_helm_dependencies_updated="true"
HELM_DEPS_UPDATED="true"
break
fi
done
Expand Down
Loading