|
| 1 | +# name: Helm Test |
| 2 | +# |
| 3 | +# on: |
| 4 | +# push: |
| 5 | +# branches: [main] |
| 6 | +# paths: |
| 7 | +# - 'manifests/**' |
| 8 | +# - 's3proxy/**' |
| 9 | +# - 'Dockerfile' |
| 10 | +# - '.github/workflows/helm-test.yml' |
| 11 | +# pull_request: |
| 12 | +# branches: [main] |
| 13 | +# paths: |
| 14 | +# - 'manifests/**' |
| 15 | +# - 's3proxy/**' |
| 16 | +# - 'Dockerfile' |
| 17 | +# - '.github/workflows/helm-test.yml' |
| 18 | +# workflow_dispatch: |
| 19 | +# |
| 20 | +# jobs: |
| 21 | +# helm-test: |
| 22 | +# runs-on: ubuntu-latest |
| 23 | +# steps: |
| 24 | +# - name: Checkout |
| 25 | +# uses: actions/checkout@v6.0.2 |
| 26 | +# |
| 27 | +# - name: Create Kind cluster |
| 28 | +# uses: helm/kind-action@v1.13.0 |
| 29 | +# with: |
| 30 | +# cluster_name: s3proxy-test |
| 31 | +# |
| 32 | +# - name: Install Helm |
| 33 | +# uses: azure/setup-helm@v4.3.1 |
| 34 | +# |
| 35 | +# - name: Add Helm repos and update dependencies |
| 36 | +# run: | |
| 37 | +# helm repo add dandydev https://dandydeveloper.github.io/charts |
| 38 | +# helm repo update |
| 39 | +# helm dependency update ./manifests |
| 40 | +# |
| 41 | +# - name: Build and load image |
| 42 | +# run: | |
| 43 | +# docker build -t s3proxy-python:latest . |
| 44 | +# kind load docker-image s3proxy-python:latest --name s3proxy-test |
| 45 | +# |
| 46 | +# - name: Install Helm chart |
| 47 | +# run: | |
| 48 | +# helm upgrade --install s3proxy ./manifests \ |
| 49 | +# -n s3proxy --create-namespace \ |
| 50 | +# --set image.repository=s3proxy-python \ |
| 51 | +# --set image.tag=latest \ |
| 52 | +# --wait --timeout 300s |
| 53 | +# |
| 54 | +# - name: Wait for pods |
| 55 | +# run: | |
| 56 | +# kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=s3proxy-python -n s3proxy --timeout=120s |
| 57 | +# kubectl wait --for=condition=ready pod -l release=s3proxy -n s3proxy --timeout=180s || true |
| 58 | +# kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=s3proxy-python-minio -n s3proxy --timeout=120s |
| 59 | +# |
| 60 | +# - name: Show deployment status |
| 61 | +# run: | |
| 62 | +# kubectl get all -n s3proxy |
| 63 | +# kubectl get pods -n s3proxy -o wide |
| 64 | +# |
| 65 | +# - name: Test health endpoint |
| 66 | +# run: | |
| 67 | +# kubectl run curl-test --image=curlimages/curl --rm -it --restart=Never -n s3proxy -- \ |
| 68 | +# curl -sf http://s3proxy-python:4433/healthz |
| 69 | +# echo "Health check passed!" |
| 70 | +# |
| 71 | +# - name: Run load test |
| 72 | +# run: | |
| 73 | +# kubectl run s3-load-test -n s3proxy --rm -it --restart=Never \ |
| 74 | +# --image=amazon/aws-cli:latest \ |
| 75 | +# --env="AWS_ACCESS_KEY_ID=minioadmin" \ |
| 76 | +# --env="AWS_SECRET_ACCESS_KEY=minioadmin" \ |
| 77 | +# --env="AWS_DEFAULT_REGION=us-east-1" \ |
| 78 | +# --command -- /bin/sh -c " |
| 79 | +# # Create test bucket |
| 80 | +# echo 'Creating test bucket...' |
| 81 | +# aws --endpoint-url http://s3proxy-python:4433 s3 mb s3://ci-test-bucket 2>/dev/null || true |
| 82 | +# |
| 83 | +# # Generate test files (smaller for CI) |
| 84 | +# echo 'Generating 64MB test files...' |
| 85 | +# mkdir -p /tmp/testfiles |
| 86 | +# for i in 1 2 3; do |
| 87 | +# dd if=/dev/urandom of=/tmp/testfiles/file-\$i.bin bs=1M count=64 2>/dev/null & |
| 88 | +# done |
| 89 | +# wait |
| 90 | +# echo 'Files generated' |
| 91 | +# ls -lh /tmp/testfiles/ |
| 92 | +# |
| 93 | +# # Upload concurrently |
| 94 | +# echo '' |
| 95 | +# echo '=== Starting concurrent uploads ===' |
| 96 | +# START=\$(date +%s) |
| 97 | +# |
| 98 | +# for i in 1 2 3; do |
| 99 | +# aws --endpoint-url http://s3proxy-python:4433 s3 cp /tmp/testfiles/file-\$i.bin s3://ci-test-bucket/file-\$i.bin & |
| 100 | +# done |
| 101 | +# wait |
| 102 | +# |
| 103 | +# END=\$(date +%s) |
| 104 | +# DURATION=\$((END - START)) |
| 105 | +# echo '' |
| 106 | +# echo \"=== Upload complete in \${DURATION}s ===\" |
| 107 | +# |
| 108 | +# # Verify uploads |
| 109 | +# echo '' |
| 110 | +# echo '=== Listing uploaded files ===' |
| 111 | +# aws --endpoint-url http://s3proxy-python:4433 s3 ls s3://ci-test-bucket/ |
| 112 | +# |
| 113 | +# # Download and verify |
| 114 | +# echo '' |
| 115 | +# echo '=== Downloading files to verify ===' |
| 116 | +# mkdir -p /tmp/downloads |
| 117 | +# for i in 1 2 3; do |
| 118 | +# aws --endpoint-url http://s3proxy-python:4433 s3 cp s3://ci-test-bucket/file-\$i.bin /tmp/downloads/file-\$i.bin & |
| 119 | +# done |
| 120 | +# wait |
| 121 | +# |
| 122 | +# echo '' |
| 123 | +# echo '=== Comparing checksums ===' |
| 124 | +# md5sum /tmp/testfiles/*.bin > /tmp/orig.md5 |
| 125 | +# md5sum /tmp/downloads/*.bin > /tmp/down.md5 |
| 126 | +# |
| 127 | +# ORIG_SUMS=\$(cat /tmp/orig.md5 | while read sum name; do echo \$sum; done | sort) |
| 128 | +# DOWN_SUMS=\$(cat /tmp/down.md5 | while read sum name; do echo \$sum; done | sort) |
| 129 | +# |
| 130 | +# cat /tmp/orig.md5 |
| 131 | +# echo '' |
| 132 | +# if [ \"\$ORIG_SUMS\" = \"\$DOWN_SUMS\" ]; then |
| 133 | +# echo 'All checksums match - encryption/decryption working!' |
| 134 | +# else |
| 135 | +# echo 'Checksum mismatch!' |
| 136 | +# exit 1 |
| 137 | +# fi |
| 138 | +# " |
| 139 | +# |
| 140 | +# - name: Show pod logs on failure |
| 141 | +# if: failure() |
| 142 | +# run: | |
| 143 | +# echo "=== S3Proxy Logs ===" |
| 144 | +# kubectl logs -l app.kubernetes.io/name=s3proxy-python -n s3proxy --tail=100 || true |
| 145 | +# echo "" |
| 146 | +# echo "=== Redis HA Logs ===" |
| 147 | +# kubectl logs -l release=s3proxy -n s3proxy --tail=50 || true |
| 148 | +# echo "" |
| 149 | +# echo "=== Events ===" |
| 150 | +# kubectl get events -n s3proxy --sort-by=.lastTimestamp | tail -20 || true |
| 151 | +# |
| 152 | +# - name: Cleanup |
| 153 | +# if: always() |
| 154 | +# run: | |
| 155 | +# kind delete cluster --name s3proxy-test |
0 commit comments