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

feat: model special resource requests too #512

Merged
merged 11 commits into from
Jul 18, 2024
Merged

feat: model special resource requests too #512

merged 11 commits into from
Jul 18, 2024

Conversation

preyasshah
Copy link
Collaborator

No description provided.

@@ -3,7 +3,6 @@
/// TODO:
/// - Handle default values for FileType
/// - Repo wide reorganization
extern crate proc_macro;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

was unneeded

Copy link
Member

@sreenathkrishnan sreenathkrishnan left a comment

Choose a reason for hiding this comment

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

Looks good!

martian/src/stage.rs Show resolved Hide resolved
pub struct Resource {
#[serde(rename = "__mem_gb")]
mem_gb: Option<isize>,
#[serde(rename = "__threads")]
threads: Option<isize>,
#[serde(rename = "__vmem_gb")]
vmem_gb: Option<isize>,
#[serde(rename = "__special")]
special: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

This cannot be specified in the using section of the mro right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can be specified

Copy link
Member

Choose a reason for hiding this comment

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

Okay, to support it in the using section, we would need to update

mro_using! {mem_gb: i16, threads: i16, vmem_gb: i16, volatile: Volatile}
and . This is only needed if we want to specify #[make_mro(special="...")]

Copy link
Member

Choose a reason for hiding this comment

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

This should really be

Suggested change
special: Option<String>,
special: Option<&' static str>,

There is no plausible use case for this being something other than a compile-time constant.

Copy link
Member

Choose a reason for hiding this comment

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

(yes, I know this poses problems for deserialization but I can't think of a plausible case where you need to deserialize it either)

@preyasshah preyasshah enabled auto-merge (squash) July 18, 2024 16:58
@preyasshah preyasshah merged commit f7c10bb into master Jul 18, 2024
2 checks passed
@preyasshah preyasshah deleted the ps/hacks branch July 18, 2024 17:02
@@ -2,25 +2,29 @@
"chunks": [
{
"__mem_gb": 1,
"__special": null,
Copy link
Member

Choose a reason for hiding this comment

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

This should not be written if special was unset. Please fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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