Skip to content

Commit

Permalink
revise: adds Resource::builder()
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Feb 5, 2025
1 parent 0547a84 commit 8f2e0be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
18 changes: 12 additions & 6 deletions crankshaft-docker/src/bin/docker-driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,18 @@ async fn run(args: &Args) -> Result<()> {

match &args.command {
Command::CreateContainer { image, name, tag } => {
create_container(docker, image, tag, name, [
String::from("/usr/bin/env"),
String::from("bash"),
String::from("-c"),
String::from("echo 'hello, world!'"),
])
create_container(
docker,
image,
tag,
name,
[
String::from("/usr/bin/env"),
String::from("bash"),
String::from("-c"),
String::from("echo 'hello, world!'"),
],
)
.await?;
}
Command::RunContainer {
Expand Down
5 changes: 5 additions & 0 deletions crankshaft-engine/src/task/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ pub struct Resources {
}

impl Resources {
/// Gets a new resources builder.
pub fn builder() -> Builder {
Builder::default()
}

/// A number of CPU cores.
pub fn cpu(&self) -> Option<usize> {
self.cpu
Expand Down

0 comments on commit 8f2e0be

Please sign in to comment.