Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PERE Alexandre
orchestra
Commits
9f7b1d77
Commit
9f7b1d77
authored
Nov 13, 2019
by
Alexandre Pere
Browse files
Removes Warning
parent
391d383a
Changes
10
Hide whitespace changes
Inline
Side-by-side
liborchestra/Cargo.toml
View file @
9f7b1d77
...
...
@@ -17,6 +17,7 @@ rust-crypto = "0.2"
uuid
=
{
version
=
"0.6"
,
features
=
[
"serde"
,
"v4"
]
}
rpassword
=
"0.0.4"
ssh2
=
"0.3.3"
shells
=
"0.2.0"
dirs
=
"1.0"
url
=
"1.7.2"
git2
=
{
version
=
"0.8"
}
...
...
@@ -27,6 +28,7 @@ walkdir = "2.2.7"
libc
=
"0.2"
globset
=
"0.4.4"
tracing
=
"0.1.10"
tracing-subscriber
=
"0.1.6"
tracing-attributes
=
"0.1.5"
tracing-futures
=
{
version
=
"0.1.0"
,
features
=
["futures-preview"]
}
derivative
=
"1.0.3"
...
...
liborchestra/src/lib/hosts/mod.rs
View file @
9f7b1d77
...
...
@@ -759,7 +759,7 @@ async fn allocate_nodes(frontend: &Frontend,
// If the allocation failed we return an error
misc
::
compact_outputs
(
outputs
)
.result
()
.map_err
(|
e
|
Error
::
AllocationFailed
(
format!
(
"Failed to allocate on command
"
)))
?
;
.map_err
(|
e
|
Error
::
AllocationFailed
(
format!
(
"Failed to allocate on command
: {}"
,
e
)))
?
;
// We return the Allocation context
Ok
(
FrontendContext
(
context
))
}
...
...
liborchestra/src/lib/mod.rs
View file @
9f7b1d77
#![feature(
trace_macros,
async_await,
result_map_or_else,
trait_alias,
try_blocks)]
#![feature(result_map_or_else,
trait_alias,
try_blocks)]
//! liborchestra/mod.rs
//!
//! Liborchestra:
...
...
liborchestra/src/lib/primitives.rs
View file @
9f7b1d77
...
...
@@ -15,8 +15,7 @@ use crate::ssh::RemoteHandle;
use
globset
;
use
std
::
io
::
Read
;
use
std
::
fmt
;
use
tracing
::{
self
,
error
,
trace
,
warn
,
instrument
,
trace_span
};
use
tracing_futures
::
Instrument
;
use
tracing
::{
self
,
instrument
};
...
...
liborchestra/src/lib/repository/mod.rs
View file @
9f7b1d77
...
...
@@ -898,7 +898,8 @@ impl CampaignHandle {
_dropper
:
Dropper
::
from_closure
(
Box
::
new
(
move
||{
drop_sender
.close_channel
();
handle
.join
();
handle
.join
()
.unwrap_or_else
(|
_
|
{
error!
(
"Failed to wait"
)});
}),
format!
(
"CampaignHandle"
)),
})
...
...
liborchestra/src/lib/scheduler.rs
View file @
9f7b1d77
...
...
@@ -29,7 +29,6 @@ use futures::channel::mpsc::{UnboundedSender};
use
std
::
fmt
::{
Display
,
Debug
};
use
std
::
process
::
Command
;
use
crate
::
*
;
use
serde
::{
Deserialize
,
Serialize
};
use
serde_json
;
use
std
::
os
::
unix
::
process
::
ExitStatusExt
;
use
tracing
::{
self
,
error
,
trace
,
instrument
,
trace_span
};
...
...
liborchestra/src/lib/ssh/config.rs
View file @
9f7b1d77
...
...
@@ -671,7 +671,7 @@ impl<'s> Parser<'s> {
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
if
ib
.as_str
()
==
"ProxyCommand"
=>
{
self
.consume_proxycommand_clause
()
}
Some
(
Ok
(
Token
(
TokenType
::
NewLine
,
ib
)))
=>
{
Some
(
Ok
(
Token
(
TokenType
::
NewLine
,
_
ib
)))
=>
{
None
}
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
=>
{
...
...
liborchestra/src/lib/ssh/mod.rs
View file @
9f7b1d77
...
...
@@ -348,7 +348,7 @@ impl ProxyCommandForwarder {
while
kf1
.load
(
Ordering
::
Relaxed
)
{
match
std
::
io
::
copy
(
&
mut
command_stdout
,
&
mut
socket1
){
Err
(
e
)
=>
{
error!
(
"stdout forwarding failed
"
);
error!
(
"stdout forwarding failed
: {}"
,
e
);
break
}
Ok
(
0
)
=>
{
...
...
@@ -373,7 +373,7 @@ impl ProxyCommandForwarder {
while
kf2
.load
(
Ordering
::
Relaxed
)
{
match
std
::
io
::
copy
(
&
mut
socket2
,
&
mut
command_stdin
){
Err
(
e
)
=>
{
error!
(
"stdin forwarding failed
"
);
error!
(
"stdin forwarding failed
: {}"
,
e
);
break
}
Ok
(
0
)
=>
{
...
...
@@ -600,7 +600,7 @@ impl std::fmt::Debug for OperationInput{
fn
fmt
(
&
self
,
f
:
&
mut
std
::
fmt
::
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
match
self
{
OperationInput
::
Exec
(
c
)
=>
write!
(
f
,
"Exec({:?})"
,
c
),
OperationInput
::
Pty
(
t
,
c
,
out
,
err
)
=>
write!
(
f
,
"Pty({:?}, {}, {})"
,
c
,
stringify!
(
out
),
stringify!
(
err
)),
OperationInput
::
Pty
(
_
,
c
,
_
out
,
_
err
)
=>
write!
(
f
,
"Pty({:?}, {}, {})"
,
c
,
stringify!
(
_
out
),
stringify!
(
_
err
)),
OperationInput
::
ScpSend
(
a
,
b
)
=>
write!
(
f
,
"ScpSend({:?}, {:?})"
,
a
,
b
),
OperationInput
::
ScpFetch
(
a
,
b
)
=>
write!
(
f
,
"ScpFetch({:?}, {:?})"
,
a
,
b
),
}
...
...
@@ -1394,7 +1394,7 @@ mod test {
init
();
let
(
proxy_command
,
address
)
=
ProxyCommandForwarder
::
from_command
(
"echo kikou"
)
.unwrap
();
let
mut
stream
=
TcpStream
::
connect
(
address
)
.unwrap
();
std
::
thread
::
sleep
_ms
(
1000
);
std
::
thread
::
sleep
(
1000
);
assert
!
(
TcpStream
::
connect
(
address
)
.is_err
());
let
mut
buf
=
[
0
as
u8
;
6
];
stream
.read_exact
(
&
mut
buf
)
.unwrap
();
...
...
liborchestra/src/lib/timer.rs
View file @
9f7b1d77
...
...
@@ -15,7 +15,6 @@ use std::thread;
use
futures
::
channel
::
mpsc
::{
UnboundedSender
};
use
std
::
fmt
::
Debug
;
use
std
::
process
::
Command
;
use
crate
::
*
;
use
tracing
::{
self
,
warn
,
trace
,
instrument
,
trace_span
};
use
tracing_futures
::
Instrument
;
...
...
@@ -160,6 +159,7 @@ impl<T> Slot<T>{
/// Gives a handle to the inner.
#[inline]
#[allow(dead_code)]
pub
fn
as_arrayvec
(
&
self
)
->
&
ArrayVec
<
[
Timed
<
T
>
;
SLOT_LEN
]
>
{
&
self
.waiters
}
...
...
@@ -178,12 +178,14 @@ impl<T> Slot<T>{
/// Returns the duration of the slot.
#[inline]
#[allow(dead_code)]
pub
fn
duration
(
&
self
)
->
Duration
{
self
.end
-
self
.beginning
}
/// Returns the number of timed inside.
#[inline]
#[allow(dead_code)]
pub
fn
len
(
&
self
)
->
usize
{
self
.waiters
.len
()
}
...
...
@@ -337,10 +339,10 @@ impl<T> Timer<T>{
if
do_turn
{
let
slot
=
{
let
mut
current_wheel
=
&
mut
self
.0
[
w
];
let
current_wheel
=
&
mut
self
.0
[
w
];
current_wheel
.turn
()
};
let
mut
previous_wheel
=
&
mut
self
.0
[
w
-
1
];
let
previous_wheel
=
&
mut
self
.0
[
w
-
1
];
let
res
:
Result
<
Vec
<
usize
>
,
Timed
<
T
>>
=
slot
.to_vec
()
.into_iter
()
.map
(|
t
|
previous_wheel
.try_insert
(
t
))
...
...
@@ -363,6 +365,7 @@ impl<T> Timer<T>{
}
/// Returns the number of timed in the timer.
#[allow(dead_code)]
pub
fn
len
(
&
self
)
->
usize
{
self
.0
.iter
()
.fold
(
0
,
|
a
,
w
|
a
+
w
.len
())
}
...
...
@@ -473,7 +476,6 @@ impl TimerHandle{
match
receiver
.await
{
Err
(
e
)
=>
Err
(
Error
::
OperationFetch
(
format!
(
"{}"
,
e
))),
Ok
(
OperationOutput
::
Sleep
)
=>
Ok
(()),
Ok
(
e
)
=>
Err
(
Error
::
OperationFetch
(
format!
(
"Expected RequestParameters, found {:?}"
,
e
)))
}
}
.instrument
(
trace_span!
(
"SchedulerHandle::async_request_parameters"
))
}
...
...
runaway-cli/src/subcommands/exec.rs
View file @
9f7b1d77
...
...
@@ -18,8 +18,7 @@ use clap;
use
uuid
;
use
futures
::
executor
::
block_on
;
use
crate
::{
to_exit
};
use
liborchestra
::
commons
::{
EnvironmentValue
,
EnvironmentStore
,
substitute_environment
,
OutputBuf
,
push_env
};
use
liborchestra
::
commons
::{
EnvironmentStore
,
substitute_environment
,
OutputBuf
,
push_env
};
use
crate
::
misc
;
use
crate
::
exit
::
Exit
;
use
liborchestra
::
primitives
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment