Skip to content

Commit

Permalink
fix(ci): aztec node devnet healthchecks (#3598)
Browse files Browse the repository at this point in the history
Please provide a paragraph or two giving a summary of the change,
including relevant motivation and context.

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
spypsy authored Dec 6, 2023
1 parent 008df50 commit 1a9d742
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions yarn-project/aztec-node/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ locals {
]
combined_bootnodes = join(",", local.bootnodes)
data_dir = "/usr/src/yarn-project/aztec-sandbox/data"
api_prefix = "/${var.DEPLOY_TAG}/aztec-node-${count.index + 1}"
}

resource "aws_cloudwatch_log_group" "aztec-node-log-group" {
@@ -244,7 +245,7 @@ resource "aws_ecs_task_definition" "aztec-node" {
},
{
"name": "API_PREFIX",
"value": "/${var.DEPLOY_TAG}/aztec-node-${count.index + 1}"
"value": ${local.api_prefix}
},
{
"name": "P2P_TCP_LISTEN_PORT",
@@ -358,7 +359,7 @@ resource "aws_alb_target_group" "aztec-node" {
deregistration_delay = 5

health_check {
path = "/${var.DEPLOY_TAG}/aztec-node-${count.index + 1}/status"
path = "${local.api_prefix}/status"
matcher = "200"
interval = 10
healthy_threshold = 2
@@ -383,7 +384,7 @@ resource "aws_lb_listener_rule" "api" {

condition {
path_pattern {
values = ["/${var.DEPLOY_TAG}/aztec-node-${count.index}*"]
values = ["${local.api_prefix}*"]
}
}
}
5 changes: 3 additions & 2 deletions yarn-project/aztec-sandbox/src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ const {
MODE = 'sandbox',
TEST_ACCOUNTS = 'true',
DEPLOY_AZTEC_CONTRACTS = 'true',
API_PREFIX = '',
} = process.env;

const logger = createDebugLogger(`aztec:${MODE}`);
@@ -150,15 +151,15 @@ async function main() {
const app = nodeRpcServer.getApp();

// Add a /status endpoint
const statusRouter = createStatusRouter();
const statusRouter = createStatusRouter(API_PREFIX);
app.use(statusRouter.routes());
app.use(statusRouter.allowedMethods());

// Start Node JSON-RPC server
const httpServer = http.createServer(app.callback());
httpServer.listen(port);

logStrings.push(`Aztec Node v${version} (noir ${NoirCommit}) is now ready for use in port ${AZTEC_NODE_PORT}!`);
logStrings.push(`Aztec Node v${version} (noir ${NoirCommit}) is now ready for use in port ${port}!`);
} else if (mode === SandboxMode.PXE) {
// Code path for starting PXE only

0 comments on commit 1a9d742

Please sign in to comment.