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

Dataset for organizations #857

Merged
merged 4 commits into from
Jul 1, 2024
Merged

Dataset for organizations #857

merged 4 commits into from
Jul 1, 2024

Conversation

pedroigor
Copy link
Contributor

Closes #856

@pedroigor
Copy link
Contributor Author

@martin-kanis @vmuzikar @sguilhen Please, let me know if you want to add more operations/settings when provisioning organizations.

I tried to start with the bare minimum to start working on the scalability of groups and identity providers. For the latter, it is already possible to see how much identity providers degrade performance when rendering login pages.

Closes keycloak#856

Signed-off-by: Pedro Igor <[email protected]>
Copy link
Contributor

@martin-kanis martin-kanis left a comment

Choose a reason for hiding this comment

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

@pedroigor Thanks, overall looks good to me. Please see my comments regarding usability.

Alternatively, you can create a single organization with a given name:

----
realms/realm-0/dataset/orgs/create?name=myorg.com&domains=myorg.com,myorg.org,myorg.net&count=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Parameter count is required here but it doesn't make sense, as I want to create just one org and if I provide count=5 it is ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it is a limitation. Otherwise, I'll need to create add another parameter just to make it optional.

linked to each organization created:

----
.../realms/realm-0/dataset/orgs/create?count=1000&unmanaged-members-count=500&identity-providers-count=10
Copy link
Contributor

Choose a reason for hiding this comment

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

This crashes my Keycloak instance, consider lowering number of users or number of orgs in the example.

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 can create even more orgs than 1k. Do you have more details what it is failing for you?

Signed-off-by: Pedro Igor <[email protected]>
Signed-off-by: Pedro Igor <[email protected]>
Signed-off-by: Pedro Igor <[email protected]>
@martin-kanis
Copy link
Contributor

@pedroigor With the latest version and Keycloak 25, I'm getting

Caused by: java.lang.NoSuchMethodError: 'org.keycloak.models.OrganizationModel org.keycloak.organization.OrganizationProvider.create(java.lang.String, java.lang.String)'
		at org.keycloak.benchmark.dataset.organization.OrganizationProvisioner.createOrganization(OrganizationProvisioner.java:165)
		at org.keycloak.benchmark.dataset.organization.OrganizationProvisioner.lambda$createOrganizations$0(OrganizationProvisioner.java:134)
		at org.keycloak.models.utils.KeycloakModelUtils.lambda$runJobInTransaction$1(KeycloakModelUtils.java:263)
		at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransactionWithResult(KeycloakModelUtils.java:386)
		at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:262)
		at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransactionWithTimeout(KeycloakModelUtils.java:407)
		at org.keycloak.benchmark.dataset.ExecutorHelper.lambda$addTaskRunningInTransaction$0(ExecutorHelper.java:58)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

when running /realms/realm-0/dataset/orgs/create?count=2000&unmanaged-members-count=500&identity-providers-count=10
Am I doing something wrong?

@pedroigor pedroigor merged commit 5103a9d into keycloak:main Jul 1, 2024
3 checks passed
@pedroigor pedroigor deleted the issue-856 branch July 1, 2024 12:40
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.

Dataset for organizations
2 participants