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

Add max_tasks_per_node setting to Batch Pool #2805

Merged
merged 8 commits into from
Jan 31, 2019

Conversation

stuartleeks
Copy link
Contributor

No description provided.

@stuartleeks stuartleeks changed the title Add max_tasks_per_node setting Add max_tasks_per_node setting to Batch Pool Jan 30, 2019
Copy link
Contributor

@metacpp metacpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartleeks Thanks for the PR. I've gone through all the changes here, most of them LGTM. If you can address the comments in line, then it's good for merge.

"max_tasks_per_node": {
Type: schema.TypeInt,
Optional: true,
Default: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a validation for this field ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -243,6 +248,8 @@ func resourceArmBatchPoolCreate(d *schema.ResourceData, meta interface{}) error
poolName := d.Get("name").(string)
displayName := d.Get("display_name").(string)
vmSize := d.Get("vm_size").(string)
maxTasksPerNode := d.Get("max_tasks_per_node").(int)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we directly assert it as int32 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the temporary variable now!

@@ -243,6 +248,8 @@ func resourceArmBatchPoolCreate(d *schema.ResourceData, meta interface{}) error
poolName := d.Get("name").(string)
displayName := d.Get("display_name").(string)
vmSize := d.Get("vm_size").(string)
maxTasksPerNode := d.Get("max_tasks_per_node").(int)
foo := int32(maxTasksPerNode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a more readable name ? For example, maxTasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops - I meant to use a clearer name here! Done in latest commits

VMSize: &vmSize,
DisplayName: &displayName,
MaxTasksPerNode: &foo,
// MaxTasksPerNode: &maxTasksPerNode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// MaxTasksPerNode: &maxTasksPerNode,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in latest commits

@stuartleeks
Copy link
Contributor Author

@metacpp - Thanks for your review. I've just pushed some changes to address your feedback. Let me know if you have any further comments.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @stuartleeks,

Thanks for the enhancement! for the most part this LGTM aside from a couple comments i've left inline. Once those are fixed up it should be good to merge 🙂

@@ -102,6 +102,8 @@ The following arguments are supported:

* `display_name` - (Optional) Specifies the display name of the Batch pool.

* `max_tasks_per_node` - (Optional) Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the default value here?

Suggested change
* `max_tasks_per_node` - (Optional) Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool.
* `max_tasks_per_node` - (Optional) Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - added to both docs

@@ -323,7 +324,8 @@ resource "azurerm_batch_pool" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
account_name = "${azurerm_batch_account.test.name}"
display_name = "Test Acc Pool"
vm_size = "Standard_A1"
vm_size = "Standard_A1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we fix the formatting/alignment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@stuartleeks
Copy link
Contributor Author

Thanks @katbyte - I've made the changes you requested.Let me know if you have any further comments

@ghost ghost removed the waiting-response label Jan 30, 2019
@katbyte katbyte self-assigned this Jan 30, 2019
Co-Authored-By: stuartleeks <stuart@leeks.net>
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @stuartleeks! LGTM now 👍

@katbyte katbyte modified the milestones: 2.0.0, 1.22.0 Jan 31, 2019
@katbyte katbyte merged commit b6eb4c4 into hashicorp:master Jan 31, 2019
katbyte added a commit that referenced this pull request Jan 31, 2019
@ghost
Copy link

ghost commented Mar 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants