Added aws_create_instance.sh script and tests - #5
Open
salvatoredipietro wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
scripts/aws_create_instance.sh, an env-var-driven wrapper aroundaws ec2 run-instancesfor spinning up a throw-away SUT/LDG instance for repro/benchmark work. It is explicitly out of scope of the Repro Framework (infrastructure management remains the caller's responsibility) and is documented as such.tests/: 74 bats unit tests (no real AWS calls, using afake_aws.bashstub) and a real-AWS integration test script with automatic cleanup.README.mdto document the newscripts/andtests/directories and clarify the infrastructure-management scope exception.What
aws_create_instance.shdoesINSTANCE_TYPE,KEYPAIR,EXPNAME,AMI,EBS_DISKS_*,SUBNET_ID,SG_ID,PLACEMENT_GROUP_NAME,TENANCY, …). See--helpfor the full list.AL2023_K6.12,AL2023,UBUNTU2404, etc.) in addition to rawami-*IDs, and infers the correct SSH user and root device from the AMI metadata.CLONE_REPO=trueby default).repro-results/${EXPNAME}.resources.json) for downstream scripts to pick up instance IDs, IPs, subnet, and AZ.DRYRUN=truevalidates and prints therun-instancescall without launching anything.Tests
tests/unit/scripts/aws_create_instance.batstests/unit/helpers/fake_aws.bashawsCLI stub, fully isolated viaenv -i, captures exactrun-instancesargvtests/integration/aws_create_instance_integration.shTest plan
bash -n scripts/aws_create_instance.shpassesDRYRUN=true INSTANCE_TYPE=t4g.micro KEYPAIR=<key> EXPNAME=test scripts/aws_create_instance.shAWS_PROFILE=default AWS_REGION=us-west-2 tests/integration/aws_create_instance_integration.sh --yesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.