Loading lcov.info +344 −327 Original line number Diff line number Diff line Loading @@ -151,85 +151,102 @@ DA:85,0 DA:86,0 DA:87,0 DA:89,0 DA:92,0 DA:93,0 DA:95,0 DA:94,0 DA:96,0 DA:98,0 DA:99,0 DA:100,0 DA:101,0 DA:102,0 DA:103,0 DA:105,0 DA:109,0 DA:106,0 DA:107,0 DA:110,0 DA:111,0 DA:112,0 DA:114,0 DA:113,0 DA:115,0 DA:118,0 DA:120,0 DA:119,0 DA:121,0 DA:122,0 DA:123,0 DA:124,0 DA:125,0 DA:126,0 DA:127,0 DA:128,0 DA:130,0 DA:129,0 DA:131,0 DA:135,0 DA:136,0 DA:137,0 DA:138,0 DA:140,0 DA:142,0 DA:144,0 DA:147,0 DA:146,0 DA:148,0 DA:149,0 DA:151,0 DA:152,0 DA:153,0 DA:155,0 DA:157,0 DA:158,0 DA:159,0 DA:160,0 DA:161,0 DA:162,0 DA:164,0 DA:165,0 DA:166,0 DA:169,0 DA:170,0 DA:173,0 DA:174,0 DA:167,0 DA:168,0 DA:172,0 DA:175,0 DA:178,0 DA:180,0 DA:181,0 DA:184,0 DA:182,0 DA:185,0 DA:187,0 DA:189,0 DA:190,0 DA:191,0 DA:192,0 DA:193,0 DA:194,0 DA:195,0 DA:196,0 DA:197,0 DA:198,0 DA:199,0 DA:200,0 DA:201,0 DA:202,0 DA:203,0 DA:204,0 DA:205,0 DA:206,0 DA:208,0 DA:211,0 DA:209,0 DA:210,0 DA:213,0 DA:214,0 DA:217,0 DA:218,0 DA:219,0 DA:222,0 DA:224,0 LF:118 DA:225,0 DA:228,0 DA:229,0 DA:233,0 DA:234,0 DA:235,0 DA:236,0 DA:237,0 DA:240,0 DA:241,0 DA:242,0 DA:243,0 DA:244,0 DA:245,0 DA:246,0 DA:247,0 DA:248,0 DA:249,0 DA:250,0 DA:252,0 DA:255,0 DA:258,0 DA:261,0 DA:263,0 DA:266,0 DA:268,0 LF:135 LH:0 end_of_record TN: Loading Loading @@ -352,67 +369,67 @@ LH:0 end_of_record TN: SF:/root/dev/command/pipe-lib/src/lib.rs FN:363,Command::test FN:390,Config::read FN:414,Config::read_json FN:435,Config::read_yaml FN:452,Config::set_environment_variables FN:466,<impl PartialEq for Details>::eq FN:473,EnvironmentValue::from_string FN:476,EnvironmentValue::from_value FN:484,EnvironmentValue::prepend_prefix FN:488,EnvironmentValue::trim_prefix FN:492,EnvironmentValue::get_from_serde FN:506,EnvironmentValue::get_all FN:516,EnvironmentValue::print_all FN:521,EnvironmentValue::set_variable FN:531,EnvironmentValue::set_variables FN:538,Extension::from_string FN:547,Label::dry_run FN:551,Label::fail FN:555,Label::found FN:559,Label::not_found FN:563,Label::output FN:567,Label::read FN:571,Label::rejected FN:575,Label::run FN:579,Label::using FN:585,ModuleUri<'_>::from FN:595,ModuleUri<'_>::hash FN:619,ModuleUri<'_>::get_whitelist FN:622,ModuleUri<'_>::is_allowed FN:625,ModuleUri<'_>::test FN:626,ModuleUri<'_>::test::check FN:643,ModuleUri<'_>::working_directory FN:655,SemanticVersion::from_string FN:678,Script::expand_arguments FN:713,Script::expand_arguments_from FN:745,Script::from_template FN:773,Script::from_path FN:785,Script::get_command FN:791,Script::get_arguments FN:802,Script::maybe_create_conda_environment FN:835,Script::maybe_git_clone FN:842,Script::python_default FN:856,Script::run FN:927,Script::with_current_dir FN:965,Script::with_environment FN:970,Script::with_envs FN:979,StringTemplate::new FN:988,StringTemplate::expand FN:995,StringTemplate::get_variable FN:1025,StringTemplate::is_handlebars FN:1060,StringTemplate::remove_spaces FN:1070,add_forward_slash FN:1078,get_conda_environment_list FN:1120,get_conda_environment_name FN:1152,get_extension FN:1156,get_parent FN:1169,has_extension FN:1173,is_stdin_piped FN:1181,is_stdout_piped FN:1199,read_file FN:1213,to_string FN:364,Command::test FN:391,Config::read FN:415,Config::read_json FN:436,Config::read_yaml FN:453,Config::set_environment_variables FN:467,<impl PartialEq for Details>::eq FN:474,EnvironmentValue::from_string FN:477,EnvironmentValue::from_value FN:485,EnvironmentValue::prepend_prefix FN:489,EnvironmentValue::trim_prefix FN:493,EnvironmentValue::get_from_serde FN:507,EnvironmentValue::get_all FN:517,EnvironmentValue::print_all FN:522,EnvironmentValue::set_variable FN:532,EnvironmentValue::set_variables FN:539,Extension::from_string FN:548,Label::dry_run FN:552,Label::fail FN:556,Label::found FN:560,Label::not_found FN:564,Label::output FN:568,Label::read FN:572,Label::rejected FN:576,Label::run FN:580,Label::using FN:586,ModuleUri<'_>::from FN:596,ModuleUri<'_>::hash FN:620,ModuleUri<'_>::get_whitelist FN:623,ModuleUri<'_>::is_allowed FN:626,ModuleUri<'_>::test FN:627,ModuleUri<'_>::test::check FN:644,ModuleUri<'_>::working_directory FN:656,SemanticVersion::from_string FN:679,Script::expand_arguments FN:714,Script::expand_arguments_from FN:746,Script::from_template FN:774,Script::from_path FN:786,Script::get_command FN:792,Script::get_arguments FN:803,Script::maybe_create_conda_environment FN:836,Script::maybe_git_clone FN:843,Script::python_default FN:857,Script::run FN:928,Script::with_current_dir FN:966,Script::with_environment FN:971,Script::with_envs FN:980,StringTemplate::new FN:989,StringTemplate::expand FN:996,StringTemplate::get_variable FN:1026,StringTemplate::is_handlebars FN:1061,StringTemplate::remove_spaces FN:1071,add_forward_slash FN:1079,get_conda_environment_list FN:1121,get_conda_environment_name FN:1153,get_extension FN:1157,get_parent FN:1170,has_extension FN:1174,is_stdin_piped FN:1182,is_stdout_piped FN:1200,read_file FN:1214,to_string FNF:61 FNDA:1,Command::test FNDA:1,Config::read Loading Loading @@ -460,7 +477,7 @@ FNDA:1,Script::run FNDA:1,Script::with_current_dir FNDA:2,Script::with_environment FNDA:0,Script::with_envs FNDA:1,StringTemplate::new FNDA:2,StringTemplate::new FNDA:1,StringTemplate::expand FNDA:1,StringTemplate::get_variable FNDA:1,StringTemplate::is_handlebars Loading @@ -475,74 +492,73 @@ FNDA:0,is_stdin_piped FNDA:0,is_stdout_piped FNDA:1,read_file FNDA:1,to_string DA:363,1 DA:364,1 DA:368,2 DA:371,1 DA:365,1 DA:369,2 DA:372,1 DA:374,2 DA:375,1 DA:376,2 DA:377,4 DA:379,6 DA:380,2 DA:383,3 DA:384,1 DA:390,1 DA:391,2 DA:373,1 DA:375,2 DA:376,1 DA:377,2 DA:378,4 DA:380,6 DA:381,2 DA:384,3 DA:385,1 DA:391,1 DA:392,2 DA:393,1 DA:395,0 DA:393,2 DA:394,1 DA:396,0 DA:399,2 DA:400,1 DA:402,0 DA:397,0 DA:400,2 DA:401,1 DA:403,0 DA:414,1 DA:415,2 DA:404,0 DA:415,1 DA:416,2 DA:418,0 DA:417,4 DA:419,0 DA:422,2 DA:423,1 DA:424,3 DA:425,0 DA:427,6 DA:428,2 DA:435,1 DA:436,2 DA:437,1 DA:439,0 DA:420,0 DA:423,4 DA:424,2 DA:425,4 DA:426,0 DA:428,6 DA:429,2 DA:436,1 DA:437,2 DA:438,1 DA:440,0 DA:443,2 DA:444,1 DA:445,2 DA:446,0 DA:448,3 DA:449,1 DA:452,0 DA:441,0 DA:444,2 DA:445,1 DA:446,2 DA:447,0 DA:449,3 DA:450,1 DA:453,0 DA:454,0 DA:455,0 DA:456,0 DA:457,0 DA:462,0 DA:466,1 DA:458,0 DA:463,0 DA:467,1 DA:473,0 DA:468,1 DA:474,0 DA:476,0 DA:475,0 DA:477,0 DA:478,0 DA:479,0 DA:480,0 DA:481,0 DA:484,0 DA:482,0 DA:485,0 DA:488,1 DA:486,0 DA:489,1 DA:490,2 DA:492,0 DA:490,1 DA:491,2 DA:493,0 DA:494,0 DA:495,0 Loading @@ -551,313 +567,314 @@ DA:497,0 DA:498,0 DA:499,0 DA:500,0 DA:502,0 DA:504,0 DA:506,1 DA:501,0 DA:503,0 DA:505,0 DA:507,1 DA:508,2 DA:508,1 DA:509,2 DA:510,2 DA:511,2 DA:512,1 DA:516,0 DA:512,2 DA:513,1 DA:517,0 DA:518,0 DA:521,0 DA:519,0 DA:522,0 DA:523,0 DA:524,0 DA:525,0 DA:526,0 DA:527,0 DA:531,0 DA:528,0 DA:532,0 DA:534,0 DA:538,1 DA:539,2 DA:533,0 DA:535,0 DA:539,1 DA:540,2 DA:541,3 DA:542,0 DA:547,0 DA:541,2 DA:542,3 DA:543,0 DA:548,0 DA:549,0 DA:551,0 DA:550,0 DA:552,0 DA:553,0 DA:555,0 DA:554,0 DA:556,0 DA:557,0 DA:559,0 DA:558,0 DA:560,0 DA:561,0 DA:563,1 DA:564,3 DA:562,0 DA:564,1 DA:565,3 DA:567,0 DA:566,3 DA:568,0 DA:569,0 DA:571,0 DA:570,0 DA:572,0 DA:573,0 DA:575,0 DA:574,0 DA:576,0 DA:577,0 DA:579,0 DA:578,0 DA:580,0 DA:581,0 DA:585,1 DA:582,0 DA:586,1 DA:587,2 DA:588,1 DA:589,2 DA:590,0 DA:592,1 DA:595,1 DA:587,1 DA:588,2 DA:589,1 DA:590,2 DA:591,0 DA:593,1 DA:596,1 DA:597,1 DA:598,1 DA:599,1 DA:600,0 DA:602,4 DA:606,4 DA:607,4 DA:609,4 DA:600,1 DA:601,0 DA:603,2 DA:607,2 DA:608,2 DA:610,2 DA:612,2 DA:615,0 DA:619,0 DA:611,2 DA:613,1 DA:616,0 DA:620,0 DA:622,0 DA:621,0 DA:623,0 DA:625,0 DA:624,0 DA:626,0 DA:627,0 DA:629,0 DA:628,0 DA:630,0 DA:631,0 DA:632,0 DA:633,0 DA:634,0 DA:635,0 DA:637,0 DA:639,0 DA:643,0 DA:636,0 DA:638,0 DA:640,0 DA:644,0 DA:645,0 DA:646,0 DA:647,0 DA:649,0 DA:648,0 DA:650,0 DA:655,1 DA:651,0 DA:656,1 DA:657,3 DA:657,1 DA:658,3 DA:659,3 DA:678,1 DA:679,2 DA:682,2 DA:683,1 DA:684,2 DA:685,1 DA:660,3 DA:679,1 DA:680,2 DA:683,2 DA:684,1 DA:685,2 DA:686,1 DA:688,2 DA:692,1 DA:687,1 DA:689,2 DA:693,1 DA:713,1 DA:714,2 DA:717,2 DA:718,1 DA:719,2 DA:694,1 DA:714,1 DA:715,2 DA:718,2 DA:719,1 DA:720,2 DA:723,2 DA:725,1 DA:727,2 DA:731,1 DA:721,2 DA:724,2 DA:726,1 DA:728,2 DA:732,1 DA:745,1 DA:733,1 DA:746,1 DA:747,3 DA:751,2 DA:753,2 DA:755,2 DA:758,1 DA:759,2 DA:760,3 DA:773,1 DA:774,2 DA:775,1 DA:777,0 DA:747,1 DA:748,3 DA:752,2 DA:754,2 DA:756,2 DA:759,1 DA:760,2 DA:761,3 DA:774,1 DA:775,2 DA:776,1 DA:778,0 DA:781,2 DA:782,1 DA:779,0 DA:782,2 DA:783,1 DA:785,1 DA:784,1 DA:786,1 DA:787,1 DA:788,1 DA:791,1 DA:789,1 DA:792,1 DA:793,1 DA:794,1 DA:794,2 DA:795,2 DA:796,2 DA:798,1 DA:802,0 DA:796,4 DA:797,2 DA:799,1 DA:803,0 DA:804,0 DA:805,0 DA:807,0 DA:806,0 DA:808,0 DA:809,0 DA:810,0 DA:811,0 DA:812,0 DA:814,0 DA:813,0 DA:815,0 DA:816,0 DA:817,0 DA:818,0 DA:819,0 DA:820,0 DA:822,0 DA:821,0 DA:823,0 DA:826,0 DA:830,0 DA:824,0 DA:827,0 DA:831,0 DA:835,1 DA:836,2 DA:832,0 DA:836,1 DA:837,2 DA:838,2 DA:839,3 DA:840,1 DA:842,0 DA:839,2 DA:840,3 DA:841,1 DA:843,0 DA:844,0 DA:852,0 DA:856,1 DA:845,0 DA:853,0 DA:857,1 DA:858,1 DA:859,2 DA:859,1 DA:860,2 DA:861,3 DA:862,1 DA:863,8 DA:864,2 DA:865,1 DA:861,2 DA:862,3 DA:863,1 DA:864,9 DA:865,2 DA:866,1 DA:867,1 DA:868,1 DA:873,4 DA:869,1 DA:874,2 DA:876,0 DA:875,2 DA:877,0 DA:880,2 DA:881,2 DA:882,4 DA:883,5 DA:884,3 DA:887,3 DA:888,1 DA:890,0 DA:878,0 DA:881,1 DA:882,2 DA:883,3 DA:884,4 DA:885,3 DA:888,3 DA:889,2 DA:891,0 DA:894,2 DA:892,0 DA:895,1 DA:896,3 DA:897,0 DA:896,2 DA:897,3 DA:898,0 DA:901,3 DA:902,2 DA:903,4 DA:904,1 DA:905,5 DA:899,0 DA:902,3 DA:903,1 DA:904,5 DA:905,2 DA:906,4 DA:907,2 DA:909,3 DA:907,5 DA:908,1 DA:910,3 DA:911,2 DA:914,0 DA:911,3 DA:912,2 DA:915,0 DA:916,0 DA:920,0 DA:917,0 DA:921,0 DA:927,1 DA:928,3 DA:922,0 DA:928,1 DA:929,2 DA:965,2 DA:930,1 DA:966,2 DA:967,2 DA:970,0 DA:968,2 DA:971,0 DA:972,0 DA:979,1 DA:981,1 DA:988,1 DA:989,4 DA:990,3 DA:995,1 DA:996,2 DA:973,0 DA:980,2 DA:982,1 DA:989,1 DA:990,4 DA:991,3 DA:996,1 DA:997,2 DA:998,1 DA:999,2 DA:1001,0 DA:1025,1 DA:1026,2 DA:998,2 DA:999,1 DA:1000,2 DA:1002,0 DA:1026,1 DA:1027,2 DA:1028,1 DA:1029,0 DA:1031,0 DA:1060,1 DA:1061,2 DA:1062,1 DA:1063,0 DA:1065,3 DA:1066,1 DA:1070,1 DA:1071,2 DA:1072,0 DA:1074,2 DA:1078,1 DA:1079,2 DA:1028,2 DA:1029,1 DA:1030,0 DA:1032,0 DA:1061,1 DA:1062,2 DA:1063,1 DA:1064,0 DA:1066,3 DA:1067,1 DA:1071,1 DA:1072,2 DA:1073,0 DA:1075,2 DA:1079,1 DA:1080,2 DA:1081,2 DA:1082,2 DA:1083,5 DA:1086,1 DA:1088,2 DA:1090,4 DA:1093,0 DA:1120,1 DA:1083,2 DA:1084,5 DA:1087,1 DA:1089,2 DA:1091,4 DA:1094,0 DA:1121,1 DA:1122,1 DA:1123,6 DA:1135,1 DA:1137,0 DA:1152,1 DA:1123,1 DA:1124,6 DA:1136,1 DA:1138,0 DA:1153,1 DA:1156,1 DA:1157,3 DA:1169,1 DA:1154,1 DA:1157,1 DA:1158,3 DA:1170,1 DA:1173,0 DA:1171,1 DA:1174,0 DA:1175,0 DA:1177,0 DA:1181,0 DA:1176,0 DA:1178,0 DA:1182,0 DA:1183,0 DA:1185,0 DA:1199,1 DA:1184,0 DA:1186,0 DA:1200,1 DA:1201,5 DA:1202,3 DA:1203,9 DA:1204,6 DA:1206,1 DA:1207,3 DA:1208,1 DA:1211,3 DA:1213,1 DA:1214,4 DA:1201,1 DA:1202,6 DA:1203,3 DA:1204,9 DA:1205,7 DA:1207,1 DA:1208,3 DA:1209,1 DA:1212,4 DA:1214,1 DA:1215,4 LF:383 LH:224 end_of_record pipe-cli/src/commands/run/mod.rs +60 −16 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ pub fn run( _reporter: &Option<Vec<String>>, _output: &Option<PathBuf>, dry_run: bool, _offline: bool, offline: bool, _skip_verify_checksum: bool, _skip_verify_reqruirements: bool, verbose: Verbosity, Loading Loading @@ -57,7 +57,7 @@ pub fn run( // Prepare modules cfg.modules.par_iter().for_each(|module| match &module.module_type { | ModuleType::Binary { uri } => match ModuleUri::from(uri) { | ModuleUri::Url(value) => match value.scheme() { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { let url = value.to_string(); debug!(module = module.name, url, "=> {} Remote binary", Label::found()); Loading @@ -65,9 +65,9 @@ pub fn run( // TODO: Check that URL exists // TODO: Download binary to temp directory // TODO: Verify binary checksum unimplemented!() unimplemented!("Remote binary modules are not supported yet"); } | _ => unimplemented!(), | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for remote binary modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { Loading @@ -80,15 +80,41 @@ pub fn run( std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!(), | _ => unimplemented!("Only URLs and files are currently supported for binary modules"), }, | ModuleType::Script { programming_language, uri } => match programming_language { | ModuleLanguage::Python => match ModuleUri::from(uri) { | ModuleUri::Url(value) => match value.scheme() { | ModuleLanguage::Generic => match ModuleUri::from(uri) { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { debug!(uri, "=> {} Remote script repository", Label::found()); // TODO: Filter URL using whitelist // TODO: Check that URL exists // TODO: Git clone module // TODO: Check script repository with is_valid_pipe_module_python unimplemented!("Remote Generic script modules are not supported yet"); } | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for remote generic script modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { let path = value.into_os_string().into_string().unwrap(); debug!(module = module.name, path, "=> {} Local script repository", Label::found()); unimplemented!("Local Generic script modules are not supported yet"); } | _ => { let path = value.into_os_string().into_string().unwrap(); error!(module = module.name, path, "=> {} Local script module", Label::not_found()); std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!("Only URLs and files are currently supported for Generic script modules"), }, | ModuleLanguage::Python => match ModuleUri::from(uri) { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { debug!(uri, "=> {} Remote {} script repository", Label::found(), programming_language); // TODO: Filter URL using whitelist // TODO: Check that URL exists if ModuleUri::from(uri).test() { info!(module = module.name, uri, "=> {}", Label::found()); } else { Loading @@ -115,12 +141,18 @@ pub fn run( } }; } | _ => unimplemented!(), | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for Python script modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { let path = value.into_os_string().into_string().unwrap(); debug!(module = module.name, path, "=> {} Local script repository", Label::found()); debug!( module = module.name, path, "=> {} Local {} script repository", Label::found(), programming_language ); // TODO: Check script repository with is_valid_pipe_module_python if let Some(script) = Script::maybe_create_conda_environment(uri.to_string(), verbose.log_level()) { if dry_run { Loading @@ -133,20 +165,31 @@ pub fn run( } | _ => { let path = value.into_os_string().into_string().unwrap(); error!(module = module.name, path, "=> {} Local script module", Label::not_found()); error!( module = module.name, path, "=> {} Local {} script module", Label::not_found(), programming_language ); std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!(), | _ => unimplemented!("Only URLs and files are currently supported for Python script modules"), }, | _ => unimplemented!(), | _ => unimplemented!("Only Generic and Python script modules are currently supported"), }, | _ => unimplemented!(), | _ => unimplemented!("Only binary and script modules are currently supported"), }); // Run workflow cfg.modules.iter().for_each(|module| match &module.module_type { | ModuleType::Binary { .. } => {} | ModuleType::Binary { .. } => { unimplemented!("Binary modules are not supported yet"); } | ModuleType::Script { programming_language, uri } => match programming_language { | ModuleLanguage::Generic => { unimplemented!("Generic script modules are not supported yet"); } | ModuleLanguage::Python => { let working_dir = ModuleUri::from(uri).working_directory(Some(root.clone())); let manifest_path = PathBuf::from(&working_dir).join("environment.yml"); Loading @@ -157,6 +200,7 @@ pub fn run( Label::using() ); let default_template_path = PathBuf::from(&working_dir).join("template.json"); // TODO: Abstract loading script from template: fn(module, default_path) -> Script let loaded = match &module.template { | Some(attribute) => match attribute { | TemplateAttribute::Path(value) => match PathBuf::from(value).try_exists() { Loading Loading @@ -214,9 +258,9 @@ pub fn run( script.run(); } } | _ => unimplemented!(), | _ => unimplemented!("Only Generic and Python script modules are currently supported"), }, | _ => unimplemented!(), | _ => unimplemented!("Only binary and script modules are currently supported"), }); } | None => error!("=> {} Could not import configuration", Label::fail()), Loading pipe-lib/src/lib.rs +2 −1 Original line number Diff line number Diff line Loading @@ -70,11 +70,12 @@ pub enum Instruction { /// ``` ExecFormat(Vec<String>), } #[derive(Clone, Debug, Serialize, Deserialize, Valuable)] #[derive(Clone, Debug, Serialize, Deserialize, Display, Valuable)] #[serde(rename_all = "lowercase")] pub enum ModuleLanguage { Binary, Csharp, Generic, JavaScript, Julia, Python, Loading Loading
lcov.info +344 −327 Original line number Diff line number Diff line Loading @@ -151,85 +151,102 @@ DA:85,0 DA:86,0 DA:87,0 DA:89,0 DA:92,0 DA:93,0 DA:95,0 DA:94,0 DA:96,0 DA:98,0 DA:99,0 DA:100,0 DA:101,0 DA:102,0 DA:103,0 DA:105,0 DA:109,0 DA:106,0 DA:107,0 DA:110,0 DA:111,0 DA:112,0 DA:114,0 DA:113,0 DA:115,0 DA:118,0 DA:120,0 DA:119,0 DA:121,0 DA:122,0 DA:123,0 DA:124,0 DA:125,0 DA:126,0 DA:127,0 DA:128,0 DA:130,0 DA:129,0 DA:131,0 DA:135,0 DA:136,0 DA:137,0 DA:138,0 DA:140,0 DA:142,0 DA:144,0 DA:147,0 DA:146,0 DA:148,0 DA:149,0 DA:151,0 DA:152,0 DA:153,0 DA:155,0 DA:157,0 DA:158,0 DA:159,0 DA:160,0 DA:161,0 DA:162,0 DA:164,0 DA:165,0 DA:166,0 DA:169,0 DA:170,0 DA:173,0 DA:174,0 DA:167,0 DA:168,0 DA:172,0 DA:175,0 DA:178,0 DA:180,0 DA:181,0 DA:184,0 DA:182,0 DA:185,0 DA:187,0 DA:189,0 DA:190,0 DA:191,0 DA:192,0 DA:193,0 DA:194,0 DA:195,0 DA:196,0 DA:197,0 DA:198,0 DA:199,0 DA:200,0 DA:201,0 DA:202,0 DA:203,0 DA:204,0 DA:205,0 DA:206,0 DA:208,0 DA:211,0 DA:209,0 DA:210,0 DA:213,0 DA:214,0 DA:217,0 DA:218,0 DA:219,0 DA:222,0 DA:224,0 LF:118 DA:225,0 DA:228,0 DA:229,0 DA:233,0 DA:234,0 DA:235,0 DA:236,0 DA:237,0 DA:240,0 DA:241,0 DA:242,0 DA:243,0 DA:244,0 DA:245,0 DA:246,0 DA:247,0 DA:248,0 DA:249,0 DA:250,0 DA:252,0 DA:255,0 DA:258,0 DA:261,0 DA:263,0 DA:266,0 DA:268,0 LF:135 LH:0 end_of_record TN: Loading Loading @@ -352,67 +369,67 @@ LH:0 end_of_record TN: SF:/root/dev/command/pipe-lib/src/lib.rs FN:363,Command::test FN:390,Config::read FN:414,Config::read_json FN:435,Config::read_yaml FN:452,Config::set_environment_variables FN:466,<impl PartialEq for Details>::eq FN:473,EnvironmentValue::from_string FN:476,EnvironmentValue::from_value FN:484,EnvironmentValue::prepend_prefix FN:488,EnvironmentValue::trim_prefix FN:492,EnvironmentValue::get_from_serde FN:506,EnvironmentValue::get_all FN:516,EnvironmentValue::print_all FN:521,EnvironmentValue::set_variable FN:531,EnvironmentValue::set_variables FN:538,Extension::from_string FN:547,Label::dry_run FN:551,Label::fail FN:555,Label::found FN:559,Label::not_found FN:563,Label::output FN:567,Label::read FN:571,Label::rejected FN:575,Label::run FN:579,Label::using FN:585,ModuleUri<'_>::from FN:595,ModuleUri<'_>::hash FN:619,ModuleUri<'_>::get_whitelist FN:622,ModuleUri<'_>::is_allowed FN:625,ModuleUri<'_>::test FN:626,ModuleUri<'_>::test::check FN:643,ModuleUri<'_>::working_directory FN:655,SemanticVersion::from_string FN:678,Script::expand_arguments FN:713,Script::expand_arguments_from FN:745,Script::from_template FN:773,Script::from_path FN:785,Script::get_command FN:791,Script::get_arguments FN:802,Script::maybe_create_conda_environment FN:835,Script::maybe_git_clone FN:842,Script::python_default FN:856,Script::run FN:927,Script::with_current_dir FN:965,Script::with_environment FN:970,Script::with_envs FN:979,StringTemplate::new FN:988,StringTemplate::expand FN:995,StringTemplate::get_variable FN:1025,StringTemplate::is_handlebars FN:1060,StringTemplate::remove_spaces FN:1070,add_forward_slash FN:1078,get_conda_environment_list FN:1120,get_conda_environment_name FN:1152,get_extension FN:1156,get_parent FN:1169,has_extension FN:1173,is_stdin_piped FN:1181,is_stdout_piped FN:1199,read_file FN:1213,to_string FN:364,Command::test FN:391,Config::read FN:415,Config::read_json FN:436,Config::read_yaml FN:453,Config::set_environment_variables FN:467,<impl PartialEq for Details>::eq FN:474,EnvironmentValue::from_string FN:477,EnvironmentValue::from_value FN:485,EnvironmentValue::prepend_prefix FN:489,EnvironmentValue::trim_prefix FN:493,EnvironmentValue::get_from_serde FN:507,EnvironmentValue::get_all FN:517,EnvironmentValue::print_all FN:522,EnvironmentValue::set_variable FN:532,EnvironmentValue::set_variables FN:539,Extension::from_string FN:548,Label::dry_run FN:552,Label::fail FN:556,Label::found FN:560,Label::not_found FN:564,Label::output FN:568,Label::read FN:572,Label::rejected FN:576,Label::run FN:580,Label::using FN:586,ModuleUri<'_>::from FN:596,ModuleUri<'_>::hash FN:620,ModuleUri<'_>::get_whitelist FN:623,ModuleUri<'_>::is_allowed FN:626,ModuleUri<'_>::test FN:627,ModuleUri<'_>::test::check FN:644,ModuleUri<'_>::working_directory FN:656,SemanticVersion::from_string FN:679,Script::expand_arguments FN:714,Script::expand_arguments_from FN:746,Script::from_template FN:774,Script::from_path FN:786,Script::get_command FN:792,Script::get_arguments FN:803,Script::maybe_create_conda_environment FN:836,Script::maybe_git_clone FN:843,Script::python_default FN:857,Script::run FN:928,Script::with_current_dir FN:966,Script::with_environment FN:971,Script::with_envs FN:980,StringTemplate::new FN:989,StringTemplate::expand FN:996,StringTemplate::get_variable FN:1026,StringTemplate::is_handlebars FN:1061,StringTemplate::remove_spaces FN:1071,add_forward_slash FN:1079,get_conda_environment_list FN:1121,get_conda_environment_name FN:1153,get_extension FN:1157,get_parent FN:1170,has_extension FN:1174,is_stdin_piped FN:1182,is_stdout_piped FN:1200,read_file FN:1214,to_string FNF:61 FNDA:1,Command::test FNDA:1,Config::read Loading Loading @@ -460,7 +477,7 @@ FNDA:1,Script::run FNDA:1,Script::with_current_dir FNDA:2,Script::with_environment FNDA:0,Script::with_envs FNDA:1,StringTemplate::new FNDA:2,StringTemplate::new FNDA:1,StringTemplate::expand FNDA:1,StringTemplate::get_variable FNDA:1,StringTemplate::is_handlebars Loading @@ -475,74 +492,73 @@ FNDA:0,is_stdin_piped FNDA:0,is_stdout_piped FNDA:1,read_file FNDA:1,to_string DA:363,1 DA:364,1 DA:368,2 DA:371,1 DA:365,1 DA:369,2 DA:372,1 DA:374,2 DA:375,1 DA:376,2 DA:377,4 DA:379,6 DA:380,2 DA:383,3 DA:384,1 DA:390,1 DA:391,2 DA:373,1 DA:375,2 DA:376,1 DA:377,2 DA:378,4 DA:380,6 DA:381,2 DA:384,3 DA:385,1 DA:391,1 DA:392,2 DA:393,1 DA:395,0 DA:393,2 DA:394,1 DA:396,0 DA:399,2 DA:400,1 DA:402,0 DA:397,0 DA:400,2 DA:401,1 DA:403,0 DA:414,1 DA:415,2 DA:404,0 DA:415,1 DA:416,2 DA:418,0 DA:417,4 DA:419,0 DA:422,2 DA:423,1 DA:424,3 DA:425,0 DA:427,6 DA:428,2 DA:435,1 DA:436,2 DA:437,1 DA:439,0 DA:420,0 DA:423,4 DA:424,2 DA:425,4 DA:426,0 DA:428,6 DA:429,2 DA:436,1 DA:437,2 DA:438,1 DA:440,0 DA:443,2 DA:444,1 DA:445,2 DA:446,0 DA:448,3 DA:449,1 DA:452,0 DA:441,0 DA:444,2 DA:445,1 DA:446,2 DA:447,0 DA:449,3 DA:450,1 DA:453,0 DA:454,0 DA:455,0 DA:456,0 DA:457,0 DA:462,0 DA:466,1 DA:458,0 DA:463,0 DA:467,1 DA:473,0 DA:468,1 DA:474,0 DA:476,0 DA:475,0 DA:477,0 DA:478,0 DA:479,0 DA:480,0 DA:481,0 DA:484,0 DA:482,0 DA:485,0 DA:488,1 DA:486,0 DA:489,1 DA:490,2 DA:492,0 DA:490,1 DA:491,2 DA:493,0 DA:494,0 DA:495,0 Loading @@ -551,313 +567,314 @@ DA:497,0 DA:498,0 DA:499,0 DA:500,0 DA:502,0 DA:504,0 DA:506,1 DA:501,0 DA:503,0 DA:505,0 DA:507,1 DA:508,2 DA:508,1 DA:509,2 DA:510,2 DA:511,2 DA:512,1 DA:516,0 DA:512,2 DA:513,1 DA:517,0 DA:518,0 DA:521,0 DA:519,0 DA:522,0 DA:523,0 DA:524,0 DA:525,0 DA:526,0 DA:527,0 DA:531,0 DA:528,0 DA:532,0 DA:534,0 DA:538,1 DA:539,2 DA:533,0 DA:535,0 DA:539,1 DA:540,2 DA:541,3 DA:542,0 DA:547,0 DA:541,2 DA:542,3 DA:543,0 DA:548,0 DA:549,0 DA:551,0 DA:550,0 DA:552,0 DA:553,0 DA:555,0 DA:554,0 DA:556,0 DA:557,0 DA:559,0 DA:558,0 DA:560,0 DA:561,0 DA:563,1 DA:564,3 DA:562,0 DA:564,1 DA:565,3 DA:567,0 DA:566,3 DA:568,0 DA:569,0 DA:571,0 DA:570,0 DA:572,0 DA:573,0 DA:575,0 DA:574,0 DA:576,0 DA:577,0 DA:579,0 DA:578,0 DA:580,0 DA:581,0 DA:585,1 DA:582,0 DA:586,1 DA:587,2 DA:588,1 DA:589,2 DA:590,0 DA:592,1 DA:595,1 DA:587,1 DA:588,2 DA:589,1 DA:590,2 DA:591,0 DA:593,1 DA:596,1 DA:597,1 DA:598,1 DA:599,1 DA:600,0 DA:602,4 DA:606,4 DA:607,4 DA:609,4 DA:600,1 DA:601,0 DA:603,2 DA:607,2 DA:608,2 DA:610,2 DA:612,2 DA:615,0 DA:619,0 DA:611,2 DA:613,1 DA:616,0 DA:620,0 DA:622,0 DA:621,0 DA:623,0 DA:625,0 DA:624,0 DA:626,0 DA:627,0 DA:629,0 DA:628,0 DA:630,0 DA:631,0 DA:632,0 DA:633,0 DA:634,0 DA:635,0 DA:637,0 DA:639,0 DA:643,0 DA:636,0 DA:638,0 DA:640,0 DA:644,0 DA:645,0 DA:646,0 DA:647,0 DA:649,0 DA:648,0 DA:650,0 DA:655,1 DA:651,0 DA:656,1 DA:657,3 DA:657,1 DA:658,3 DA:659,3 DA:678,1 DA:679,2 DA:682,2 DA:683,1 DA:684,2 DA:685,1 DA:660,3 DA:679,1 DA:680,2 DA:683,2 DA:684,1 DA:685,2 DA:686,1 DA:688,2 DA:692,1 DA:687,1 DA:689,2 DA:693,1 DA:713,1 DA:714,2 DA:717,2 DA:718,1 DA:719,2 DA:694,1 DA:714,1 DA:715,2 DA:718,2 DA:719,1 DA:720,2 DA:723,2 DA:725,1 DA:727,2 DA:731,1 DA:721,2 DA:724,2 DA:726,1 DA:728,2 DA:732,1 DA:745,1 DA:733,1 DA:746,1 DA:747,3 DA:751,2 DA:753,2 DA:755,2 DA:758,1 DA:759,2 DA:760,3 DA:773,1 DA:774,2 DA:775,1 DA:777,0 DA:747,1 DA:748,3 DA:752,2 DA:754,2 DA:756,2 DA:759,1 DA:760,2 DA:761,3 DA:774,1 DA:775,2 DA:776,1 DA:778,0 DA:781,2 DA:782,1 DA:779,0 DA:782,2 DA:783,1 DA:785,1 DA:784,1 DA:786,1 DA:787,1 DA:788,1 DA:791,1 DA:789,1 DA:792,1 DA:793,1 DA:794,1 DA:794,2 DA:795,2 DA:796,2 DA:798,1 DA:802,0 DA:796,4 DA:797,2 DA:799,1 DA:803,0 DA:804,0 DA:805,0 DA:807,0 DA:806,0 DA:808,0 DA:809,0 DA:810,0 DA:811,0 DA:812,0 DA:814,0 DA:813,0 DA:815,0 DA:816,0 DA:817,0 DA:818,0 DA:819,0 DA:820,0 DA:822,0 DA:821,0 DA:823,0 DA:826,0 DA:830,0 DA:824,0 DA:827,0 DA:831,0 DA:835,1 DA:836,2 DA:832,0 DA:836,1 DA:837,2 DA:838,2 DA:839,3 DA:840,1 DA:842,0 DA:839,2 DA:840,3 DA:841,1 DA:843,0 DA:844,0 DA:852,0 DA:856,1 DA:845,0 DA:853,0 DA:857,1 DA:858,1 DA:859,2 DA:859,1 DA:860,2 DA:861,3 DA:862,1 DA:863,8 DA:864,2 DA:865,1 DA:861,2 DA:862,3 DA:863,1 DA:864,9 DA:865,2 DA:866,1 DA:867,1 DA:868,1 DA:873,4 DA:869,1 DA:874,2 DA:876,0 DA:875,2 DA:877,0 DA:880,2 DA:881,2 DA:882,4 DA:883,5 DA:884,3 DA:887,3 DA:888,1 DA:890,0 DA:878,0 DA:881,1 DA:882,2 DA:883,3 DA:884,4 DA:885,3 DA:888,3 DA:889,2 DA:891,0 DA:894,2 DA:892,0 DA:895,1 DA:896,3 DA:897,0 DA:896,2 DA:897,3 DA:898,0 DA:901,3 DA:902,2 DA:903,4 DA:904,1 DA:905,5 DA:899,0 DA:902,3 DA:903,1 DA:904,5 DA:905,2 DA:906,4 DA:907,2 DA:909,3 DA:907,5 DA:908,1 DA:910,3 DA:911,2 DA:914,0 DA:911,3 DA:912,2 DA:915,0 DA:916,0 DA:920,0 DA:917,0 DA:921,0 DA:927,1 DA:928,3 DA:922,0 DA:928,1 DA:929,2 DA:965,2 DA:930,1 DA:966,2 DA:967,2 DA:970,0 DA:968,2 DA:971,0 DA:972,0 DA:979,1 DA:981,1 DA:988,1 DA:989,4 DA:990,3 DA:995,1 DA:996,2 DA:973,0 DA:980,2 DA:982,1 DA:989,1 DA:990,4 DA:991,3 DA:996,1 DA:997,2 DA:998,1 DA:999,2 DA:1001,0 DA:1025,1 DA:1026,2 DA:998,2 DA:999,1 DA:1000,2 DA:1002,0 DA:1026,1 DA:1027,2 DA:1028,1 DA:1029,0 DA:1031,0 DA:1060,1 DA:1061,2 DA:1062,1 DA:1063,0 DA:1065,3 DA:1066,1 DA:1070,1 DA:1071,2 DA:1072,0 DA:1074,2 DA:1078,1 DA:1079,2 DA:1028,2 DA:1029,1 DA:1030,0 DA:1032,0 DA:1061,1 DA:1062,2 DA:1063,1 DA:1064,0 DA:1066,3 DA:1067,1 DA:1071,1 DA:1072,2 DA:1073,0 DA:1075,2 DA:1079,1 DA:1080,2 DA:1081,2 DA:1082,2 DA:1083,5 DA:1086,1 DA:1088,2 DA:1090,4 DA:1093,0 DA:1120,1 DA:1083,2 DA:1084,5 DA:1087,1 DA:1089,2 DA:1091,4 DA:1094,0 DA:1121,1 DA:1122,1 DA:1123,6 DA:1135,1 DA:1137,0 DA:1152,1 DA:1123,1 DA:1124,6 DA:1136,1 DA:1138,0 DA:1153,1 DA:1156,1 DA:1157,3 DA:1169,1 DA:1154,1 DA:1157,1 DA:1158,3 DA:1170,1 DA:1173,0 DA:1171,1 DA:1174,0 DA:1175,0 DA:1177,0 DA:1181,0 DA:1176,0 DA:1178,0 DA:1182,0 DA:1183,0 DA:1185,0 DA:1199,1 DA:1184,0 DA:1186,0 DA:1200,1 DA:1201,5 DA:1202,3 DA:1203,9 DA:1204,6 DA:1206,1 DA:1207,3 DA:1208,1 DA:1211,3 DA:1213,1 DA:1214,4 DA:1201,1 DA:1202,6 DA:1203,3 DA:1204,9 DA:1205,7 DA:1207,1 DA:1208,3 DA:1209,1 DA:1212,4 DA:1214,1 DA:1215,4 LF:383 LH:224 end_of_record
pipe-cli/src/commands/run/mod.rs +60 −16 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ pub fn run( _reporter: &Option<Vec<String>>, _output: &Option<PathBuf>, dry_run: bool, _offline: bool, offline: bool, _skip_verify_checksum: bool, _skip_verify_reqruirements: bool, verbose: Verbosity, Loading Loading @@ -57,7 +57,7 @@ pub fn run( // Prepare modules cfg.modules.par_iter().for_each(|module| match &module.module_type { | ModuleType::Binary { uri } => match ModuleUri::from(uri) { | ModuleUri::Url(value) => match value.scheme() { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { let url = value.to_string(); debug!(module = module.name, url, "=> {} Remote binary", Label::found()); Loading @@ -65,9 +65,9 @@ pub fn run( // TODO: Check that URL exists // TODO: Download binary to temp directory // TODO: Verify binary checksum unimplemented!() unimplemented!("Remote binary modules are not supported yet"); } | _ => unimplemented!(), | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for remote binary modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { Loading @@ -80,15 +80,41 @@ pub fn run( std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!(), | _ => unimplemented!("Only URLs and files are currently supported for binary modules"), }, | ModuleType::Script { programming_language, uri } => match programming_language { | ModuleLanguage::Python => match ModuleUri::from(uri) { | ModuleUri::Url(value) => match value.scheme() { | ModuleLanguage::Generic => match ModuleUri::from(uri) { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { debug!(uri, "=> {} Remote script repository", Label::found()); // TODO: Filter URL using whitelist // TODO: Check that URL exists // TODO: Git clone module // TODO: Check script repository with is_valid_pipe_module_python unimplemented!("Remote Generic script modules are not supported yet"); } | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for remote generic script modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { let path = value.into_os_string().into_string().unwrap(); debug!(module = module.name, path, "=> {} Local script repository", Label::found()); unimplemented!("Local Generic script modules are not supported yet"); } | _ => { let path = value.into_os_string().into_string().unwrap(); error!(module = module.name, path, "=> {} Local script module", Label::not_found()); std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!("Only URLs and files are currently supported for Generic script modules"), }, | ModuleLanguage::Python => match ModuleUri::from(uri) { | ModuleUri::Url(value) if !offline => match value.scheme() { | Scheme::HTTP | Scheme::HTTPS | Scheme::SSH => { debug!(uri, "=> {} Remote {} script repository", Label::found(), programming_language); // TODO: Filter URL using whitelist // TODO: Check that URL exists if ModuleUri::from(uri).test() { info!(module = module.name, uri, "=> {}", Label::found()); } else { Loading @@ -115,12 +141,18 @@ pub fn run( } }; } | _ => unimplemented!(), | _ => unimplemented!("Only HTTP, HTTPS, and SSH are currently supported for Python script modules"), }, | ModuleUri::File(value) => match value.try_exists() { | Ok(true) => { let path = value.into_os_string().into_string().unwrap(); debug!(module = module.name, path, "=> {} Local script repository", Label::found()); debug!( module = module.name, path, "=> {} Local {} script repository", Label::found(), programming_language ); // TODO: Check script repository with is_valid_pipe_module_python if let Some(script) = Script::maybe_create_conda_environment(uri.to_string(), verbose.log_level()) { if dry_run { Loading @@ -133,20 +165,31 @@ pub fn run( } | _ => { let path = value.into_os_string().into_string().unwrap(); error!(module = module.name, path, "=> {} Local script module", Label::not_found()); error!( module = module.name, path, "=> {} Local {} script module", Label::not_found(), programming_language ); std::process::exit(exitcode::UNAVAILABLE); } }, | _ => unimplemented!(), | _ => unimplemented!("Only URLs and files are currently supported for Python script modules"), }, | _ => unimplemented!(), | _ => unimplemented!("Only Generic and Python script modules are currently supported"), }, | _ => unimplemented!(), | _ => unimplemented!("Only binary and script modules are currently supported"), }); // Run workflow cfg.modules.iter().for_each(|module| match &module.module_type { | ModuleType::Binary { .. } => {} | ModuleType::Binary { .. } => { unimplemented!("Binary modules are not supported yet"); } | ModuleType::Script { programming_language, uri } => match programming_language { | ModuleLanguage::Generic => { unimplemented!("Generic script modules are not supported yet"); } | ModuleLanguage::Python => { let working_dir = ModuleUri::from(uri).working_directory(Some(root.clone())); let manifest_path = PathBuf::from(&working_dir).join("environment.yml"); Loading @@ -157,6 +200,7 @@ pub fn run( Label::using() ); let default_template_path = PathBuf::from(&working_dir).join("template.json"); // TODO: Abstract loading script from template: fn(module, default_path) -> Script let loaded = match &module.template { | Some(attribute) => match attribute { | TemplateAttribute::Path(value) => match PathBuf::from(value).try_exists() { Loading Loading @@ -214,9 +258,9 @@ pub fn run( script.run(); } } | _ => unimplemented!(), | _ => unimplemented!("Only Generic and Python script modules are currently supported"), }, | _ => unimplemented!(), | _ => unimplemented!("Only binary and script modules are currently supported"), }); } | None => error!("=> {} Could not import configuration", Label::fail()), Loading
pipe-lib/src/lib.rs +2 −1 Original line number Diff line number Diff line Loading @@ -70,11 +70,12 @@ pub enum Instruction { /// ``` ExecFormat(Vec<String>), } #[derive(Clone, Debug, Serialize, Deserialize, Valuable)] #[derive(Clone, Debug, Serialize, Deserialize, Display, Valuable)] #[serde(rename_all = "lowercase")] pub enum ModuleLanguage { Binary, Csharp, Generic, JavaScript, Julia, Python, Loading