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

Tests refactoring (using docker compose) and upgrade clickhouse-server to 24.8 in examples and test manifests #1556

Open
wants to merge 22 commits into
base: 0.24.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c93e88a
complex refactoring for base clickhouse version 24.8 and fix in tests…
Slach Nov 10, 2024
4a219cb
fix for test_metrics_exporter.py
Slach Nov 10, 2024
f68921a
merge with 0.24.1
Slach Nov 10, 2024
cfa56a0
fix run_tests.yaml failures
Slach Nov 10, 2024
aef91cd
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
34d9ec2
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
e8737e9
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
ef961ae
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
5baf407
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
2d85948
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
298e13d
refactoring run_tests.yaml to allow parallel test executions
Slach Nov 10, 2024
1964167
why keeper in pending state?
Slach Nov 11, 2024
7478631
just run test_operator
Slach Nov 11, 2024
600d0d6
merge 0.24.1 into tests_refactoring
Slach Nov 21, 2024
9488eff
fix test_011_2* failures, when readonly profile, doesn't allow change…
Slach Nov 21, 2024
6276e8a
fix for test_keeper.py
Slach Nov 21, 2024
e818693
remote receive_timeout for test_029
Slach Nov 21, 2024
fcc6c25
debug run_tests.yaml
Slach Nov 21, 2024
95a39a1
debug run_tests.yaml
Slach Nov 21, 2024
e6576de
update PROMETHEUS_OPERATOR_BRANCH to 0.78.2
Slach Nov 21, 2024
adeba51
use altinity/clickhouse-server:24.3.12.76.altinitystable
Slach Nov 22, 2024
1bede28
merges with 0.24.1
Slach Nov 26, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/check_helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
driver: docker
container-runtime: containerd
kubernetes-version: v1.31.0
kubernetes-version: v1.31.2
cpus: max
memory: max

Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
driver: docker
container-runtime: containerd
kubernetes-version: v1.31.0
kubernetes-version: v1.31.2
cpus: max
memory: max

Expand All @@ -66,6 +66,15 @@ jobs:
minikube image load operator.tar
minikube image load metrics-exporter.tar

- name: Deploy prometheus
run: |
cp ./deploy/prometheus/prometheus-sensitive-data.example.sh ./deploy/prometheus/prometheus-sensitive-data.sh
NO_WAIT=1 bash ./deploy/prometheus/create-prometheus.sh

- name: Deploy minio
run: |
NO_WAIT=1 bash ./deploy/minio/create-minio.sh

- name: Run Tests
id: run-tests
continue-on-error: true
Expand Down Expand Up @@ -93,12 +102,22 @@ jobs:
test_mode="--test-to-end"
fi

~/venv/qa/bin/python3 ./tests/regression.py --only=/regression/e2e.test_operator/${ONLY} $test_mode --trim-results on -o short --native --log ./tests/raw.log
for test_file in ./tests/e2e/test_operator*.py; do
name=$(basename "$test_file" .py | sed 's/^test_//')
run_cmd="~/venv/qa/bin/python3 ./tests/regression.py --only=/regression/e2e?test_${name}/${ONLY} $test_mode --trim-results on -o short --native --log ./tests/raw_${name}.log && "
run_cmd+="~/venv/qa/bin/tfs --no-colors transform compact ./tests/raw_${name}.log ./tests/compact_${name}.log.txt && "
run_cmd+="~/venv/qa/bin/tfs --no-colors transform nice ./tests/raw_${name}.log ./tests/nice_${name}.log.txt && "
run_cmd+="~/venv/qa/bin/tfs --no-colors transform short ./tests/raw_${name}.log ./tests/short_${name}.log.txt && "
run_cmd+="bash -xec '~/venv/qa/bin/tfs --no-colors report results -a '${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/' ./tests/raw_${name}.log - --confidential --copyright 'Altinity Inc.' --logo ./tests/altinity.png | ~/venv/qa/bin/tfs --debug --no-colors document convert > ./tests/report_${name}.html'"

run_tests+=(
"${run_cmd}"
)
done
printf "%s\n" "${run_tests[@]}" | xargs -P 2 -I {} bash -xec '{}'

