-
Notifications
You must be signed in to change notification settings - Fork 4
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
MIDRC-768 Check if instance type is available in AZ when creating subnets for Nextflow #111
base: master
Are you sure you want to change the base?
Conversation
Please find the detailed integration test report here Please find the ci env pod logs here |
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.
Minor comments, but looks good.
Please find the detailed integration test report here Please find the ci env pod logs here |
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.
Some minor suggestions and questions. Otherwise Looks good to me.
}, | ||
{ | ||
Name: aws.String("instance-type"), | ||
// TODO: Should this be configurable? |
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.
Do we need this TODO:
comment? To whom is this question pointed out to?
return nil, fmt.Errorf("Error describing instance type offerings: %v", err) | ||
} | ||
if len(result.InstanceTypeOfferings) > 0 { | ||
Config.Logger.Printf("Debug: Zone: %v has instance type g4dn.xlarge available. Using that for subnet", *zone.ZoneName) |
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.
Maybe change this from the hardcoded g4dn.xlarge
to {instanceType}
variable.
// TODO: read instance type from config. (MIDRC-751) | ||
subnetId, err := setupSubnet(subnetName, subnetString, vpcid, ec2svc, "t2.micro") |
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.
This hardcoded string will be changed to a configurable value as a part of a future ticket. Right?
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.
yes, see comment. MIDRC-751
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.
looking at the changes this doesn't look right: setupSubnet
's instanceType
parameter is the type we want for nextflow jobs instances, it's not the squid instance type we want to configure in MIDRC-751 - it should be g4dn.xlarge
not t2.micro
. I think you got it confused with this?
so i think it should be:
setupSubnet(... availableInstanceTypes=["g4dn.xlarge"]) <-- get list from config
[...]
// TODO: read instance type from config. (MIDRC-751)
launchSquidInstance(... instanceType="t2.micro")
// Make sure the selected AZ has the instance type from nextflow configuration available. | ||
var selectedZone string | ||
for _, zone := range describeZonesOutput.AvailabilityZones { | ||
if *zone.State == "available" { |
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.
Instead of adding an if
condition here checking for availability of an Availability Zone, can we add a filter in the above line?
describeZonesOutput, err := ec2Svc.DescribeAvailabilityZones(&ec2.DescribeAvailabilityZonesInput{})
Note: I haven't looked too deep into the docs, but if the input is used as a filter, maybe that is better than us filtering it ourselves.
subnets := []*string{} | ||
for _, subnet := range subnetids { | ||
s := subnet | ||
subnets = append(subnets, &s) | ||
} |
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.
Maybe add a comment that says that we're changing an array of strings to an array of string pointers because of such and such reason.
Link to JIRA ticket if there is one:
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes