Skip to content

Commit

Permalink
fix queue url for snos job queue
Browse files Browse the repository at this point in the history
  • Loading branch information
byteZorvin committed Oct 14, 2024
1 parent 4b0ef74 commit 61391c6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 78 deletions.
20 changes: 17 additions & 3 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ AWS_S3_BUCKET_NAME="madara-orchestrator-test-bucket"
##### QUEUE #####

QUEUE_PROVIDER="sqs"
SQS_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_job_processing_queue"
SQS_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_job_verification_queue"

SQS_SNOS_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_snos_job_processing_queue"
SQS_SNOS_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_snos_job_verification_queue"

SQS_PROVING_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_proving_job_processing_queue"
SQS_PROVING_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_proving_job_verification_queue"

SQS_PROOF_REGISTRATION_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_proof_registration_job_processing_queue"
SQS_PROOF_REGISTRATION_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_proof_registration_job_verification_queue"

SQS_DATA_SUBMISSION_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_data_submission_job_processing_queue"
SQS_DATA_SUBMISSION_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_data_submission_job_verification_queue"

SQS_UPDATE_STATE_JOB_PROCESSING_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_update_state_job_verification_queue"
SQS_UPDATE_STATE_JOB_VERIFICATION_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_update_state_job_verification_queue"

SQS_JOB_HANDLE_FAILURE_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_job_handle_failure_queue"
SQS_WORKER_TRIGGER_QUEUE_URL="http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/madara_orchestrator_worker_trigger_queue"

Expand Down Expand Up @@ -77,4 +91,4 @@ STARKNET_OPERATOR_ADDRESS="0x5b98B836969A60FEC50Fa925905Dd1D382a7db43"
AWS_SNS_ARN_NAME="madara-orchestrator-arn"
MADARA_BINARY_PATH="/path/to/madara"
# pick up by AWS sdk
AWS_ENDPOINT_URL="http://localhost.localstack.cloud:4566"
AWS_ENDPOINT_URL="http://localhost.localstack.cloud:4566"
12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ services:
- DATA_STORAGE=${DATA_STORAGE:-s3}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
- QUEUE_PROVIDER=${QUEUE_PROVIDER:-sqs}
- SQS_JOB_PROCESSING_QUEUE_URL=${SQS_JOB_PROCESSING_QUEUE_URL}
- SQS_JOB_VERIFICATION_QUEUE_URL=${SQS_JOB_VERIFICATION_QUEUE_URL}
- SQS_SNOS_JOB_PROCESSING_QUEUE_URL=${SQS_SNOS_JOB_PROCESSING_QUEUE_URL}
- SQS_SNOS_JOB_VERIFICATION_QUEUE_URL=${SQS_SNOS_JOB_VERIFICATION_QUEUE_URL}
- SQS_DATA_SUBMISSION_JOB_PROCESSING_QUEUE_URL=${SQS_DATA_SUBMISSION_JOB_PROCESSING_QUEUE_URL}
- SQS_DATA_SUBMISSION_JOB_VERIFICATION_QUEUE_URL=${SQS_DATA_SUBMISSION_JOB_VERIFICATION_QUEUE_URL}
- SQS_PROOF_REGISTRATION_JOB_PROCESSING_QUEUE_URL=${SQS_PROOF_REGISTRATION_JOB_PROCESSING_QUEUE_URL}
- SQS_PROOF_REGISTRATION_JOB_VERIFICATION_QUEUE_URL=${SQS_PROOF_REGISTRATION_JOB_VERIFICATION_QUEUE_URL}
- SQS_PROVING_JOB_PROCESSING_QUEUE_URL=${SQS_PROVING_JOB_PROCESSING_QUEUE_URL}
- SQS_PROVING_JOB_VERIFICATION_QUEUE_URL=${SQS_PROVING_JOB_VERIFICATION_QUEUE_URL}
- SQS_UPDATE_STATE_JOB_PROCESSING_QUEUE_URL=${SQS_UPDATE_STATE_JOB_PROCESSING_QUEUE_URL}
- SQS_UPDATE_STATE_JOB_VERIFICATION_QUEUE_URL=${SQS_UPDATE_STATE_JOB_VERIFICATION_QUEUE_URL}
- SQS_JOB_HANDLE_FAILURE_QUEUE_URL=${SQS_JOB_HANDLE_FAILURE_QUEUE_URL}
- SQS_WORKER_TRIGGER_QUEUE_URL=${SQS_WORKER_TRIGGER_QUEUE_URL}
- ALERTS=${ALERTS:-sns}
Expand Down
97 changes: 25 additions & 72 deletions e2e-tests/src/localstack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,78 +59,31 @@ impl LocalStack {
// Creating SQS queues
let mut queue_attributes = HashMap::new();
queue_attributes.insert(VisibilityTimeout, "1".into());
self.sqs_client
.create_queue()
.queue_name(DATA_SUBMISSION_JOB_PROCESSING_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(DATA_SUBMISSION_JOB_VERIFICATION_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(PROOF_REGISTRATION_JOB_PROCESSING_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(PROOF_REGISTRATION_JOB_VERIFICATION_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(PROVING_JOB_PROCESSING_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(PROVING_JOB_VERIFICATION_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(SNOS_JOB_PROCESSING_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(SNOS_JOB_VERIFICATION_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(UPDATE_STATE_JOB_PROCESSING_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(UPDATE_STATE_JOB_VERIFICATION_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(JOB_HANDLE_FAILURE_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
self.sqs_client
.create_queue()
.queue_name(WORKER_TRIGGER_QUEUE)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;

let queue_names = vec![
DATA_SUBMISSION_JOB_PROCESSING_QUEUE,
DATA_SUBMISSION_JOB_VERIFICATION_QUEUE,
PROOF_REGISTRATION_JOB_PROCESSING_QUEUE,
PROOF_REGISTRATION_JOB_VERIFICATION_QUEUE,
PROVING_JOB_PROCESSING_QUEUE,
PROVING_JOB_VERIFICATION_QUEUE,
SNOS_JOB_PROCESSING_QUEUE,
SNOS_JOB_VERIFICATION_QUEUE,
UPDATE_STATE_JOB_PROCESSING_QUEUE,
UPDATE_STATE_JOB_VERIFICATION_QUEUE,
JOB_HANDLE_FAILURE_QUEUE,
WORKER_TRIGGER_QUEUE,
];

for queue_name in queue_names {
self.sqs_client
.create_queue()
.queue_name(queue_name)
.set_attributes(Some(queue_attributes.clone()))
.send()
.await?;
}

println!("🌊 SQS queues creation completed.");

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pub async fn put_job_data_in_db_snos(mongo_db: &MongoDbServer, l2_block_number:
/// as soon as it is picked up by orchestrator
pub async fn put_snos_job_in_processing_queue(local_stack: &LocalStack, id: Uuid) -> color_eyre::Result<()> {
let message = JobQueueMessage { id };
local_stack.put_message_in_queue(message, get_env_var_or_panic("SQS_JOB_PROCESSING_QUEUE_URL")).await?;
local_stack.put_message_in_queue(message, get_env_var_or_panic("SQS_SNOS_JOB_PROCESSING_QUEUE_URL")).await?;
Ok(())
}

Expand Down

0 comments on commit 61391c6

Please sign in to comment.