Skip to content

Commit

Permalink
Merge pull request #1473 from input-output-hk/release/be/0.30.0
Browse files Browse the repository at this point in the history
Release/be/0.30.0
  • Loading branch information
gytis-ivaskevicius authored Sep 12, 2024
2 parents 49bb0a3 + 0132f03 commit 6542913
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 152 deletions.
188 changes: 42 additions & 146 deletions nix/cardano-services/deployments/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# cSpell:ignore builtins cardanojs concat devs healthchecks hostnames kubeconfig pkgs stakepool stakepoolv

{
pkgs,
lib ? pkgs.lib,
Expand Down Expand Up @@ -119,7 +118,8 @@ in
stakepool.databaseName = "stakepool";
ingress.enabled = true;
cardano-services = {
nodeEnv = if lib.hasPrefix "live" final.namespace
nodeEnv =
if lib.hasPrefix "live" final.namespace
then "production"
else null;
image = oci.image.name;
Expand Down Expand Up @@ -258,7 +258,6 @@ in
};
};


"dev-sanchonet@us-east-1" = final: {
name = "${final.namespace}-cardanojs";
namespace = "dev-sanchonet";
Expand Down Expand Up @@ -293,7 +292,6 @@ in
};
};


"dev-mainnet@us-east-1" = final: {
namespace = "dev-mainnet";
network = "mainnet";
Expand Down Expand Up @@ -438,25 +436,19 @@ in
enabled = true;
replicas = 4;
};
stake-pool-provider = {
enabled = true;
};
stake-pool-provider.enabled = true;
handle-provider.enabled = true;
chain-history-provider = {
enabled = true;
replicas = 2;
};
# asset-provider = {
# enabled = true;
# };
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool = {
enabled = true;
};
# asset.enabled = true;
stake-pool.enabled = true;
asset.enabled = true;
};

values = {
Expand Down Expand Up @@ -493,23 +485,19 @@ in
enabled = true;
replicas = 4;
};
stake-pool-provider = {
enabled = true;
};
handle-provider.enabled = true;
chain-history-provider = {
enabled = true;
replicas = 2;
};
#asset-provider = {
# enabled = true;
#};
stake-pool-provider.enabled = true;
handle-provider.enabled = true;
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool.enabled = true;
# asset.enabled = true;
asset.enabled = true;
};

values = {
Expand Down Expand Up @@ -569,7 +557,6 @@ in
};

values = {

cardano-services = {
ingresOrder = 98;
additionalRoutes = [
Expand All @@ -584,23 +571,6 @@ in
];
};
backend.allowedOrigins = lib.concatStringsSep "," allowedOrigins;
backend.routes = let
inherit (oci.meta) versions;
in
lib.concatLists [
(map (v: "/v${v}/health") versions.root)
(map (v: "/v${v}/live") versions.root)
(map (v: "/v${v}/meta") versions.root)
(map (v: "/v${v}/ready") versions.root)
(map (v: "/v${v}/asset") versions.assetInfo)
(map (v: "/v${v}/chain-history") versions.chainHistory)
(map (v: "/v${v}/network-info") versions.networkInfo)
(map (v: "/v${v}/rewards") versions.rewards)
(map (v: "/v${v}/tx-submit") versions.txSubmit)
(map (v: "/v${v}/utxo") versions.utxo)
(map (v: "/v${v}/handle") versions.handle)
];

blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
};
Expand All @@ -614,27 +584,17 @@ in
region = "us-east-2";

providers = {
backend = {
enabled = true;
};
stake-pool-provider = {
enabled = true;
};
handle-provider = {
enabled = true;
};
backend.enabled = true;
stake-pool-provider.enabled = true;
handle-provider.enabled = true;
chain-history-provider.enabled = true;
#asset-provider = {
# enabled = true;
#};
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool = {
enabled = true;
};
# asset.enabled = true;
stake-pool.enabled = true;
asset.enabled = true;
};

