-
Notifications
You must be signed in to change notification settings - Fork 86
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
Deploy metadata in end to end tests #2186
base: development/2.10
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,11 @@ runs: | |
shell: bash | ||
run: sh tests/smoke/deploy-sorbet-resources.sh end2end | ||
working-directory: ./.github/scripts/end2end/operator | ||
- name: Deploy metadata | ||
shell: bash | ||
run: bash deploy-metadata.sh | ||
working-directory: ./.github/scripts/end2end | ||
if: ${{ env.ENABLE_RING_TESTS == 'true' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to have it as an |
||
- name: End-to-end configuration | ||
shell: bash | ||
run: bash configure-e2e.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "default" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
set -exu | ||
|
||
. "$(dirname $0)/common.sh" | ||
|
||
# create a separate namespace for metadata | ||
kubectl create namespace metadata | ||
|
||
# clone the metadata repository | ||
git init metadata | ||
cd metadata | ||
git fetch --depth 1 --no-tags https://${GIT_ACCESS_TOKEN}@github.com/scality/metadata.git | ||
git checkout FETCH_HEAD | ||
|
||
# install metadata chart in a separate namespace | ||
cd helm | ||
helm dependency update cloudserver/ | ||
helm install -n metadata \ | ||
--set metadata.persistentVolume.storageClass='' \ | ||
--set metadata.sproxyd.persistentVolume.storageClass='' \ | ||
s3c cloudserver/ | ||
|
||
# wait for the repds to be created | ||
kubectl -n metadata rollout status --watch --timeout=300s statefulset/s3c-metadata-repd | ||
# wait for all repd pods to start serving admin API ports | ||
wait_for_all_pods_behind_services metadata-repd metadata "91*" 60 | ||
|
||
# current chart uses an old version of bucketd that has issues reconnecting to the repd | ||
# when bucketd is started first. Restarting bucketd after repd is ready. | ||
kubectl -n metadata rollout restart deployment/s3c-metadata-bucketd | ||
# wait for the bucketd pods to be created | ||
kubectl -n metadata rollout status --watch --timeout=300s deploy/s3c-metadata-bucketd | ||
# wait for all bucketd pods to start serving port 9000 | ||
wait_for_all_pods_behind_services metadata-bucketd metadata 9000 60 | ||
|
||
# manually add "s3c.local" to the rest endpoints list as it's not configurable in the chart | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need i did not need such patch on my artesca cluster (in namespace |
||
current_config=$(kubectl get configmap/s3c-cloudserver-config-json -n metadata -o jsonpath='{.data.config\.json}') | ||
updated_config=$(echo "$current_config" | jq '.restEndpoints["s3c.local"] = "us-east-1"') | ||
kubectl patch configmap/s3c-cloudserver-config-json -n metadata --type='merge' -p="$(jq -n --arg v "$updated_config" '{"data": {"config.json": $v}}')" | ||
|
||
# restarting cloudserver to take the new configmap changes into account | ||
kubectl -n metadata rollout restart deployment/s3c-cloudserver | ||
# wait for the cloudserver pods to be created | ||
kubectl -n metadata rollout status --watch --timeout=300s deployment/s3c-cloudserver | ||
# wait for the cloudserver pods to start serving port 8000 | ||
wait_for_all_pods_behind_services cloudserver metadata 8000 60 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,11 +76,11 @@ env: | |
GCP_BACKEND_SERVICE_EMAIL: ${{ secrets.GCP_BACKEND_SERVICE_EMAIL }} | ||
# Enable this for Ring tests | ||
ENABLE_RING_TESTS: "false" | ||
RING_S3C_ACCESS_KEY: ${{ secrets.RING_S3C_BACKEND_ACCESS_KEY }} | ||
RING_S3C_SECRET_KEY: ${{ secrets.RING_S3C_BACKEND_SECRET_KEY }} | ||
RING_S3C_ENDPOINT: ${{ secrets.RING_S3C_BACKEND_ENDPOINT }} | ||
RING_S3C_ACCESS_KEY: accessKey1 | ||
RING_S3C_SECRET_KEY: verySecretKey1 | ||
RING_S3C_ENDPOINT: http://s3c.local:8000 | ||
RING_S3C_BACKEND_SOURCE_LOCATION: rings3cbackendingestion | ||
RING_S3C_INGESTION_SRC_BUCKET_NAME: ingestion-test-src-bucket-${{ github.run_id }}-${{ github.run_attempt }} | ||
RING_S3C_INGESTION_SRC_BUCKET_NAME: ingestion-test-src-bucket-${{ github.run_id }} | ||
# CTST end2end tests | ||
NOTIF_DEST_NAME: "destination1" | ||
NOTIF_DEST_TOPIC: "destination-topic-1" | ||
|
@@ -320,9 +320,6 @@ jobs: | |
run: |- | ||
cd tests/zenko_tests | ||
envsubst < 'e2e-config.yaml.template' > 'e2e-config.yaml' | ||
if [[ "${ENABLE_RING_TESTS}" == "false" ]]; then | ||
yq -i 'del(.locations[] | select(.locationType == "location-scality-ring-s3-v1"))' e2e-config.yaml | ||
fi | ||
cat e2e-config.yaml | ||
echo 'Generated e2e-config.yaml file' | ||
- name: Build and push CI image | ||
|
@@ -556,8 +553,9 @@ jobs: | |
needs: [build-kafka, build-test-image] | ||
runs-on: | ||
- ubuntu-22.04-8core | ||
# Enable this for Ring-based tests | ||
# - scality-cloud | ||
env: | ||
ENABLE_RING_TESTS: "true" | ||
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. credentials should not be added to env, esp. at such broad "scale" : best to pass them via inputs, in the place where they are needed |
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -573,8 +571,6 @@ jobs: | |
registry: ghcr.io | ||
- name: Deploy Zenko | ||
uses: ./.github/actions/deploy | ||
env: | ||
GIT_ACCESS_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | ||
- name: Run backbeat end to end tests | ||
run: bash run-e2e-test.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "backbeat" "default" | ||
working-directory: ./.github/scripts/end2end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already running with bash, so make it executable and execute just: