-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/clap #179
base: main
Are you sure you want to change the base?
Feature/clap #179
Conversation
c7e5522
to
0456ac3
Compare
0456ac3
to
7529986
Compare
@@ -17,7 +17,7 @@ AWS_DEFAULT_REGION="localhost" | |||
##### STORAGE ##### | |||
|
|||
DATA_STORAGE= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these ones can also be prefixed with MADARA_ORCHESTRATOR
right? I think AWS are the only ones where we can skip because those have a meaning outside orchestrator as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using cli based booleans to detect among the various XYZProviders to choose from,
i.e --aws_s3
for Storage, so in the current impl there's no way for us to provide these selections from env,
this is done in favour of CLI, do you think it's worth implementing from env as well ? @apoorvsadana
#[derive(Debug, Clone, Args)]
#[group()]
pub struct AWSS3CliArgs {
/// Use the AWS s3 client
#[arg(long)]
pub aws_s3: bool,
/// The name of the S3 bucket.
#[arg(env = "MADARA_ORCHESTRATOR_AWS_S3_BUCKET_NAME", long, default_value = Some("madara-orchestrator-bucket"))]
pub bucket_name: Option<String>,
}
let run_cmd: RunCmd = RunCmd::parse(); | ||
|
||
if run_cmd.setup { | ||
setup_cloud(&run_cmd).await.expect("Failed to setup cloud"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can build config and do that directly
} | ||
|
||
pub fn get_queue_name(&self, queue_type: QueueType) -> String { | ||
format!("{}_{}_{}", self.sqs_prefix, queue_type, self.sqs_suffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can make this a queue value and not sqs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially it was a part of AWSSQSValidatedArgs
which was wrong, I have shifted it to be a part of SqsQueue
for now, when we add another queue provider we can exercise this generalisation
@@ -435,3 +455,121 @@ pub mod implement_client { | |||
(rpc_url, starknet_client, server) | |||
} | |||
} | |||
|
|||
struct EnvParams { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it read from .env.test directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, orchestrator binary has no way to know which .env to read from so it always reads from .env
here we read from .env.test
and add it to .env
for orchestrator to use
impl Orchestrator { | ||
pub fn setup(envs: Vec<(String, String)>) { | ||
let port = get_free_port(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need a port
let env_vec_2: Vec<(String, String)> = set_env_vars(); | ||
env_vec.extend(env_vec_2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this if we remove env setup like above
// "MADARA_ORCHESTRATOR_MADARA_BINARY_PATH".to_string(), | ||
// get_env_var_or_panic("MADARA_ORCHESTRATOR_MADARA_BINARY_PATH"), | ||
// ), | ||
// Storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be remove
No description provided.