-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
@@ -3,7 +3,6 @@ | |||
/// TODO: | |||
/// - Handle default values for FileType | |||
/// - Repo wide reorganization | |||
extern crate proc_macro; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was unneeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
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>, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be specified
There was a problem hiding this comment.
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
martian-rust/martian/src/mro.rs
Line 657 in 7028107
mro_using! {mem_gb: i16, threads: i16, vmem_gb: i16, volatile: Volatile} |
martian-rust/martian-derive/src/lib.rs
Line 392 in 7028107
attr_parse!( |
#[make_mro(special="...")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be
special: Option<String>, | |
special: Option<&' static str>, |
There is no plausible use case for this being something other than a compile-time constant.
There was a problem hiding this comment.
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)
@@ -2,25 +2,29 @@ | |||
"chunks": [ | |||
{ | |||
"__mem_gb": 1, | |||
"__special": null, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.