ls -la ./tests/*.html
test_result=$?
~/venv/qa/bin/tfs --no-colors transform compact ./tests/raw.log ./tests/compact.log
~/venv/qa/bin/tfs --no-colors transform nice ./tests/raw.log ./tests/nice.log.txt
~/venv/qa/bin/tfs --no-colors transform short ./tests/raw.log ./tests/short.log.txt
~/venv/qa/bin/tfs --no-colors report results -a "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/" ./tests/raw.log - --confidential --copyright "Altinity Inc." --logo ./tests/altinity.png | ~/venv/qa/bin/tfs --debug --no-colors document convert > ./tests/report.html

echo "test_result=$test_result" >> $GITHUB_OUTPUT
exit "$test_result"
Expand All @@ -116,7 +135,7 @@ jobs:
with:
name: testflows-report
path: |
tests/report.html
tests/*.html
if-no-files-found: error
retention-days: 90

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ venv

# Tests cached files
tests/image/cache
tests/*.log.txt
tests/*.html

# Skip tmp folder
/tmp/
Expand Down
9 changes: 4 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,13 @@ Vagrant.configure(2) do |config|
# docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) test"
apt-get install --no-install-recommends -y docker-ce pigz
apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io docker-compose-plugin pigz

# docker compose
apt-get install -y --no-install-recommends python3-distutils
curl -sL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
python3 /tmp/get-pip.py

pip3 install -U setuptools
pip3 install -U docker-compose
pip3 install -U -r ./tests/image/requirements.txt

# k9s CLI
K9S_VERSION=$(curl -sL https://github.com/derailed/k9s/releases/latest -H "Accept: application/json" | jq -r .tag_name)
Expand Down Expand Up @@ -170,7 +168,8 @@ Vagrant.configure(2) do |config|
# K8S_VERSION=${K8S_VERSION:-1.23.1}
# K8S_VERSION=${K8S_VERSION:-1.24.8}
# K8S_VERSION=${K8S_VERSION:-1.25.4}
K8S_VERSION=${K8S_VERSION:-1.31.1}
# K8S_VERSION=${K8S_VERSION:-1.31.1}
K8S_VERSION=${K8S_VERSION:-1.31.2}
export VALIDATE_YAML=true

killall kubectl || true
Expand Down
2 changes: 1 addition & 1 deletion config/chi/templates.d/001-templates.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"containers" : [
{
"name": "clickhouse",
"image": "clickhouse/clickhouse-server:23.8",
"image": "clickhouse/clickhouse-server:24.8",
"ports": [
{
"name": "http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"containers" : [
{
"name": "clickhouse",
"image": "clickhouse/clickhouse-server:23.8",
"image": "clickhouse/clickhouse-server:24.8",
"ports": [
{
"name": "http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ spec:
containers:
- name: clickhouse-keeper
imagePullPolicy: Always
image: "clickhouse/clickhouse-keeper:latest-alpine"
image: "clickhouse/clickhouse-keeper:24.8"
resources:
requests:
memory: "256M"
cpu: "1"
limits:
memory: "4Gi"
memory: "1Gi"
cpu: "2"
volumeMounts:
- name: clickhouse-keeper-settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ spec:
containers:
- name: clickhouse-keeper
imagePullPolicy: Always
image: "clickhouse/clickhouse-keeper:latest-alpine"
image: "clickhouse/clickhouse-keeper:24.8"
resources:
requests:
memory: "256M"
cpu: "1"
limits:
memory: "4Gi"
memory: "1Gi"
cpu: "2"
volumeMounts:
- name: clickhouse-keeper-settings
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/clickhouse-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ configs:
"containers" : [
{
"name": "clickhouse",
"image": "clickhouse/clickhouse-server:23.8",
"image": "clickhouse/clickhouse-server:24.8",
"ports": [
{
"name": "http",
Expand Down
4 changes: 3 additions & 1 deletion deploy/minio/install-minio-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "External value for \$MINIO_NAMESPACE=$MINIO_NAMESPACE"
echo "External value for \$MINIO_OPERATOR_VERSION=$MINIO_OPERATOR_VERSION"

MINIO_NAMESPACE="${MINIO_NAMESPACE:-minio}"
MINIO_OPERATOR_VERSION="${MINIO_OPERATOR_VERSION:-v4.1.3}"
MINIO_OPERATOR_VERSION="${MINIO_OPERATOR_VERSION:-v6.0.4}"

echo "Setup minio.io"
echo "OPTIONS"
Expand Down Expand Up @@ -63,7 +63,9 @@ echo "Setup minio.io operator ${MINIO_OPERATOR_VERSION} into ${MINIO_NAMESPACE}
## TODO: need to refactor after next minio-operator release

MINIO_KUSTOMIZE_DIR="${MINIO_OPERATOR_DIR}/resources"
sed -i -e "s/replicas: 2/replicas: 1/" $MINIO_KUSTOMIZE_DIR/base/deployment.yaml
sed -i -e "s/name: minio-operator/name: ${MINIO_NAMESPACE}/" $MINIO_KUSTOMIZE_DIR/base/namespace.yaml
sed -i -e "s/: restricted/: baseline/" $MINIO_KUSTOMIZE_DIR/base/namespace.yaml
sed -i -e "s/namespace: default/namespace: ${MINIO_NAMESPACE}/" $MINIO_KUSTOMIZE_DIR/base/*.yaml
sed -i -e "s/namespace: minio-operator/namespace: ${MINIO_NAMESPACE}/" $MINIO_KUSTOMIZE_DIR/base/*.yaml
sed -i -e "s/namespace: minio-operator/namespace: ${MINIO_NAMESPACE}/" $MINIO_KUSTOMIZE_DIR/kustomization.yaml
Expand Down
33 changes: 5 additions & 28 deletions deploy/minio/install-minio-tenant.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
export MINIO_BACKUP_BUCKET=${MINIO_BACKUP_BUCKET:-clickhouse-backup}

export MINIO_NAMESPACE="${MINIO_NAMESPACE:-minio}"
# look to https://github.com/minio/operator/blob/v4.1.3/examples/tenant.yaml
export MINIO_VERSION="${MINIO_VERSION:-RELEASE.2021-06-17T00-10-46Z}"
# export MINIO_VERSION="${MINIO_VERSION:-latest}"
export MINIO_CLIENT_VERSION="${MINIO_CLIENT_VERSION:-latest}"
export MINIO_CONSOLE_VERSION="${MINIO_CONSOLE_VERSION:-latest}"
# look to https://github.com/minio/operator/blob/master/examples/kustomization/base/tenant.yaml
export MINIO_VERSION="${MINIO_VERSION:-RELEASE.2024-10-02T17-50-41Z}"
export MINIO_CLIENT_VERSION="${MINIO_CLIENT_VERSION:-RELEASE.2024-10-29T15-34-59Z}"

export MINIO_ACCESS_KEY="${MINIO_ACCESS_KEY:-minio-access-key}"
export MINIO_ACCESS_KEY_B64=$(echo -n "$MINIO_ACCESS_KEY" | base64)

export MINIO_SECRET_KEY="${MINIO_SECRET_KEY:-minio-secret-key}"
export MINIO_SECRET_KEY_B64=$(echo -n "$MINIO_SECRET_KEY" | base64)

export MINIO_CONSOLE_PBKDF_PASSPHRASE="${MINIO_CONSOLE_PBKDF_PASSPHRASE}:-SECRET"
export MINIO_CONSOLE_PBKDF_PASSPHRASE_B64=$(echo -n "${MINIO_CONSOLE_PBKDF_PASSPHRASE}" | base64)

export MINIO_CONSOLE_PBKDF_SALT="${MINIO_CONSOLE_PBKDF_SALT}:-SECRET"
export MINIO_CONSOLE_PBKDF_SALT_B64=$(echo -n "${MINIO_CONSOLE_PBKDF_SALT}" | base64)

export MINIO_CONSOLE_ACCESS_KEY="${MINIO_CONSOLE_ACCESS_KEY:-minio_console}"
export MINIO_CONSOLE_ACCESS_KEY_B64=$(echo -n "${MINIO_CONSOLE_ACCESS_KEY}" | base64)

export MINIO_CONSOLE_SECRET_KEY="${MINIO_CONSOLE_SECRET_KEY:-minio_console}"
export MINIO_CONSOLE_SECRET_KEY_B64=$(echo -n "${MINIO_CONSOLE_SECRET_KEY}" | base64)



Expand All @@ -36,8 +21,7 @@ export MINIO_CONSOLE_SECRET_KEY_B64=$(echo -n "${MINIO_CONSOLE_SECRET_KEY}" | ba
function wait_minio_to_start() {
# Fetch Minio's deployment_name and namespace from params
local namespace=$1
local deployment_name=$2
local pod_name=$3
local pod_name=$2

echo -n "Waiting Minio pod '${namespace}/${pod_name}' to start"
# Check minio tenatna have all pods ready
Expand All @@ -47,13 +31,6 @@ function wait_minio_to_start() {
done
echo "...DONE"

echo -n "Waiting Minio Console Deployment '${namespace}/${deployment_name}' to start"
# Check minio-console deployment have all pods ready
while [[ $(kubectl --namespace="${namespace}" get deployments | grep "${deployment_name}" | grep -c "1/1") == "0" ]]; do
printf "."
sleep 1
done
echo "...DONE"
}


Expand All @@ -78,7 +55,7 @@ kubectl apply -n "${MINIO_NAMESPACE}" -f <(
envsubst < "$CUR_DIR/minio-tenant-template.yaml"
)

wait_minio_to_start "$MINIO_NAMESPACE" minio-console minio-pool-0-0
wait_minio_to_start "$MINIO_NAMESPACE" minio-pool-0-0

kubectl apply -n "${MINIO_NAMESPACE}" -f <(
envsubst < "$CUR_DIR/minio-tenant-create-bucket-template.yaml"
Expand Down
5 changes: 2 additions & 3 deletions deploy/minio/minio-tenant-create-bucket-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ spec:
restartPolicy: Never
containers:
- name: minio-client
image: "minio/mc:${MINIO_CLIENT_VERSION}"
image: "quay.io/minio/mc:${MINIO_CLIENT_VERSION}"
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -xc
- mc alias set miniok8s https://minio-hl.minio:9000 ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY} --insecure && mc mb miniok8s/${MINIO_BACKUP_BUCKET} --ignore-existing --insecure

- mc alias set miniok8s http://minio-hl.${MINIO_NAMESPACE}:9000 ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY} && mc mb miniok8s/${MINIO_BACKUP_BUCKET} --ignore-existing --insecure
backoffLimit: 10
Loading
Loading