Skip to content

Commit

Permalink
Fix benchmark enum tag syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
vkleen committed Apr 24, 2023
1 parent 5ba305d commit 6901750
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 76 deletions.
6 changes: 3 additions & 3 deletions benches/arrays/sort.ncl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let ascending = fun x y =>
if x < y then `Lesser
else if x == y then `Equal
else `Greater
if x < y then 'Lesser
else if x == y then 'Equal
else 'Greater
in

{ run = std.array.sort ascending }
2 changes: 1 addition & 1 deletion benches/mantis/deploy-example.ncl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "deploy.ncl" { namespace = "mantis-staging", job = "miner", role = `miner }
import "deploy.ncl" { namespace = "mantis-staging", job = "miner", role = 'miner }
4 changes: 2 additions & 2 deletions benches/mantis/deploy.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fun vars =>
logLevel | default = "INFO",
loggers = defaultLoggers,
job = vars.job,
role | [| `passive, `miner, `backup |] = vars.role,
role | [| 'passive, 'miner, 'backup |] = vars.role,
reschedule = {},
}
in
Expand All @@ -79,7 +79,7 @@ fun vars =>
let miner_ =
jobDefs.Mantis
& {
role = `miner,
role = 'miner,
mantisRev = revisions.mantisRev
}
in
Expand Down
46 changes: 23 additions & 23 deletions benches/mantis/jobs/mantis.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let Params = {
| std.number.Nat
| default
= 5,
role | [| `passive, `miner, `backup |],
role | [| 'passive, 'miner, 'backup |],
datacenters | Dyn,
job | Dyn,
namespace | String,
Expand Down Expand Up @@ -54,11 +54,11 @@ fun params =>
& (
if params.network == "etc" then
{
type = `batch,
type = 'batch,
periodic = {
prohibit_overlap = true,
cron = "@daily",
time_zone = `UTC,
time_zone = 'UTC,
}
}
else
Expand All @@ -67,11 +67,11 @@ fun params =>
& (
if params.network != "etc" then
{
type = `service,
type = 'service,

update = {
max_parallel = 1,
health_check = `checks,
health_check = 'checks,
min_healthy_time = "1m",
# Give enough time for the DAG generation
healthy_deadline = "15m",
Expand All @@ -90,7 +90,7 @@ fun params =>
{
count = params.count,
network = {
mode = `host,
mode = 'host,
port = {
discovery = {},
metrics = {},
Expand Down Expand Up @@ -147,11 +147,11 @@ fun params =>
# #baseTags: [namespace, #role, "mantis-${NOMAD_ALLOC_INDEX}"]
}
& (
if params.role == `passive then
if params.role == 'passive then
{
#TODO: dependent if
service."%{params.namespace}-mantis-%{std.string.from_enum params.role}-rpc" = {
address_mode = `host,
address_mode = 'host,
port = "rpc",
tags =
[
Expand All @@ -175,11 +175,11 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
service."%{params.namespace}-mantis-%{std.string.from_enum params.role}-rpc" = {
check.rpc =
{
address_mode = `host,
address_mode = 'host,
interval = "10s",
port = "rpc",
timeout = "3s",
type = `http,
type = 'http,
path = "/healthcheck",
}
& (
Expand All @@ -196,11 +196,11 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
}
}
& (
if params.role == `miner then
if params.role == 'miner then
{
# TODO: dependent if
service."%{params.namespace}-mantis-%{std.string.from_enum params.role}-rpc" = {
address_mode = `host,
address_mode = 'host,
port = "rpc",
tags = ["rpc"] @ baseTags,
}
Expand All @@ -211,13 +211,13 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
& {
service = {
"%{params.namespace}-mantis-%{std.string.from_enum params.role}-prometheus" = {
address_mode = `host,
address_mode = 'host,
port = "metrics",
tags = ["prometheus"] @ baseTags,
},

"%{params.namespace}-%{std.string.from_enum params.role}-${NOMAD_ALLOC_INDEX}" = {
address_mode = `host,
address_mode = 'host,
port = "rpc",
tags =
[
Expand All @@ -236,7 +236,7 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
port = "discovery",
}
& (
if params.role == `miner then
if params.role == 'miner then
{
tags =
[
Expand All @@ -253,7 +253,7 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
{}
)
& (
if params.role == `passive then
if params.role == 'passive then
{
tags = ["discovery"] @ baseTags
}
Expand All @@ -269,11 +269,11 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.

"%{params.namespace}-mantis-%{std.string.from_enum params.role}-server-${NOMAD_ALLOC_INDEX}" =
{
address_mode = `host,
address_mode = 'host,
port = "server",
}
& (
if params.role == `miner then
if params.role == 'miner then
{
tags =
[
Expand All @@ -289,7 +289,7 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
{}
)
& (
if params.role == `passive then
if params.role == 'passive then
{
tags = ["server"] @ baseTags,
}
Expand All @@ -304,11 +304,11 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.

check.server =
{
address_mode = `host,
address_mode = 'host,
interval = "10s",
port = "server",
timeout = "3s",
type = `tcp,
type = 'tcp,
}
& (
if params.network != "etc" then
Expand All @@ -324,7 +324,7 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
},

"%{params.namespace}-mantis-%{std.string.from_enum params.role}-server" = {
address_mode = `host,
address_mode = 'host,
port = "server",
tags = [ "ingress", "server" ] @ baseTags,
meta = {
Expand All @@ -334,7 +334,7 @@ params.role}.rule=Host(`%{params.namespace}-%{std.string.from_enum params.role}.
},

"%{params.namespace}-mantis-%{std.string.from_enum params.role}" = {
address_mode = `host,
address_mode = 'host,
port = "server",
tags = ["server"] @ baseTags,
meta = {
Expand Down
2 changes: 1 addition & 1 deletion benches/mantis/run.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
run = import "deploy.ncl",
serialize.run = fun args =>
(
std.serialize `Json (run args)
std.serialize 'Json (run args)
)
}
Loading

0 comments on commit 6901750

Please sign in to comment.