Skip to content
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

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open

Feature/clap #179

wants to merge 54 commits into from

Conversation

heemankv
Copy link
Contributor

@heemankv heemankv commented Nov 6, 2024

No description provided.

@heemankv heemankv self-assigned this Nov 6, 2024
@coveralls
Copy link

coveralls commented Nov 8, 2024

Coverage Status

coverage: 65.901% (-0.3%) from 66.159%
when pulling 55c4454 on feature/clap
into a9d0e30 on main.

.env.test Outdated Show resolved Hide resolved
.env.test Outdated Show resolved Hide resolved
crates/da-clients/ethereum/src/config.rs Outdated Show resolved Hide resolved
crates/da-clients/ethereum/src/lib.rs Outdated Show resolved Hide resolved
crates/orchestrator/Cargo.toml Outdated Show resolved Hide resolved
@@ -17,7 +17,7 @@ AWS_DEFAULT_REGION="localhost"
##### STORAGE #####

DATA_STORAGE=
Copy link
Contributor

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

Copy link
Contributor Author

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>,
}

crates/da-clients/ethereum/src/lib.rs Outdated Show resolved Hide resolved
crates/da-clients/ethereum/src/lib.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/alerts/aws_sns/mod.rs Show resolved Hide resolved
crates/orchestrator/src/alerts/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/cron/mod.rs Outdated Show resolved Hide resolved
let run_cmd: RunCmd = RunCmd::parse();

if run_cmd.setup {
setup_cloud(&run_cmd).await.expect("Failed to setup cloud");
Copy link
Contributor

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

crates/orchestrator/src/queue/mod.rs Show resolved Hide resolved
}

pub fn get_queue_name(&self, queue_type: QueueType) -> String {
format!("{}_{}_{}", self.sqs_prefix, queue_type, self.sqs_suffix)
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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

crates/orchestrator/src/workers/snos.rs Show resolved Hide resolved
crates/orchestrator/src/workers/snos.rs Show resolved Hide resolved
crates/settlement-clients/starknet/src/lib.rs Show resolved Hide resolved
crates/utils/Cargo.toml Show resolved Hide resolved
e2e-tests/Cargo.toml Show resolved Hide resolved
impl Orchestrator {
pub fn setup(envs: Vec<(String, String)>) {
let port = get_free_port();
Copy link
Contributor

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

e2e-tests/src/node.rs Show resolved Hide resolved
Comment on lines +99 to +100
let env_vec_2: Vec<(String, String)> = set_env_vars();
env_vec.extend(env_vec_2);
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be remove

@heemankv heemankv mentioned this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants