Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Commit 50a69fe

Browse files
committed
style: reformat code
1 parent 9021766 commit 50a69fe

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

brane-bvm/src/vm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ where
294294
///
295295
async fn run(&mut self) -> Option<Slot> {
296296
while let Some(instruction) = self.next() {
297-
debug!("{:?}", instruction);
298-
299297
match *instruction {
300298
OP_ADD => self.op_add(),
301299
OP_AND => self.op_and(),
@@ -348,6 +346,7 @@ where
348346
}
349347
}
350348

349+
// INVESTIGATE: this appears to cause a deadlock (?).
351350
// debug!("Sending stack to client.");
352351
// self.executor.debug(format!("{}", self.stack)).await.unwrap();
353352
// debug!("Sent stack to client.");

brane-cfg/src/infrastructure.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,21 @@ pub enum Location {
5353
}
5454

5555
impl Location {
56-
pub fn get_address(self) -> String {
56+
pub fn get_address(&self) -> String {
5757
match self {
58-
Location::Kube { address, .. } | Location::Vm { address, .. } | Location::Slurm { address, .. } => address,
59-
Location::Local { address, .. } => address.unwrap_or_else(|| String::from("127.0.0.1")),
58+
Location::Kube { address, .. } | Location::Vm { address, .. } | Location::Slurm { address, .. } => {
59+
address.clone()
60+
}
61+
Location::Local { address, .. } => address.clone().unwrap_or_else(|| String::from("127.0.0.1")),
62+
}
63+
}
64+
65+
pub fn get_registry(&self) -> String {
66+
match self {
67+
Location::Kube { registry, .. }
68+
| Location::Vm { registry, .. }
69+
| Location::Slurm { registry, .. }
70+
| Location::Local { registry, .. } => registry.clone(),
6071
}
6172
}
6273
}

brane-drv/src/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl Future for WaitUntil {
289289
let state = self.states.get(&self.correlation_id);
290290
if let Some(state) = state {
291291
let state = state.value();
292-
292+
293293
if state >= &self.at_least {
294294
return Poll::Ready(());
295295
}

brane-dsl/src/generator/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ pub fn stmt_to_opcodes(
304304
// TODO: merge with block statement?
305305
Stmt::On { location, block } => {
306306
// Create a new scope (shadow).
307-
let scope = scope + 1;
307+
// let scope = scope + 1;
308308

309309
expr_to_opcodes(location, chunk, locals, scope);
310310
chunk.write(OP_LOC_PUSH);

brane-job/src/cmd_create.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const BRANE_MOUNT_DFS: &str = "BRANE_MOUNT_DFS";
3838
///
3939
pub async fn handle(
4040
key: &str,
41-
command: Command,
41+
mut command: Command,
4242
infra: Infrastructure,
4343
secrets: Secrets,
4444
xenon_endpoint: String,
@@ -55,6 +55,8 @@ pub async fn handle(
5555
let location_id = command.location.clone().unwrap();
5656
let location = infra.get_location_metadata(&location_id).with_context(context)?;
5757

58+
command.image = Some(format!("{}/library/{}", location.get_registry(), &image));
59+
5860
// Generate job identifier.
5961
let job_id = format!("{}-{}", correlation_id, get_random_identifier());
6062

brane-log/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct Opts {
3333
#[clap(short, long, env = "DEBUG", takes_value = false)]
3434
debug: bool,
3535
/// Topic to receive events from
36-
#[clap(short, long = "evt-topics", env = "EVENT_TOPIC", multiple = true)]
36+
#[clap(short, long = "evt-topics", env = "EVENT_TOPIC", multiple_values = true)]
3737
event_topics: Vec<String>,
3838
/// Consumer group id
3939
#[clap(short, long, default_value = "brane-log", env = "GROUP_ID")]

0 commit comments

Comments
 (0)