-
Notifications
You must be signed in to change notification settings - Fork 300
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
Validation testing integrations #1509
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CONNECTOR_NAME=$1 | ||
VALIDATION_TESTING_ROOT=$REPOSITORY_ROOT/validation_testing | ||
RELEASE_TESTS_EXIT_CODE=$? | ||
|
||
# Glue attaches ENIs to the VPC subnet, if there is one, in order to connect to the VPC, and then will issue a delete of them later, but if they aren't finished deleting by the time we invoke cdk destroy, | ||
# CFN will not know about the resources and not be able to delete the stack. So, we proactively look for and delete ENIs attached to glue ourselves first | ||
aws ec2 describe-subnets --filters "Name=tag:Name,Values=${CONNECTOR_NAME}CdkStack*" | jq ".Subnets[].SubnetId" | tr -d '"' \ | ||
| xargs -n 1 -I {} aws ec2 describe-network-interfaces --filters "Name=subnet-id,Values={}" | jq ".NetworkInterfaces[] | select(.Description | startswith(\"Attached to Glue\")) | .NetworkInterfaceId" | tr -d '"' \ | ||
| xargs -I {} aws ec2 delete-network-interface --network-interface-id {} | ||
|
||
# once that is done, we can delete our CDK stack. | ||
cd $(dirname $(find . -name ATHENA_INFRA_SPINUP_ROOT))/app; | ||
# cannot use --force because npm is stripping the flags, so pipe yes through | ||
yes | npm run cdk destroy ${CONNECTOR_NAME}CdkStack; | ||
|
||
echo "FINISHED CLEANING UP RESOURCES FOR ${CONNECTOR_NAME}." | ||
|
||
echo "FINISHED RELEASE TESTS FOR ${CONNECTOR_NAME}." | ||
|
||
exit $RELEASE_TESTS_EXIT_CODE |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
CONNECTOR_NAME=$1 | ||
VALIDATION_TESTING_ROOT=$REPOSITORY_ROOT/validation_testing | ||
|
||
# upload connector jar to s3 and update yaml to s3 uri, redirect to /dev/null to not log the s3 path | ||
aws s3 cp $REPOSITORY_ROOT/athena-$CONNECTOR_NAME/target/athena-$CONNECTOR_NAME-2022.47.1.jar "$S3_JARS_BUCKET/" > /dev/null | ||
sed -i "s#CodeUri: \"./target/athena-$CONNECTOR_NAME-2022.47.1.jar\"#CodeUri: \"$S3_JARS_BUCKET/athena-$CONNECTOR_NAME-2022.47.1.jar\"#" $REPOSITORY_ROOT/athena-$CONNECTOR_NAME/athena-$CONNECTOR_NAME.yaml | ||
|
||
# go to cdk dir, build/synth/deploy | ||
cd $(dirname $(find . -name ATHENA_INFRA_SPINUP_ROOT))/app; | ||
|
||
cat <<EOF > .env | ||
DATABASE_PASSWORD=$DATABASE_PASSWORD | ||
S3_DATA_PATH=$S3_PATH | ||
REPOSITORY_ROOT=$REPOSITORY_ROOT | ||
EOF | ||
|
||
npm install; | ||
npm run build; | ||
npm run cdk synth; | ||
npm run cdk deploy ${CONNECTOR_NAME}CdkStack > /dev/null; | ||
|
||
sed -i "s#CodeUri: \"$S3_JARS_BUCKET/athena-$CONNECTOR_NAME-2022.47.1.jar\"#CodeUri: \"./target/athena-$CONNECTOR_NAME-2022.47.1.jar\"#" $REPOSITORY_ROOT/athena-$CONNECTOR_NAME/athena-$CONNECTOR_NAME.yaml | ||
|
||
echo "FINISHED DEPLOYING INFRA FOR ${CONNECTOR_NAME}." |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CONNECTOR_NAME=$1 | ||
VALIDATION_TESTING_ROOT=$REPOSITORY_ROOT/validation_testing | ||
|
||
# cd back to validation root | ||
cd $VALIDATION_TESTING_ROOT | ||
|
||
# now we run the glue jobs that the CDK stack created | ||
# If there is any output to glue_job_synchronous_execution.py, we will exit this script with a failure code. | ||
# The 2>&1 lets us pipe both stdout and stderr to grep, as opposed to just the stdout. https://stackoverflow.com/questions/818255/what-does-21-mean | ||
echo "Starting glue jobs..." | ||
aws glue list-jobs --max-results 100 \ | ||
| jq ".JobNames[] | select(startswith(\"${CONNECTOR_NAME}gluejob\"))" \ | ||
| xargs -I{} python3 scripts/glue_job_synchronous_execution.py {} 2>&1 \ | ||
| grep -q '.' && exit 1 | ||
|
||
echo "FINISHED RUNNING GLUE JOBS FOR ${CONNECTOR_NAME}." |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CONNECTOR_NAME=$1 | ||
VALIDATION_TESTING_ROOT=$REPOSITORY_ROOT/validation_testing | ||
|
||
CONNECTOR_LAMBDA_ARN=$(aws lambda get-function --function-name $CONNECTOR_NAME-cdk-deployed | jq ".Configuration.FunctionArn" | tr -d '"') # trim quotes from the json string output | ||
python3 scripts/exec_release_test_queries.py $CONNECTOR_NAME $RESULTS_LOCATION $CONNECTOR_LAMBDA_ARN | ||
RELEASE_TESTS_EXIT_CODE=$? | ||
echo "FINISHED RUNNING TESTS FOR ${CONNECTOR_NAME}, exit code was $RELEASE_TESTS_EXIT_CODE." |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
redshift