Skip to content

Commit

Permalink
fix terraform test
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Sep 30, 2024
1 parent d2b53ac commit ca52e6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/forcingprocessor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Configure AWS
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region us-east-1
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/research_datastream_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
cd research_datastream/terraform
if ! aws ec2 describe-key-pairs --key-names "actions_key" --query 'KeyPairs[0].KeyName' --output text 2>/dev/null; then aws ec2 create-key-pair --key-name "actions_key" --query 'KeyName' --output text && echo "Key pair 'actions_key' created in AWS"; else echo "Key pair 'actions_key' already exists"; fi
execution_arn=$(aws stepfunctions start-execution --state-machine-arn $(cat ./sm_ARN.txt) --name docker_builder_$(env TZ=US/Eastern date +'%Y%m%d%H%M%S') --input "file://test/execution_gp_test.json" --region us-east-1 --query 'executionArn' --output text); echo "Execution ARN: $execution_arn"; status="RUNNING"; while [ "$status" != "SUCCEEDED" ]; do status=$(aws stepfunctions describe-execution --execution-arn "$execution_arn" --region us-east-1 --query 'status' --output text); echo "Current status: $status"; if [ "$status" == "FAILED" ]; then echo "State machine execution failed!"; exit 1; fi; sleep 5; done; echo "State machine execution succeeded!"
execution_arn=$(aws stepfunctions start-execution --state-machine-arn $(cat ./sm_ARN.txt) --name gp_test_$(env TZ=US/Eastern date +'%Y%m%d%H%M%S') --input "file://test/execution_gp_test.json" --region us-east-1 --query 'executionArn' --output text); echo "Execution ARN: $execution_arn"; status="RUNNING"; while [ "$status" != "SUCCEEDED" ]; do status=$(aws stepfunctions describe-execution --execution-arn "$execution_arn" --region us-east-1 --query 'status' --output text); echo "Current status: $status"; if [ "$status" == "FAILED" ]; then echo "State machine execution failed!"; exit 1; fi; sleep 5; done; echo "State machine execution succeeded!"
- name: Tear down infra
if: always()
Expand Down
4 changes: 2 additions & 2 deletions research_datastream/terraform/test/execution_gp_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
},
"instance_parameters" :
{
"ImageId" : "ami-00e73ddc3a6fc7dfe",
"ImageId" : "ami-041f4ef35649c11b0",
"InstanceType" : "t4g.nano",
"KeyName" : "actions_key",
"SecurityGroupIds" : ["sg-0ab5f40d1eb97d163"],
"SecurityGroupIds" : ["sg-049e002d41bce813c"],
"IamInstanceProfile": {
"Name": "datastream_ec2_profile_github_actions"
},
Expand Down

0 comments on commit ca52e6a

Please sign in to comment.