Skip to content

Commit 6f896a9

Browse files
author
Kerkesni
committed
deploy metadata in end2end sharded tests
Issue: ZENKO-4414
1 parent e863a57 commit 6f896a9

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

.github/actions/deploy/action.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ runs:
8383
shell: bash
8484
run: sh tests/smoke/deploy-sorbet-resources.sh end2end
8585
working-directory: ./.github/scripts/end2end/operator
86+
- name: Deploy metadata
87+
shell: bash
88+
run: bash deploy-metadata.sh
89+
working-directory: ./.github/scripts/end2end
8690
- name: End-to-end configuration
8791
shell: bash
8892
run: bash configure-e2e.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "default"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
set -exu
4+
5+
# create a separate namespace for metadata
6+
kubectl create namespace metadata
7+
8+
# clone the metadata repository
9+
git init metadata
10+
cd metadata
11+
git fetch --depth 1 --no-tags https://${GIT_ACCESS_TOKEN}@github.com/scality/metadata.git
12+
git checkout FETCH_HEAD
13+
14+
# install metadata chart in a separate namespace
15+
cd helm
16+
helm dependency update cloudserver/
17+
helm install -n metadata \
18+
--set metadata.persistentVolume.storageClass='' \
19+
--set metadata.sproxyd.persistentVolume.storageClass='' \
20+
s3c cloudserver/
21+
22+
# wait for the repds to be ready
23+
kubectl -n metadata rollout status --watch --timeout=300s statefulset/s3c-metadata-repd
24+
25+
# current chart uses an old version of bucketd that has issues reconnecting to the repd
26+
# when bucketd is started first. Restarting bucketd after repd is ready.
27+
kubectl -n metadata rollout restart deployment/s3c-metadata-bucketd
28+
kubectl -n metadata rollout status --watch --timeout=300s deploy/s3c-metadata-bucketd
29+
30+
# manually add "s3c.local" to the rest endpoint list as it is not configurable in the chart
31+
current_config=$(kubectl get configmap/s3c-cloudserver-config-json -n metadata -o jsonpath='{.data.config\.json}')
32+
updated_config=$(echo "$current_config" | jq '.restEndpoints["s3c.local"] = "us-east-1"')
33+
kubectl patch configmap/s3c-cloudserver-config-json -n metadata --type='merge' -p="$(jq -n --arg v "$updated_config" '{"data": {"config.json": $v}}')"
34+
35+
# restarting cloudserver to take the new configmap changes into account
36+
kubectl -n metadata rollout restart deployment/s3c-cloudserver

.github/scripts/end2end/patch-coredns.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ corefile="
3636
rewrite name exact prom.dr.zenko.local ingress-nginx-controller.ingress-nginx.svc.cluster.local
3737
rewrite name exact shell-ui.dr.zenko.local ingress-nginx-controller.ingress-nginx.svc.cluster.local
3838
rewrite name exact website.mywebsite.com ingress-nginx-controller.ingress-nginx.svc.cluster.local
39+
rewrite name exact s3c.local s3c-cloudserver.metadata.svc.cluster.local
3940
kubernetes cluster.local in-addr.arpa ip6.arpa {
4041
pods insecure
4142
fallthrough in-addr.arpa ip6.arpa

.github/workflows/end2end.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ env:
7575
GCP_BACKEND_SERVICE_KEY: ${{ secrets.GCP_BACKEND_SERVICE_KEY }}
7676
GCP_BACKEND_SERVICE_EMAIL: ${{ secrets.GCP_BACKEND_SERVICE_EMAIL }}
7777
# Enable this for Ring tests
78-
ENABLE_RING_TESTS: "false"
79-
RING_S3C_ACCESS_KEY: ${{ secrets.RING_S3C_BACKEND_ACCESS_KEY }}
80-
RING_S3C_SECRET_KEY: ${{ secrets.RING_S3C_BACKEND_SECRET_KEY }}
81-
RING_S3C_ENDPOINT: ${{ secrets.RING_S3C_BACKEND_ENDPOINT }}
78+
ENABLE_RING_TESTS: "true"
79+
RING_S3C_ACCESS_KEY: accessKey1
80+
RING_S3C_SECRET_KEY: verySecretKey1
81+
RING_S3C_ENDPOINT: http://s3c.local:8000
8282
RING_S3C_BACKEND_SOURCE_LOCATION: rings3cbackendingestion
8383
RING_S3C_INGESTION_SRC_BUCKET_NAME: ingestion-test-src-bucket-${{ github.run_id }}-${{ github.run_attempt }}
8484
# CTST end2end tests
@@ -320,9 +320,6 @@ jobs:
320320
run: |-
321321
cd tests/zenko_tests
322322
envsubst < 'e2e-config.yaml.template' > 'e2e-config.yaml'
323-
if [[ "${ENABLE_RING_TESTS}" == "false" ]]; then
324-
yq -i 'del(.locations[] | select(.locationType == "location-scality-ring-s3-v1"))' e2e-config.yaml
325-
fi
326323
cat e2e-config.yaml
327324
echo 'Generated e2e-config.yaml file'
328325
- name: Build and push CI image
@@ -556,8 +553,6 @@ jobs:
556553
needs: [build-kafka, build-test-image]
557554
runs-on:
558555
- ubuntu-22.04-8core
559-
# Enable this for Ring-based tests
560-
# - scality-cloud
561556
steps:
562557
- name: Checkout
563558
uses: actions/checkout@v4

0 commit comments

Comments
 (0)