-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add flags to support aws as storage destination (#1372)
Signed-off-by: Jeffrey Tang <[email protected]>
- Loading branch information
1 parent
5b5e276
commit 5ca0e47
Showing
9 changed files
with
303 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ else | |
fi | ||
|
||
if [ -z "${STORAGE_TYPE}" ]; then | ||
storageType="gcs_and_minio" | ||
storageType="aws_only" | ||
else | ||
storageType=${STORAGE_TYPE} | ||
fi | ||
|
@@ -40,44 +40,68 @@ if [ -z "${PREFIX}" ]; then | |
echo "PREFIX is not set" | ||
else | ||
echo "Using PREFIX: ${PREFIX}" | ||
BUCKET_PREFIX_OPTION="--storage-bucket-prefix ${PREFIX}" | ||
if [ "${storageType}" == "aws_only" ]; then | ||
STORAGE_OPTIONS=( | ||
"--aws-endpoint" "https://storage.googleapis.com" | ||
"--aws-access-key" "${GCS_ACCESS_KEY}" | ||
"--aws-secrets" "${GCS_SECRET_KEY}" | ||
"--aws-bucket" "${streamBucket}" | ||
"--aws-bucket-prefix" "${PREFIX}" | ||
) | ||
elif [ "${storageType}" == "gcs_only" ]; then | ||
STORAGE_OPTIONS=( | ||
"--gcs-endpoint" "https://storage.googleapis.com" | ||
"--gcs-access-key" "${GCS_ACCESS_KEY}" | ||
"--gcs-secrets" "${GCS_SECRET_KEY}" | ||
"--gcs-bucket" "${streamBucket}" | ||
"--gcs-bucket-prefix" "${PREFIX}" | ||
) | ||
fi | ||
|
||
if [ "${storageType}" == "aws_only" ] || [ "${storageType}" == "gcs_only" ]; then | ||
MIRROR_STORAGE_OPTIONS=( | ||
"--storage-endpoint" "https://storage.googleapis.com" | ||
"--storage-access-key" "${GCS_ACCESS_KEY}" | ||
"--storage-secrets" "${GCS_SECRET_KEY}" | ||
"--storage-bucket" "${streamBucket}" | ||
"--storage-bucket-prefix" "${PREFIX}" | ||
) | ||
fi | ||
fi | ||
|
||
echo "STORAGE_OPTIONS: " "${STORAGE_OPTIONS[@]}" | ||
echo "MIRROR_STORAGE_OPTIONS: " "${MIRROR_STORAGE_OPTIONS[@]}" | ||
|
||
echo "${GCP_SERVICE_ACCOUNT_TOKEN}" > gcp_service_account.json | ||
|
||
echo "Using bucket name: ${streamBucket}" | ||
echo "Test storage type: ${storageType}" | ||
|
||
if [[ -z "${SOLO_TEST_CLUSTER}" && ${SOLO_CLUSTER_NAME} != "" ]]; then | ||
SOLO_CLUSTER_NAME=solo-e2e | ||
else | ||
SOLO_CLUSTER_NAME=${SOLO_TEST_CLUSTER} | ||
fi | ||
SOLO_CLUSTER_NAME=solo-e2e | ||
SOLO_NAMESPACE=solo-e2e | ||
SOLO_CLUSTER_SETUP_NAMESPACE=solo-setup | ||
|
||
SOLO_DEPLOYMENT=solo-e2e | ||
|
||
kind delete cluster -n "${SOLO_CLUSTER_NAME}" | ||
kind create cluster -n "${SOLO_CLUSTER_NAME}" | ||
npm run solo-test -- init | ||
npm run solo-test -- cluster setup \ | ||
-s "${SOLO_CLUSTER_SETUP_NAMESPACE}" | ||
npm run solo-test -- node keys --gossip-keys --tls-keys -i node1 | ||
npm run solo-test -- network deploy -i node1 -n "${SOLO_NAMESPACE}" \ | ||
--storage-endpoint "https://storage.googleapis.com" \ | ||
--storage-access-key "${GCS_ACCESS_KEY}" --storage-secrets "${GCS_SECRET_KEY}" \ | ||
--storage-type "${storageType}" --storage-bucket "${streamBucket}" $BUCKET_PREFIX_OPTION \ | ||
npm run solo-test -- deployment create -n "${SOLO_NAMESPACE}" --context kind-"${SOLO_CLUSTER_NAME}" --email [email protected] --deployment-clusters kind-"${SOLO_CLUSTER_NAME}" --deployment "${SOLO_DEPLOYMENT}" | ||
npm run solo-test -- network deploy -i node1 --deployment "${SOLO_DEPLOYMENT}" \ | ||
--storage-type "${storageType}" \ | ||
"${STORAGE_OPTIONS[@]}" \ | ||
--backup-bucket "${streamBackupBucket}" \ | ||
--google-credential gcp_service_account.json | ||
|
||
npm run solo-test -- node setup -i node1 -n "${SOLO_NAMESPACE}" | ||
npm run solo-test -- node start -i node1 -n "${SOLO_NAMESPACE}" | ||
npm run solo-test -- mirror-node deploy --namespace "${SOLO_NAMESPACE}" \ | ||
--storage-endpoint "https://storage.googleapis.com" \ | ||
--storage-access-key "${GCS_ACCESS_KEY}" --storage-secrets "${GCS_SECRET_KEY}" \ | ||
--storage-type "${storageType}" --storage-bucket "${streamBucket}" $BUCKET_PREFIX_OPTION | ||
npm run solo-test -- node setup -i node1 --deployment "${SOLO_DEPLOYMENT}" | ||
npm run solo-test -- node start -i node1 --deployment "${SOLO_DEPLOYMENT}" | ||
npm run solo-test -- mirror-node deploy --deployment "${SOLO_DEPLOYMENT}" \ | ||
--storage-type "${storageType}" \ | ||
"${MIRROR_STORAGE_OPTIONS[@]}" \ | ||
|
||
npm run solo-test -- explorer deploy -n "${SOLO_NAMESPACE}" -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" | ||
npm run solo-test -- explorer deploy -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --deployment "${SOLO_DEPLOYMENT}" | ||
|
||
kubectl port-forward -n "${SOLO_NAMESPACE}" svc/haproxy-node1-svc 50211:50211 > /dev/null 2>&1 & | ||
|
||
|
@@ -88,7 +112,7 @@ cd ..; create_test_account ; cd - | |
|
||
node examples/create-topic.js | ||
|
||
npm run solo-test -- node stop -i node1 -n "${SOLO_NAMESPACE}" | ||
npm run solo-test -- node stop -i node1 --deployment "${SOLO_DEPLOYMENT}" | ||
|
||
echo "Waiting for backup uploader to run" | ||
# manually call script "backup.sh" from container backup-uploader since it only runs every 5 minutes | ||
|
@@ -102,4 +126,4 @@ if grep -q \""error\"" backup-uploader.log; then | |
exit 1 | ||
fi | ||
|
||
npm run solo-test -- network destroy -n "${SOLO_NAMESPACE}" --force -q | ||
npm run solo-test -- network destroy --deployment "${SOLO_DEPLOYMENT}" --force -q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.