Commit ed47909c authored by Alexandre Péré's avatar Alexandre Péré

Removes unecessary code

parent 200719a6
[workspace]
members = [
"liborchestra",
#"expegit-cli",
"runaway-cli",
#"orchestra-cli",
"liborchestra-derive",
"remote-leak"]
[replace]
"liborchestra:0.0.2" = { path = "liborchestra"}
#"expegit-cli:0.0.2" = { path = "expegit-cli"}
"runaway-cli:0.0.2" = { path = "runaway-cli"}
#"orchestra-cli:0.0.2" = { path = "orchestra-cli"}
"liborchestra-derive:0.0.2" = {path = "liborchestra-derive"}
"remote-leak:0.0.2" = {path = "remote-leak"}
"ssh2:0.3.3" = { path = "ssh2-rs"}
[package]
name = "expegit-cli"
version = "0.0.2"
authors = ["Alexandre Péré <alexandre.pere@protonmail.com>"]
[dependencies]
log = "0.3"
pretty_logger = "0.1"
clap="2.31"
liborchestra = { path = "../liborchestra"}
This diff is collapsed.
[package]
name = "liborchestra-derive"
version = "0.0.2"
authors = ["Alexandre Péré <alexandre.pere@protonmail.com>"]
edition = "2018"
[lib]
proc-macro = true
[dependencies]
syn = "0.15.23"
quote = "0.6.12"
\ No newline at end of file
extern crate proc_macro;
use crate::proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
#[proc_macro_derive(State)]
pub fn derive_state_trait(input: TokenStream) -> TokenStream{
let input = parse_macro_input!(input as DeriveInput);
let name = &input.ident;
let generics = input.generics;
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let expanded = quote!{
impl #impl_generics crate::stateful::State for #name #ty_generics #where_clause{
fn as_any(&self) -> &dyn std::any::Any {self}
}
};
TokenStream::from(expanded)
}
[package]
name = "orchestra-cli"
version = "0.0.2"
authors = ["Alexandre Péré <alexandre.pere@protonmail.com>"]
[dependencies]
log = "0.3"
pretty_logger = "0.1"
actix = "0.7"
actix-web = "0.7"
handlebars = "1.0"
regex = "1"
futures = "0.1"
clap="2.31"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0.38"
liborchestra = { path = "../liborchestra"}
\ No newline at end of file
{{!--
The executions overview page allows to see all the executions, to sort filter and manipulate those.
--}}
{{!-- Title and buttons--}}
<div class="ui grid" style="padding-top:5%;">
<div class="ten wide column">
<h1> Execution {{execution_id}}</h1>
</div>
<div class="right aligned six wide column">
<div class="ui buttons">
<button class="ui primary basic button" href="{{execution_remote_url}}">
<i class="git icon"></i>
Repository
</button>
<button class="ui yellow basic button" id="reschedule_button">
<i class="recycle icon"></i>
Reschedule
</button>
<button class="ui negative basic button" id="delete_button">
<i class="trash alternate outline icon"></i>
Delete
</button>
</div>
</div>
</div>
<script>
$("#reschedule_button").api({
action: "reschedule execution",
method: "POST",
data:{
"identifier": "{{execution_id}}",
},
serializeForm: true,
beforeSend: function (settings) {
$("#reschedule_button").addClass("loading");
return settings;
},
onResponse: function (response) {
$("#reschedule_button").removeClass("loading");
return response;
},
successTest: function (response) {
return response.success;
},
});
$("#delete_button").api({
action: "delete execution",
method: "POST",
data:{
"identifier": "{{execution_id}}",
},
serializeForm: true,
beforeSend: function (settings) {
$("#delete_button").addClass("loading");
return settings;
},
onResponse: function (response) {
$("#delete_button").removeClass("loading");
return response;
},
successTest: function (response) {
return response.success;
},
})
</script>
{{!-- Execution related content --}}
<div class="ui grid">
<div class="ui horizontal divider">
Settings
</div>
<div class="sixteen wide column">
<table class="ui definition table">
<tbody>
<tr>
<td class="three wide column">Experiment git commit</td>
<td><a href="{{experiment_commit_url}}">{{execution_commit}}</a></td>
</tr>
<tr>
<td>Parameters</td>
<td>{{execution_parameters}}</td>
</tr>
<tr>
<td>Profile</td>
<td>{{execution_executor}}</td>
</tr>
<tr>
<td>Date</td>
<td>{{execution_start_time}}</td>
</tr>
<tr>
<td>Duration</td>
<td>{{execution_duration}}</td>
</tr>
<tr>
<td>Exit Code</td>
<td>{{execution_exit_code}}</td>
</tr>
</tbody>
</table>
</div>
<div class="ui horizontal divider">
Script Streams
</div>
<div class="sixteen wide column">
<div class="ui segments">
<div class="ui green segment">
<div class="ui accordion">
<div class="title">
<i class="dropdown icon"></i>
Standard Output
</div>
<div class="content">
<p class="transition visible" style="display: block !important;">
<div class="ui olive message">
<p>
{{{execution_stdout}}}
</p>
</div>
</p>
</div>
</div>
</div>
<div class="ui red segment">
<div class="ui accordion">
<div class="title">
<i class="dropdown icon"></i>
Standard Error
</div>
<div class="content">
<p class="transition visible" style="display: block !important;">
<div class="ui red message">
<p>
{{{execution_stderr}}}
</p>
</div>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="ui horizontal divider">
Figures
</div>
<div class="sixteen wide column">
{{#each figures}}
<img class="ui centered big image" src={{this}}>
{{/each}}
</div>
<div class="ui horizontal divider">
Files
</div>
<div class="sixteen wide column">
<div class="ui items">
{{#each files}}
<div class="item">
<div class="image">
<i class=" huge file alternate outline icon"></i>
</div>
<div class="content">
<a class="header" href={{this.address}}>{{this.name}}</a>
<div class="meta">
<span>Path</span>
</div>
<div class="description">
<p>{{this.path}}</p>
</div>
</div>
</div>
{{/each}}
</div>
</div>
</div>
<script>
$('.ui.accordion').accordion();
</script>
\ No newline at end of file
{{!--
The executions overview page allows to see all the executions, to sort filter and manipulate those.
--}}
{{!-- Title and help box --}}
<div class="ui accordion" style="padding-top: 2%">
<div class="title">
<h1>Executions<i class="dropdown icon"></i></h1>
</div>
<div class="content">
<div class="ui info message transition">
<div class="header">
What to do here?
</div>
<p>You can see an overview of the different executions. To select an execution, just click on it.
The search range is effective on all columns.</p>
</div>
</div>
<br>
</div>
<script>
$(".ui.accordion").accordion();
</script>
<!-- Executions table -->
<div class="ui centered grid" , id="grid">
<div class="sixteen wide column">
<table class="ui compact table" id='executions_table'>
<thead>
<tr>
<th>Id</th>
<th>Commit</th>
<th>Params.</th>
<th>Status</th>
<th>Date</th>
<th>Duration</th>
<th>Profile</th>
<th>Generator</th>
<th>Code</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
$("#executions_table").DataTable({
"paging": false,
"ajax": "/api/get_executions",
"columnDefs": [
{
"render": function (data, type, row) {
return `<a href="/executions/${data}" id="${data}">${data.slice(0, 9) + "..."}</a>`;
},
"targets": 0,
},
{
"render": function (data, type, row) {
return data.slice(0, 5);
},
"targets": 1,
},
{
"render": function(data, type, row) {
console.log(data);
re = /([[0-9\-*]*)T([^\.]*)/g;
match = re.exec(data);
if (match === null){
return ""
}
else{
return match[1] + " " + match[2];
}
},
"targets": 4,
}
],
"createdRow": function (row, data, dataIndex) {
if (data[8] == "0") {
$(row).addClass("positive");
}
else {
$(row).addClass("negative");
}
},
"dom": '<"ui buttons"> frti',
});
$("div.ui.buttons").html(`
<button class="ui basic primary button" id="executions_table_select_all_button">
Select All
</button>
<button class="ui basic primary button" id="executions_table_deselect_all_button">
Deselect All
</button>
<div class="ui basic yellow dropdown button" id="executions_table_reschedule_button">
<i class="recycle icon"></i>
<span class="text">Reschedule</span>
<div class="menu">
</div>
</div>
<button class="ui basic negative button" id="executions_table_delete_button">
<i class="trash alternate outline icon"></i>
Delete
</button>
`);
$("#executions_table_filter").css("float", "right");
$("#executions_table tbody").on("click", "tr", function () {
$(this).toggleClass("active");
});
$("#executions_table_select_all_button").click(function () {
$("#executions_table").DataTable().rows({"search": "applied",}).nodes().toArray().forEach(x => $(x).addClass("active"));
});
$("#executions_table_deselect_all_button").click(function () {
$("#executions_table").DataTable().rows({"search": "applied",}).nodes().toArray().forEach(x => $(x).removeClass("active"));
});
$("#executions_table_delete_button").click(function () {
$("#executions_table_delete_button").addClass("loading");
let identifiers = $("#executions_table").DataTable()
.rows({"search": "applied",})
.nodes()
.toArray()
.filter(x => $(x).hasClass("active"))
.map(x => $(x).find("a").attr("id"))
.join("¤");
$.post("/api/delete_executions", {identifiers: identifiers}, _ => location.reload());
});
$('#executions_table_reschedule_button').dropdown({
apiSettings: {
action: 'get profiles',
onResponse: function (response) {
var values = {
"success": true,
"results": [],
};
for (v in response) {
values["results"].push({
"name": response[v],
"value": response[v],
"text": response[v]
});
}
return values;
},
},
onChange: function (value, text, $selectedItem) {
$("#executions_table_reschedule_button").addClass("loading");
let identifiers = $("#executions_table").DataTable()
.rows({"search": "applied",})
.nodes()
.toArray()
.filter(x => $(x).hasClass("active"))
.map(x => $(x).find("a").attr("id"))
.join("¤");
var profile = $("#executions_table_reschedule_button").find("span").text();
$.post("/api/reschedule_executions", {
identifiers: identifiers,
profile: profile
}, _ => location.reload());
},
filterRemoteData: true,
saveRemoteData: false,
});
</script>
</div>
\ No newline at end of file
{{!--
The home page present basic settings of the campaign
--}}
{{!-- Title and buttons--}}
<div class="ui grid" style="padding-top:5%;">
<div class="twelve wide column">
<h1>Campaign "{{campaign_name}}" on experiment "{{exp_name}}"</h1>
</div>
<div class="right aligned four wide column">
<div class="ui buttons">
<button class="ui primary basic button" id="sync_button">
<i class="sync icon"></i>
Synchronize
</button>
</div>
</div>
</div>
<script>
$("#sync_button").click(function(){
$(this).addClass("loading");
$.get("/api/synchronize_campaign", function(data, status){
if (status=="success"){
location.reload();
}
else{
console.log("kikou");
$("#sync_button").removeClass("loading");
$("#sync_button").removeClass("primary");
$("#sync_button").addClass("negative");
}
});
})
</script>
<!-- Campaign related informations -->
<div class="ui centered grid" , id="grid">
<div class="ui horizontal divider">
Campaign Settings
</div>
<div class="sixteen wide column">
<table class="ui definition table">
<tbody>
<tr>
<td class="two wide column">Campaign Repository</td>
<td><a href="{{campaign_web_url}}">{{campaign_repo_url}}</a></td>
</tr>
<tr>
<td>Experiment Repository</td>
<td><a href="{{exp_web_url}}">{{exp_repo_url}}</a></td>
</tr>
<tr>
<td>Total number of executions</td>
<td>{{execution_count}}</td>
</tr>
</tbody>
</table>
</div>
</div>
\ No newline at end of file
{{!--
The manual generation page allows to generate batches of experiments and add them to the queue.
--}}
{{!-- Title and help box --}}
<div class="ui accordion" style="padding-top: 2%">
<div class="title">
<h1>Manual Execution Generation <i class="dropdown icon"></i> </h1>
</div>
<div class="content">
<div class="ui info message transition">
<div class="header">
How does it work?
</div>
<p>This page allows you to manually generate batches of experiment execution. Please enter the following
informations:
<ul class="ui list">
<li>The path to the experiment script, relative to the experiment repository</li>
<li>The commit hash of the experiment at which you want to perform the experiments</li>
<li>The execution profile to use to run the executions</li>
<li>The number of times you want to perform each combinations of parameters</li>
<li>The parameters variations you want to try</li>
</ul>
Note that for each possible combination of the parameters you inputed, an execution wil be created.
</p>
</div>
</div>
<br>
</div>
{{!-- The form --}}
<form class="ui form" id="jobs_generation_form">
<h4 class="ui dividing header">General Settings</h4>
<div class="three fields">
<div class="field">
<label>Commit hash</label>
<div class="ui fluid search selection dropdown" id="commit_dropdown">
<input name="commit_hash" type="hidden">
<i class="dropdown icon"></i>
<div class="default text">Select commit</div>
</div>
<script>
$('#commit_dropdown').dropdown({
apiSettings: {
action: 'get commits',
onResponse: function (response) {
var values = {
"success": true,
"results": [],
};
for (v in response) {
values["results"].push({
"name": response[v],
"value": response[v],
"text": response[v]
});
}
return values;
},
cache: false,
},
filterRemoteData: true,
saveRemoteData: false,
});
</script>
</div>
<div class="field">
<label>Execution profile</label>
<div class="ui fluid search selection dropdown" id="profile_dropdown">
<input name="execution_profile" type="hidden">
<i class="dropdown icon"></i>
<div class="default text">Select profile</div>
</div>
<script>
$('#profile_dropdown').dropdown({
apiSettings: {
action: 'get profiles',
onResponse: function (response) {
var values = {
"success": true,
"results": [],
};
for (v in response) {
values["results"].push({
"name": response[v],
"value": response[v],
"text": response[v]
});
}
return values;
},
},
filterRemoteData: true,
saveRemoteData: false,
});
</script>
</div>
<div class="field">
<label>Executions repetition</label>
<input name="repetitions" placeholder="1" type="number">
</div>
</div>
<h4 class="ui dividing header">Parameters</h4>
<table class="ui celled table" id="params_table">
<thead>
<tr>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Value">
<div class="ui fluid transparent input">
<input placeholder="Separate different parameters with semi-colon ;" type="text">
</div>
</td>
</tr>
</tbody>
<tfoot class="full-width">
<tr>
<th>
<div class="ui small button" id="add_params_button">
Add
</div>
</th>
</tr>
</tfoot>
</table>
<script>
$("#add_params_button").click(function () {
let i = $("#params_table >tbody >tr").length + 1;
$('#params_table tbody:last').append(`<tr id="params_tr_${i}"><td data-label="Value"><div class="ui fluid transparent input"><input placeholder="Separate different parameters with semi-colon ;" type="text"></div></td></tr>`);
$(`#params_tr_${i}`).keypress(function (e) {
if ((e.which === 8) && ($(`#params_tr_${i} input:last`).val() === "")) {
$(this).remove();
}
});
});
</script>
<div class="ui error message" id="error">
</div>
<button class="ui green ok inverted button">
<i class="checkmark icon"></i>
Generate Jobs
</button>
</form>
<script>
// Set up form
$("#jobs_generation_form")
.form({
fields: {
script_path: 'empty',
commit_hash: 'empty',
execution_profile: 'empty',
repetitions: ['empty', 'integer'],
},
onFailure: function (response) {
$("#error").text(response.error);
$("#error").show();
},
onSuccess: function (response) {
location.replace("/tasks");
},
})
.api({
action: "generate jobs",
method: "POST",
serializeForm: true,
beforeSend: function (settings) {
$("#jobs_generation_form").addClass("loading");
settings.data.parameters = $("#params_table >tbody >tr input").toArray().map(x => x.value).join("¤");
return settings;
},
successTest: function (response) {
return response.success;
},
});
</script>
<script>
$('.ui.accordion').accordion();
</script>
\ No newline at end of file
{{!--
The app page template.
Except for the start page, all pages share the same header and sidebar. The content is set to a partial at rendering.
--}}
<!DOCTYPE html>
<html>
<head>