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

Allow specifying number of worker threads used to run an enclave #625

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

s-arash
Copy link
Contributor

@s-arash s-arash commented Jul 12, 2024

This change allows users of this library to specify the number of worker threads. This lets users limit the number of cores used by an enclave.

This is a backwards-compatible change.

arai-fortanix
arai-fortanix previously approved these changes Jul 12, 2024
intel-sgx/enclave-runner/src/command.rs Outdated Show resolved Hide resolved
@aditijannu
Copy link

I had been working the CI fixes here which you will face in your CI job too - #624
It is not complete yet and I need to fix one of the nitro crates used in rust-sgx.

@s-arash s-arash force-pushed the arash/num-worker-threads branch from da2817c to cc998ae Compare July 12, 2024 20:44
@s-arash s-arash force-pushed the arash/num-worker-threads branch from cc998ae to ea171ab Compare July 15, 2024 20:04
@s-arash s-arash changed the title Allow specifying number of worker threads when running an enclave Allow specifying number of worker threads used to run an enclave Jul 15, 2024
@s-arash
Copy link
Contributor Author

s-arash commented Jul 15, 2024

I had been working the CI fixes here which you will face in your CI job too - #624 It is not complete yet and I need to fix one of the nitro crates used in rust-sgx.

Thanks @aditijannu. I'll rebase this PR once your PR lands.

@s-arash s-arash requested a review from Goirad July 15, 2024 20:37
@s-arash s-arash force-pushed the arash/num-worker-threads branch from ea171ab to cbe6600 Compare July 18, 2024 16:31
arai-fortanix
arai-fortanix previously approved these changes Jul 18, 2024
intel-sgx/enclave-runner/src/loader.rs Outdated Show resolved Hide resolved
intel-sgx/enclave-runner/src/loader.rs Outdated Show resolved Hide resolved
}

/// Panics if you have previously called [`arg`] or [`args`].
/// Panics if you have previously called [`arg`], [`args`], or [`num_worker_threads`].
Copy link
Contributor

Choose a reason for hiding this comment

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

With so many parameters that aren't shared between Command and Library enclaves, does it maybe make sense to have separate builders for Command and Library enclaves? That way, each type of builder could only have the parameters that make sense for the type of enclave it builds.

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 agree. But that would be a breaking change. I think it's better to release a sem-ver compatible version with this change, and leave this kind of refactoring to a future sem-ver breaking version.

@s-arash s-arash force-pushed the arash/num-worker-threads branch from 4fd27d4 to 2fa7a24 Compare July 25, 2024 20:45
@s-arash s-arash force-pushed the arash/num-worker-threads branch from 2fa7a24 to 4f3aef7 Compare January 14, 2025 21:11
@s-arash
Copy link
Contributor Author

s-arash commented Jan 14, 2025

@raoulstrackx @aditijannu @Taowyoo @mzohreva @Goirad Could you take a look at this PR? We need to merge this soon.

Copy link
Collaborator

@Taowyoo Taowyoo left a comment

Choose a reason for hiding this comment

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

Lgtm,, left one question regarding available range of input thread number

intel-sgx/enclave-runner/src/loader.rs Show resolved Hide resolved
@s-arash s-arash added this pull request to the merge queue Jan 15, 2025
Merged via the queue into master with commit b254abc Jan 15, 2025
1 check passed
@s-arash s-arash deleted the arash/num-worker-threads branch January 15, 2025 19:08
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.

5 participants