From 927c3229ad2a439cb7dd6c68043fdb0ced86c8bf Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Mon, 30 Nov 2020 17:05:35 +0100 Subject: [PATCH] add job for faucet web --- clusters/mantis/testnet/default.nix | 2 +- flake.lock | 89 +++++++++++++++++++++++++++-- flake.nix | 7 +-- jobs/mantis-qa-fastsync.nix | 1 - jobs/mantis-qa-load.nix | 14 ++--- overlay.nix | 5 +- 6 files changed, 99 insertions(+), 19 deletions(-) diff --git a/clusters/mantis/testnet/default.nix b/clusters/mantis/testnet/default.nix index 49dd192..5eb08fb 100644 --- a/clusters/mantis/testnet/default.nix +++ b/clusters/mantis/testnet/default.nix @@ -91,7 +91,7 @@ in { maxSize = 40; instanceType = "c5.2xlarge"; associatePublicIP = true; - maxInstanceLifetime = 604800; + maxInstanceLifetime = 0; iam.role = cluster.iam.roles.client; iam.instanceProfile.role = cluster.iam.roles.client; diff --git a/flake.lock b/flake.lock index 1fffce5..fcb351d 100644 --- a/flake.lock +++ b/flake.lock @@ -73,6 +73,36 @@ "type": "github" } }, + "flake-utils": { + "locked": { + "lastModified": 1601282935, + "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "588973065fce51f4763287f0fda87a174d78bf48", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1605370193, + "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "inclusive": { "inputs": { "stdlib": "stdlib" @@ -110,13 +140,16 @@ } }, "mantis-explorer": { - "flake": false, + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3" + }, "locked": { - "lastModified": 1605730523, - "narHash": "sha256-pu0kZ2YBDv7ng1OcPb7soCyIRNe9/o0nXaJSAOsjy8w=", + "lastModified": 1606398004, + "narHash": "sha256-DSHugqfkEgHlz5Ce28eW/V+k50OOSVjxEZIB50YX79g=", "owner": "input-output-hk", "repo": "mantis-explorer", - "rev": "0f0c1a57a933c7de9e8bf41731e6a16f937ea5bd", + "rev": "9f9a3482c4f2332b9490a673d262345bb2ba8cd7", "type": "github" }, "original": { @@ -125,6 +158,26 @@ "type": "github" } }, + "mantis-faucet-web": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1606396978, + "narHash": "sha256-EhjfwEDZ42nNaoEGk1p7g54RiGdFYA5bogYxm0vAcno=", + "owner": "input-output-hk", + "repo": "mantis-faucet-web", + "rev": "0e6b362a039244be1d85aa655067cb113e078536", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix-build", + "repo": "mantis-faucet-web", + "type": "github" + } + }, "midnight-automation": { "flake": false, "locked": { @@ -188,6 +241,33 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1603802751, + "narHash": "sha256-K3CeF3CYy7LCu0J1NnSdo77oVIkcwf0cXDAA/HFjP58=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a1fdce8d3482b60ac13678a8eab838777b51549", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1605721780, + "narHash": "sha256-MhaNS4HGHcOCwW+HadSxustHTzD1LWznh584eYBvJ5Q=", + "path": "/nix/store/5c45nyf2kwjq40lz4nfycwkhjwg21rhn-source", + "rev": "58f9c4c7d3a42c912362ca68577162e38ea8edfb", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "ops-lib": { "flake": false, "locked": { @@ -234,6 +314,7 @@ "inclusive" ], "mantis-explorer": "mantis-explorer", + "mantis-faucet-web": "mantis-faucet-web", "midnight-automation": "midnight-automation", "nixpkgs": [ "bitte", diff --git a/flake.nix b/flake.nix index 75eae63..2d91ff7 100644 --- a/flake.nix +++ b/flake.nix @@ -16,10 +16,9 @@ "git+ssh://github.com/input-output-hk/midnight-automation?ref=etcm-99-mantis-agen"; flake = false; }; - mantis-explorer = { - url = "github:input-output-hk/mantis-explorer"; - flake = false; - }; + mantis-explorer.url = "github:input-output-hk/mantis-explorer"; + mantis-faucet-web.url = + "github:input-output-hk/mantis-faucet-web/nix-build"; }; outputs = { self, nixpkgs, utils, ops-lib, bitte, ... }: diff --git a/jobs/mantis-qa-fastsync.nix b/jobs/mantis-qa-fastsync.nix index 95d504b..cb3a2f2 100644 --- a/jobs/mantis-qa-fastsync.nix +++ b/jobs/mantis-qa-fastsync.nix @@ -1,4 +1,3 @@ - { mkNomadJob, lib, mantis, mantis-source, mantis-faucet, mantis-faucet-source , dockerImages }: let diff --git a/jobs/mantis-qa-load.nix b/jobs/mantis-qa-load.nix index 1888d13..c5aa8ff 100644 --- a/jobs/mantis-qa-load.nix +++ b/jobs/mantis-qa-load.nix @@ -166,7 +166,7 @@ let checkRestart = { limit = 5; - grace = "300s"; + grace = "400s"; ignoreWarnings = false; }; }]; @@ -197,10 +197,10 @@ let }; restartPolicy = { - interval = "30m"; - attempts = 10; + interval = "15m"; + attempts = 5; delay = "1m"; - mode = "fail"; + mode = "delay"; }; env = { REQUIRED_PEER_COUNT = toString requiredPeerCount; }; @@ -256,7 +256,7 @@ let inherit count; - requiredPeerCount = builtins.length miners; + requiredPeerCount = 5; services."${name}-rpc" = { addressMode = "host"; @@ -307,7 +307,7 @@ let mantis.blockchains.testnet-internal-nomad.ecip1098-block-number = 0 mantis.blockchains.testnet-internal-nomad.ecip1097-block-number = 0 ''; - changeMode = "restart"; + changeMode = "noop"; destination = "local/mantis.conf"; } genesisJson @@ -318,7 +318,7 @@ let miners = lib.forEach (lib.range 1 amountOfMiners) (num: { name = "mantis-${toString num}"; - requiredPeerCount = num - 1; + requiredPeerCount = if num > 5 then 5 else num - 1; publicPort = 9000 + num; # routed through haproxy/ingress }); diff --git a/overlay.nix b/overlay.nix index 7db3e11..915dc93 100644 --- a/overlay.nix +++ b/overlay.nix @@ -313,8 +313,9 @@ in { tree ]; - mantis-explorer = - final.callPackage (self.inputs.mantis-explorer + "/package.nix") { }; + mantis-explorer = self.inputs.mantis-explorer.defaultPackage.${system}; + + mantis-faucet-web = self.inputs.mantis-faucet-web.defaultPackage.${system}; nixosConfigurations = self.inputs.bitte.legacyPackages.${system}.mkNixosConfigurations