Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jawadqur
Copy link
Contributor

Link to JIRA ticket if there is one:

New Features

Breaking Changes

Bug Fixes

Improvements

  • Run a quick check before creating the subnet to make sure the instance type for nextflow is available in that AZ.

Dependency updates

Deployment changes

Copy link

filepath $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{tests/test\_discoverypage.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_workspace.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#23d18b}{\tt{2}}$$

Please find the detailed integration test report here

Please find the ci env pod logs here

Copy link
Contributor

@nss10 nss10 left a 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.

hatchery/nextflow.go Show resolved Hide resolved
nss10
nss10 previously approved these changes Jun 13, 2024
@paulineribeyre paulineribeyre changed the title Check if instance type is available in AZ when creating subnets for Nextflow MIDRC-768 Check if instance type is available in AZ when creating subnets for Nextflow Jun 13, 2024
Copy link

filepath $$\textcolor{#f14c4c}{\tt{failed}}$$ SUBTOTAL
$$\textcolor{#f14c4c}{\tt{tests/test\_discoverypage.py}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$
$$\textcolor{#f14c4c}{\tt{tests/test\_workspace.py}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$
$$\textcolor{#f14c4c}{\tt{TOTAL}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$

Please find the detailed integration test report here

Please find the ci env pod logs here

Copy link
Contributor

@nss10 nss10 left a 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?
Copy link
Contributor

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)
Copy link
Contributor

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.

Comment on lines +991 to +992
// TODO: read instance type from config. (MIDRC-751)
subnetId, err := setupSubnet(subnetName, subnetString, vpcid, ec2svc, "t2.micro")
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@paulineribeyre paulineribeyre Jun 21, 2024

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" {
Copy link
Contributor

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.

Comment on lines +663 to +667
subnets := []*string{}
for _, subnet := range subnetids {
s := subnet
subnets = append(subnets, &s)
}
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants