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

Initial changes for distributed jmeter executor #4282

Closed
wants to merge 1 commit into from

Conversation

hiteshwani29
Copy link

Pull request description

Checklist (choose whats happened)

  • breaking change! (describe)
  • tested locally
  • tested on cluster
  • added new dependencies
  • updated the docs
  • added a test

Breaking changes

Changes

Fixes

Copy link
Collaborator

@vsukhin vsukhin left a comment

Choose a reason for hiding this comment

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

Out of 70 files - 62 are copy/paste ones. can we do it better and have common packages for jmeter?

}
}

sl, err := slaves.NewClient(execution, r.Params, slaves.SlavesEnvOptions{RunPath: runPath, OverrideJvmArgs: "-Xmn256m -Xms512m -Xmx512m"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

JVM args shouldn't be hardcoded, we should be able to override them

return *result.WithErrors(errors.Errorf("Getting error while creating slaves nodes: %v", err)), nil
}

args = append(args, fmt.Sprintf("-R %v", GetSlavesIpString(slavesNameIpMap)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be great to have dynamic arg as above -R <slaveAddresses>

}
out = envManager.ObfuscateSecrets(out)

defer sl.DeleteSlaves(slavesNameIpMap)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would move it ealier to CreateSlaves

const (
serverPort = 1099
localport = 60001
)
Copy link
Collaborator

@vsukhin vsukhin Aug 22, 2023

Choose a reason for hiding this comment

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

should be able to redefine in config or parameters


// Wait for the pod to become ready
conditionFunc := isPodReady(context.Background(), client.clientSet, p.Name, client.namespace)
timeout := 5 * time.Minute
Copy link
Collaborator

Choose a reason for hiding this comment

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

move to const at least

conditionFunc := isPodReady(context.Background(), client.clientSet, p.Name, client.namespace)
timeout := 5 * time.Minute

err = wait.PollImmediate(time.Second, timeout, conditionFunc)
Copy link
Collaborator

@vsukhin vsukhin Aug 22, 2023

Choose a reason for hiding this comment

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

also should be const, interval or something

func (client *Client) DeleteSlaves(slaveNameIpMap map[string]string) {
for slaveName := range slaveNameIpMap {
output.PrintLog(fmt.Sprintf("Deleting slave %v", slaveName))
client.clientSet.CoreV1().Pods(client.namespace).Delete(context.Background(), slaveName, metav1.DeleteOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would record error, if we have it

Value: envParams.CloudAPIURL,
},
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, it should be in one place in api or we will need to sync them

},
},
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be taken from template, we don't hard code spec

return *result.WithErrors(errors.Errorf("Getting error while creating slaves nodes: %v", err)), nil
}

args = append(args, fmt.Sprintf("-R %v", GetSlavesIpString(slavesNameIpMap)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

see comments above


const (
serverPort = 1099
localport = 60001
Copy link
Collaborator

Choose a reason for hiding this comment

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

again looks like a copy for above file

Value: envParams.CloudAPIURL,
},
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

again, one more copy

Copy link
Collaborator

@vsukhin vsukhin left a comment

Choose a reason for hiding this comment

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

so, it's good in general, but sounds like only 4 new files, we can organoe it better

@hiteshwani29
Copy link
Author

hiteshwani29 commented Aug 23, 2023

Unable to modify PR title. Initiating a new PR with an appropriate title following the correct naming conventions.
I will address the mentioned comments in the upcoming PR.
Thanks your understanding!

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