values = {
Expand All @@ -655,27 +615,17 @@ in
region = "eu-central-1";

providers = {
backend = {
enabled = true;
};
stake-pool-provider = {
enabled = true;
};
handle-provider = {
enabled = true;
};
backend.enabled = true;
stake-pool-provider.enabled = true;
handle-provider. enabled = true;
chain-history-provider.enabled = true;
#asset-provider = {
# enabled = true;
#};
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool = {
enabled = true;
};
# asset.enabled = true;
stake-pool.enabled = true;
asset.enabled = true;
};

values = {
Expand All @@ -696,27 +646,17 @@ in
region = "us-east-2";

providers = {
backend = {
enabled = true;
};
stake-pool-provider = {
enabled = true;
};
handle-provider = {
enabled = true;
};
backend.enabled = true;
stake-pool-provider.enabled = true;
handle-provider.enabled = true;
chain-history-provider.enabled = true;
#asset-provider = {
# enabled = true;
#};
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool = {
enabled = true;
};
# asset.enabled = true;
stake-pool.enabled = true;
asset.enabled = true;
};

values = {
Expand All @@ -737,27 +677,17 @@ in
region = "eu-central-1";

providers = {
backend = {
enabled = true;
};
stake-pool-provider = {
enabled = true;
};
handle-provider = {
enabled = true;
};
backend.enabled = true;
stake-pool-provider.enabled = true;
handle-provider.enabled = true;
chain-history-provider.enabled = true;
#asset-provider = {
# enabled = true;
#};
asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool = {
enabled = true;
};
# asset.enabled = true;
stake-pool.enabled = true;
asset.enabled = true;
};

values = {
Expand All @@ -777,15 +707,10 @@ in
region = "us-east-1";

providers = {
backend = {
enabled = true;
};
backend.enabled = true;
handle-provider.enabled = true;
chain-history-provider.enabled = true;
stake-pool-provider = {
enabled = true;
env.OVERRIDE_FUZZY_OPTIONS = "true";
};
stake-pool-provider.enabled = true;
};

projectors = {
Expand All @@ -794,7 +719,6 @@ in
wallet-api.enabled = true;
};


values = {
pg-boss-worker.enabled = true;
pg-boss-worker.queues = "pool-delist-schedule,pool-metadata,pool-metrics,pool-rewards";
Expand Down Expand Up @@ -851,24 +775,6 @@ in
pg-boss-worker.enabled = true;

backend.allowedOrigins = lib.concatStringsSep "," allowedOriginsDev;
backend.routes = let
inherit (oci.meta) versions;
in
lib.concatLists [
(map (v: "/v${v}/health") versions.root)
(map (v: "/v${v}/live") versions.root)
(map (v: "/v${v}/meta") versions.root)
(map (v: "/v${v}/ready") versions.root)
(map (v: "/v${v}/asset") versions.assetInfo)
(map (v: "/v${v}/chain-history") versions.chainHistory)
(map (v: "/v${v}/network-info") versions.networkInfo)
(map (v: "/v${v}/rewards") versions.rewards)
(map (v: "/v${v}/tx-submit") versions.txSubmit)
(map (v: "/v${v}/utxo") versions.utxo)
(map (v: "/v${v}/handle") versions.handle)
(map (v: "/v${v}/provider-server") versions.stakePool)
(map (v: "/v${v}/stake-pool-provider-server") versions.stakePool)
];

cardano-services = {
ingresOrder = 99;
Expand Down Expand Up @@ -961,38 +867,28 @@ in
};
};
};

}
# Convenient for cases when you need to create multiple temporary deployments with the same configuration
// (builtins.mapAttrs (_: value: (final:
value
// {
projectors = {
stake-pool.enabled = true;
};

providers = {
backend = {
enabled = true;
};
};
context = "eks-admin";
projectors.asset.enabled = true;

values = {
stakepool.databaseName = "stakepoolv3";
ingress.enabled = false;
pg-boss-worker.enabled = true;
};
})) {
#"live-preview@us-east-2@tmp" = {
#"live-mainnet@us-east-2@asset" = {
# name = "tmp-cardanojs";
# namespace = "live-preview";
# network = "preview";
# namespace = "live-mainnet";
# network = "mainnet";
# region = "us-east-2";
# context = "eks-admin";
#};
});

targetGroups = targets: {
#ASSET = lib.filterAttrs (name: _: lib.hasSuffix "asset" name) targets;
DEV = lib.filterAttrs (name: _: lib.hasPrefix "dev-" name) targets;
LIVE = lib.filterAttrs (name: _: lib.hasPrefix "live-" name) targets;
OPS = lib.filterAttrs (name: _: lib.hasPrefix "ops-" name) targets;
Expand Down
1 change: 0 additions & 1 deletion nix/cardano-services/deployments/wallet-api.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
chart,
...
}: {

projectors.wallet-api = {
inherit (values.cardano-services) image;
livenessProbe = {
Expand Down
6 changes: 3 additions & 3 deletions nix/cardano-services/deployments/ws-server.deployment.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
runAsGroup = 0;
};
args = ["start-ws-server"];
env = utils.mkPodEnv ({
env = utils.mkPodEnv {
NETWORK = config.network;
DB_CACHE_TTL = "7200";
OGMIOS_URL = "ws://${config.namespace}-cardano-core.${config.namespace}.svc.cluster.local:1337";
OGMIOS_URL = "ws://${config.namespace}-cardano-core.${config.namespace}.svc.cluster.local:1337";

POSTGRES_POOL_MAX_DB_SYNC = "2";
POSTGRES_HOST_DB_SYNC = values.postgresName;
Expand All @@ -88,7 +88,7 @@
};
POSTGRES_SSL_DB_SYNC = "true";
POSTGRES_SSL_CA_FILE_DB_SYNC = "/tls/ca.crt";
});
};
volumeMounts = [
{
mountPath = "/tls";
Expand Down
4 changes: 2 additions & 2 deletions nix/cardano-services/oci-images.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ let

# TODO: express this as OCI labels (what they are for)
buildInfo = builtins.toJSON {
inherit (self) lastModifiedDate ;
rev = self.dirtyRev or self.rev ;
inherit (self) lastModifiedDate;
rev = self.dirtyRev or self.rev;
shortRev = self.shortRev or self.dirtyShortRev;
};

Expand Down

0 comments on commit 6542913

Please sign in to comment.