Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
orchestra
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PERE Alexandre
orchestra
Commits
9f7b1d77
Commit
9f7b1d77
authored
Nov 13, 2019
by
Alexandre Pere
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes Warning
parent
391d383a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
17 deletions
+19
-17
liborchestra/Cargo.toml
liborchestra/Cargo.toml
+2
-0
liborchestra/src/lib/hosts/mod.rs
liborchestra/src/lib/hosts/mod.rs
+1
-1
liborchestra/src/lib/mod.rs
liborchestra/src/lib/mod.rs
+1
-1
liborchestra/src/lib/primitives.rs
liborchestra/src/lib/primitives.rs
+1
-2
liborchestra/src/lib/repository/mod.rs
liborchestra/src/lib/repository/mod.rs
+2
-1
liborchestra/src/lib/scheduler.rs
liborchestra/src/lib/scheduler.rs
+0
-1
liborchestra/src/lib/ssh/config.rs
liborchestra/src/lib/ssh/config.rs
+1
-1
liborchestra/src/lib/ssh/mod.rs
liborchestra/src/lib/ssh/mod.rs
+4
-4
liborchestra/src/lib/timer.rs
liborchestra/src/lib/timer.rs
+6
-4
runaway-cli/src/subcommands/exec.rs
runaway-cli/src/subcommands/exec.rs
+1
-2
No files found.
liborchestra/Cargo.toml
View file @
9f7b1d77
...
@@ -17,6 +17,7 @@ rust-crypto = "0.2"
...
@@ -17,6 +17,7 @@ rust-crypto = "0.2"
uuid
=
{
version
=
"0.6"
,
features
=
[
"serde"
,
"v4"
]
}
uuid
=
{
version
=
"0.6"
,
features
=
[
"serde"
,
"v4"
]
}
rpassword
=
"0.0.4"
rpassword
=
"0.0.4"
ssh2
=
"0.3.3"
ssh2
=
"0.3.3"
shells
=
"0.2.0"
dirs
=
"1.0"
dirs
=
"1.0"
url
=
"1.7.2"
url
=
"1.7.2"
git2
=
{
version
=
"0.8"
}
git2
=
{
version
=
"0.8"
}
...
@@ -27,6 +28,7 @@ walkdir = "2.2.7"
...
@@ -27,6 +28,7 @@ walkdir = "2.2.7"
libc
=
"0.2"
libc
=
"0.2"
globset
=
"0.4.4"
globset
=
"0.4.4"
tracing
=
"0.1.10"
tracing
=
"0.1.10"
tracing-subscriber
=
"0.1.6"
tracing-attributes
=
"0.1.5"
tracing-attributes
=
"0.1.5"
tracing-futures
=
{
version
=
"0.1.0"
,
features
=
["futures-preview"]
}
tracing-futures
=
{
version
=
"0.1.0"
,
features
=
["futures-preview"]
}
derivative
=
"1.0.3"
derivative
=
"1.0.3"
...
...
liborchestra/src/lib/hosts/mod.rs
View file @
9f7b1d77
...
@@ -759,7 +759,7 @@ async fn allocate_nodes(frontend: &Frontend,
...
@@ -759,7 +759,7 @@ async fn allocate_nodes(frontend: &Frontend,
// If the allocation failed we return an error
// If the allocation failed we return an error
misc
::
compact_outputs
(
outputs
)
misc
::
compact_outputs
(
outputs
)
.result
()
.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
// We return the Allocation context
Ok
(
FrontendContext
(
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/mod.rs
//!
//!
//! Liborchestra:
//! Liborchestra:
...
...
liborchestra/src/lib/primitives.rs
View file @
9f7b1d77
...
@@ -15,8 +15,7 @@ use crate::ssh::RemoteHandle;
...
@@ -15,8 +15,7 @@ use crate::ssh::RemoteHandle;
use
globset
;
use
globset
;
use
std
::
io
::
Read
;
use
std
::
io
::
Read
;
use
std
::
fmt
;
use
std
::
fmt
;
use
tracing
::{
self
,
error
,
trace
,
warn
,
instrument
,
trace_span
};
use
tracing
::{
self
,
instrument
};
use
tracing_futures
::
Instrument
;
...
...
liborchestra/src/lib/repository/mod.rs
View file @
9f7b1d77
...
@@ -898,7 +898,8 @@ impl CampaignHandle {
...
@@ -898,7 +898,8 @@ impl CampaignHandle {
_
dropper
:
Dropper
::
from_closure
(
_
dropper
:
Dropper
::
from_closure
(
Box
::
new
(
move
||{
Box
::
new
(
move
||{
drop_sender
.close_channel
();
drop_sender
.close_channel
();
handle
.join
();
handle
.join
()
.unwrap_or_else
(|
_
|
{
error!
(
"Failed to wait"
)});
}),
}),
format!
(
"CampaignHandle"
)),
format!
(
"CampaignHandle"
)),
})
})
...
...
liborchestra/src/lib/scheduler.rs
View file @
9f7b1d77
...
@@ -29,7 +29,6 @@ use futures::channel::mpsc::{UnboundedSender};
...
@@ -29,7 +29,6 @@ use futures::channel::mpsc::{UnboundedSender};
use
std
::
fmt
::{
Display
,
Debug
};
use
std
::
fmt
::{
Display
,
Debug
};
use
std
::
process
::
Command
;
use
std
::
process
::
Command
;
use
crate
::
*
;
use
crate
::
*
;
use
serde
::{
Deserialize
,
Serialize
};
use
serde_json
;
use
serde_json
;
use
std
::
os
::
unix
::
process
::
ExitStatusExt
;
use
std
::
os
::
unix
::
process
::
ExitStatusExt
;
use
tracing
::{
self
,
error
,
trace
,
instrument
,
trace_span
};
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> {
...
@@ -671,7 +671,7 @@ impl<'s> Parser<'s> {
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
if
ib
.as_str
()
==
"ProxyCommand"
=>
{
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
if
ib
.as_str
()
==
"ProxyCommand"
=>
{
self
.consume_proxycommand_clause
()
self
.consume_proxycommand_clause
()
}
}
Some
(
Ok
(
Token
(
TokenType
::
NewLine
,
ib
)))
=>
{
Some
(
Ok
(
Token
(
TokenType
::
NewLine
,
_
ib
)))
=>
{
None
None
}
}
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
=>
{
Some
(
Ok
(
Token
(
TokenType
::
Word
,
ib
)))
=>
{
...
...
liborchestra/src/lib/ssh/mod.rs
View file @
9f7b1d77
...
@@ -348,7 +348,7 @@ impl ProxyCommandForwarder {
...
@@ -348,7 +348,7 @@ impl ProxyCommandForwarder {
while
kf1
.load
(
Ordering
::
Relaxed
)
{
while
kf1
.load
(
Ordering
::
Relaxed
)
{
match
std
::
io
::
copy
(
&
mut
command_stdout
,
&
mut
socket1
){
match
std
::
io
::
copy
(
&
mut
command_stdout
,
&
mut
socket1
){
Err
(
e
)
=>
{
Err
(
e
)
=>
{
error!
(
"stdout forwarding failed
"
);
error!
(
"stdout forwarding failed
: {}"
,
e
);
break
break
}
}
Ok
(
0
)
=>
{
Ok
(
0
)
=>
{
...
@@ -373,7 +373,7 @@ impl ProxyCommandForwarder {
...
@@ -373,7 +373,7 @@ impl ProxyCommandForwarder {
while
kf2
.load
(
Ordering
::
Relaxed
)
{
while
kf2
.load
(
Ordering
::
Relaxed
)
{
match
std
::
io
::
copy
(
&
mut
socket2
,
&
mut
command_stdin
){
match
std
::
io
::
copy
(
&
mut
socket2
,
&
mut
command_stdin
){
Err
(
e
)
=>
{
Err
(
e
)
=>
{
error!
(
"stdin forwarding failed
"
);
error!
(
"stdin forwarding failed
: {}"
,
e
);
break
break
}
}
Ok
(
0
)
=>
{
Ok
(
0
)
=>
{
...
@@ -600,7 +600,7 @@ impl std::fmt::Debug for OperationInput{
...
@@ -600,7 +600,7 @@ impl std::fmt::Debug for OperationInput{
fn
fmt
(
&
self
,
f
:
&
mut
std
::
fmt
::
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
fn
fmt
(
&
self
,
f
:
&
mut
std
::
fmt
::
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
match
self
{
match
self
{
OperationInput
::
Exec
(
c
)
=>
write!
(
f
,
"Exec({:?})"
,
c
),
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
::
ScpSend
(
a
,
b
)
=>
write!
(
f
,
"ScpSend({:?}, {:?})"
,
a
,
b
),
OperationInput
::
ScpFetch
(
a
,
b
)
=>
write!
(
f
,
"ScpFetch({:?}, {:?})"
,
a
,
b
),
OperationInput
::
ScpFetch
(
a
,
b
)
=>
write!
(
f
,
"ScpFetch({:?}, {:?})"
,
a
,
b
),
}
}
...
@@ -1394,7 +1394,7 @@ mod test {
...
@@ -1394,7 +1394,7 @@ mod test {
init
();
init
();
let
(
proxy_command
,
address
)
=
ProxyCommandForwarder
::
from_command
(
"echo kikou"
)
.unwrap
();
let
(
proxy_command
,
address
)
=
ProxyCommandForwarder
::
from_command
(
"echo kikou"
)
.unwrap
();
let
mut
stream
=
TcpStream
::
connect
(
address
)
.unwrap
();
let
mut
stream
=
TcpStream
::
connect
(
address
)
.unwrap
();
std
::
thread
::
sleep
_ms
(
1000
);
std
::
thread
::
sleep
(
1000
);
assert
!
(
TcpStream
::
connect
(
address
)
.is_err
());
assert
!
(
TcpStream
::
connect
(
address
)
.is_err
());
let
mut
buf
=
[
0
as
u8
;
6
];
let
mut
buf
=
[
0
as
u8
;
6
];
stream
.read_exact
(
&
mut
buf
)
.unwrap
();
stream
.read_exact
(
&
mut
buf
)
.unwrap
();
...
...
liborchestra/src/lib/timer.rs
View file @
9f7b1d77
...
@@ -15,7 +15,6 @@ use std::thread;
...
@@ -15,7 +15,6 @@ use std::thread;
use
futures
::
channel
::
mpsc
::{
UnboundedSender
};
use
futures
::
channel
::
mpsc
::{
UnboundedSender
};
use
std
::
fmt
::
Debug
;
use
std
::
fmt
::
Debug
;
use
std
::
process
::
Command
;
use
crate
::
*
;
use
crate
::
*
;
use
tracing
::{
self
,
warn
,
trace
,
instrument
,
trace_span
};
use
tracing
::{
self
,
warn
,
trace
,
instrument
,
trace_span
};
use
tracing_futures
::
Instrument
;
use
tracing_futures
::
Instrument
;
...
@@ -160,6 +159,7 @@ impl<T> Slot<T>{
...
@@ -160,6 +159,7 @@ impl<T> Slot<T>{
/// Gives a handle to the inner.
/// Gives a handle to the inner.
#[inline]
#[inline]
#[allow(dead_code)]
pub
fn
as_arrayvec
(
&
self
)
->
&
ArrayVec
<
[
Timed
<
T
>
;
SLOT_LEN
]
>
{
pub
fn
as_arrayvec
(
&
self
)
->
&
ArrayVec
<
[
Timed
<
T
>
;
SLOT_LEN
]
>
{
&
self
.waiters
&
self
.waiters
}
}
...
@@ -178,12 +178,14 @@ impl<T> Slot<T>{
...
@@ -178,12 +178,14 @@ impl<T> Slot<T>{
/// Returns the duration of the slot.
/// Returns the duration of the slot.
#[inline]
#[inline]
#[allow(dead_code)]
pub
fn
duration
(
&
self
)
->
Duration
{
pub
fn
duration
(
&
self
)
->
Duration
{
self
.end
-
self
.beginning
self
.end
-
self
.beginning
}
}
/// Returns the number of timed inside.
/// Returns the number of timed inside.
#[inline]
#[inline]
#[allow(dead_code)]
pub
fn
len
(
&
self
)
->
usize
{
pub
fn
len
(
&
self
)
->
usize
{
self
.waiters
.len
()
self
.waiters
.len
()
}
}
...
@@ -337,10 +339,10 @@ impl<T> Timer<T>{
...
@@ -337,10 +339,10 @@ impl<T> Timer<T>{
if
do_turn
{
if
do_turn
{
let
slot
=
{
let
slot
=
{
let
mut
current_wheel
=
&
mut
self
.0
[
w
];
let
current_wheel
=
&
mut
self
.0
[
w
];
current_wheel
.turn
()
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
()
let
res
:
Result
<
Vec
<
usize
>
,
Timed
<
T
>>
=
slot
.to_vec
()
.into_iter
()
.into_iter
()
.map
(|
t
|
previous_wheel
.try_insert
(
t
))
.map
(|
t
|
previous_wheel
.try_insert
(
t
))
...
@@ -363,6 +365,7 @@ impl<T> Timer<T>{
...
@@ -363,6 +365,7 @@ impl<T> Timer<T>{
}
}
/// Returns the number of timed in the timer.
/// Returns the number of timed in the timer.
#[allow(dead_code)]
pub
fn
len
(
&
self
)
->
usize
{
pub
fn
len
(
&
self
)
->
usize
{
self
.0
.iter
()
.fold
(
0
,
|
a
,
w
|
a
+
w
.len
())
self
.0
.iter
()
.fold
(
0
,
|
a
,
w
|
a
+
w
.len
())
}
}
...
@@ -473,7 +476,6 @@ impl TimerHandle{
...
@@ -473,7 +476,6 @@ impl TimerHandle{
match
receiver
.await
{
match
receiver
.await
{
Err
(
e
)
=>
Err
(
Error
::
OperationFetch
(
format!
(
"{}"
,
e
))),
Err
(
e
)
=>
Err
(
Error
::
OperationFetch
(
format!
(
"{}"
,
e
))),
Ok
(
OperationOutput
::
Sleep
)
=>
Ok
(()),
Ok
(
OperationOutput
::
Sleep
)
=>
Ok
(()),
Ok
(
e
)
=>
Err
(
Error
::
OperationFetch
(
format!
(
"Expected RequestParameters, found {:?}"
,
e
)))
}
}
}
.instrument
(
trace_span!
(
"SchedulerHandle::async_request_parameters"
))
}
.instrument
(
trace_span!
(
"SchedulerHandle::async_request_parameters"
))
}
}
...
...
runaway-cli/src/subcommands/exec.rs
View file @
9f7b1d77
...
@@ -18,8 +18,7 @@ use clap;
...
@@ -18,8 +18,7 @@ use clap;
use
uuid
;
use
uuid
;
use
futures
::
executor
::
block_on
;
use
futures
::
executor
::
block_on
;
use
crate
::{
to_exit
};
use
crate
::{
to_exit
};
use
liborchestra
::
commons
::{
EnvironmentValue
,
EnvironmentStore
,
use
liborchestra
::
commons
::{
EnvironmentStore
,
substitute_environment
,
OutputBuf
,
push_env
};
substitute_environment
,
OutputBuf
,
push_env
};
use
crate
::
misc
;
use
crate
::
misc
;
use
crate
::
exit
::
Exit
;
use
crate
::
exit
::
Exit
;
use
liborchestra
::
primitives
;
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