-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a few problems with prod environment (#37)
* few detected issues * Removed env_logger which made logs not upload to heat * fix endpoint for remote training * Updated Burn and removed git patch for Burn * Can now run for dev or prod. Regenerated Cargo.lock to fix some vulnerabilities Co-authored-by: Jonathan Richard <[email protected]> --------- Co-authored-by: Jonathan Richard <[email protected]> Co-authored-by: Jonathan Richard <[email protected]>
- Loading branch information
1 parent
876d253
commit eafdbfe
Showing
17 changed files
with
525 additions
and
305 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use syn::{punctuated::Punctuated, Expr, Meta}; | ||
|
||
pub trait LitMatcher<T> { | ||
fn match_type(&self) -> T; | ||
} | ||
|
||
impl LitMatcher<String> for syn::Lit { | ||
fn match_type(&self) -> String { | ||
match self { | ||
syn::Lit::Str(lit) => lit.value(), | ||
_ => panic!("Expected a string literal"), | ||
} | ||
} | ||
} | ||
|
||
impl LitMatcher<bool> for syn::Lit { | ||
fn match_type(&self) -> bool { | ||
match self { | ||
syn::Lit::Bool(lit) => lit.value, | ||
_ => panic!("Expected a boolean literal"), | ||
} | ||
} | ||
} | ||
|
||
pub fn get_name_value<T>(args: &Punctuated<Meta, syn::token::Comma>, name: &str) -> Option<T> | ||
where | ||
syn::Lit: LitMatcher<T>, | ||
{ | ||
args.iter() | ||
.find(|meta| meta.path().is_ident(name)) | ||
.and_then(|meta| { | ||
if let Meta::NameValue(meta) = meta { | ||
if let Expr::Lit(lit) = &meta.value { | ||
Some(lit.lit.match_type()) | ||
} else { | ||
None | ||
} | ||
} else { | ||
None | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#[derive(Debug, Clone)] | ||
pub struct Config { | ||
pub api_endpoint: String, | ||
pub wss: bool, | ||
} | ||
|
||
impl Default for Config { | ||
fn default() -> Self { | ||
Config { | ||
api_endpoint: String::from("https://heat.tracel.ai/api/"), | ||
wss: true, | ||
} | ||
} | ||
} |
Oops, something went wrong.