From 82d7612c96e9d03ee8a7b9b80455b3d1573f6003 Mon Sep 17 00:00:00 2001 From: Noah Zoschke Date: Thu, 25 Aug 2016 07:33:55 -0700 Subject: [PATCH 1/2] normalize DescribeInstances calls --- api/models/process.go | 5 ++++- provider/aws/instances.go | 6 ++++-- provider/aws/instances_test.go | 2 +- test/aws_cycles.go | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/models/process.go b/api/models/process.go index 9de6050e94..87683eca7b 100644 --- a/api/models/process.go +++ b/api/models/process.go @@ -150,7 +150,10 @@ func ListProcesses(app string) ([]*Process, error) { } ires, err := EC2().DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: instanceIds, + Filters: []*ec2.Filter{ + &ec2.Filter{Name: aws.String("instance-id"), Values: instanceIds}, + }, + MaxResults: aws.Int64(1000), }) if err != nil { diff --git a/provider/aws/instances.go b/provider/aws/instances.go index be5f02168a..db327fdb28 100644 --- a/provider/aws/instances.go +++ b/provider/aws/instances.go @@ -21,8 +21,10 @@ func (p *AWSProvider) InstanceList() (structs.Instances, error) { } ec2Res, err := p.ec2().DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIds: instanceIds, - MaxResults: aws.Int64(1000), + Filters: []*ec2.Filter{ + &ec2.Filter{Name: aws.String("instance-id"), Values: instanceIds}, + }, + MaxResults: aws.Int64(1000), }) if err != nil { return nil, err diff --git a/provider/aws/instances_test.go b/provider/aws/instances_test.go index 70eddc54d6..67f8b5dc04 100644 --- a/provider/aws/instances_test.go +++ b/provider/aws/instances_test.go @@ -92,7 +92,7 @@ func describeContainerInstancesResponse() string { func describeInstancesCycle() awsutil.Cycle { return awsutil.Cycle{ - awsutil.Request{"/", "", `Action=DescribeInstances&InstanceId.1=i-4a5513f4&InstanceId.2=i-3963798e&InstanceId.3=i-c6a72b76&MaxResults=1000&Version=2015-10-01`}, + awsutil.Request{"/", "", `Action=DescribeInstances&Filter.1.Name=instance-id&Filter.1.Value.1=i-4a5513f4&Filter.1.Value.2=i-3963798e&Filter.1.Value.3=i-c6a72b76&MaxResults=1000&Version=2015-10-01`}, awsutil.Response{200, describeInstancesResponse()}, } } diff --git a/test/aws_cycles.go b/test/aws_cycles.go index 2341868f1b..9c5fbac8f1 100644 --- a/test/aws_cycles.go +++ b/test/aws_cycles.go @@ -111,7 +111,7 @@ func DescribeConvoxStackCycle(stackName string) awsutil.Cycle { func DescribeInstancesCycle() awsutil.Cycle { return awsutil.Cycle{ - awsutil.Request{"/", "", `Action=DescribeInstances&InstanceId.1=i-4a5513f4&InstanceId.2=i-3963798e&InstanceId.3=i-c6a72b76&Version=2015-10-01`}, + awsutil.Request{"/", "", `Action=DescribeInstances&Filter.1.Name=instance-id&Filter.1.Value.1=i-4a5513f4&Filter.1.Value.2=i-3963798e&Filter.1.Value.3=i-c6a72b76&MaxResults=1000&Version=2015-10-01`}, awsutil.Response{200, describeInstancesResponse()}, } } From f3bb8a51089578335ce8e91337b7e25edc3ff952 Mon Sep 17 00:00:00 2001 From: Noah Zoschke Date: Thu, 25 Aug 2016 07:46:18 -0700 Subject: [PATCH 2/2] move logs artifact to report; test instances right after install --- ci/install.sh | 2 +- ci/report.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/install.sh b/ci/install.sh index 18e12e8d60..244238c537 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -11,4 +11,4 @@ convox install | tee $CIRCLE_ARTIFACTS/convox-installer.log grep -v "Created Unknown" $CIRCLE_ARTIFACTS/convox-installer.log -convox logs --app $STACK_NAME > $CIRCLE_ARTIFACTS/convox.log & +convox instances \ No newline at end of file diff --git a/ci/report.sh b/ci/report.sh index f14914ce42..af83fe7ddd 100755 --- a/ci/report.sh +++ b/ci/report.sh @@ -6,6 +6,8 @@ export CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM:-0} export STACK_NAME=convox-${CIRCLE_BUILD_NUM} export $($(dirname $0)/region.sh ${CIRCLE_NODE_INDEX}) +convox logs --app $STACK_NAME --follow=false --since=24h > $CIRCLE_ARTIFACTS/convox.log + # Save App ECS Artifacts aws ecs list-clusters | tee $CIRCLE_ARTIFACTS/list-clusters.json aws ecs describe-clusters --clusters $(jq -r '.clusterArns[]' $CIRCLE_ARTIFACTS/list-clusters.json) | tee $CIRCLE_ARTIFACTS/describe-clusters.json