Skip to content

Commit 6b082ad

Browse files
Merge pull request #1498 from input-output-hk/release/be/0.30.1
Release/be/0.30.1
2 parents 81b52f5 + 578afed commit 6b082ad

17 files changed

+382
-499
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
jobs:
2+
deploy:
3+
environment: ${{ inputs.environment }}
4+
runs-on: ubuntu-latest
5+
steps:
6+
- name: 📥 Checkout repository
7+
uses: actions/checkout@v3
8+
- name: 🧰 Setup Nix
9+
uses: nixbuild/nix-quick-install-action@v28
10+
- uses: aws-actions/[email protected]
11+
with:
12+
aws-region: us-east-1
13+
role-to-assume: ${{ contains(github.ref, "release/") && 'arn:aws:iam::926093910549:role/eks-admin'
14+
|| 'arn:aws:iam::926093910549:role/eks-devs' }}
15+
- name: 🚀 Deploy
16+
run: 'echo "yes" | nix run .#cardano-services.${{inputs.target}}.${{inputs.action}}
17+
18+
'
19+
name: cardano-services
20+
'on':
21+
workflow_call:
22+
inputs:
23+
action:
24+
required: true
25+
type: string
26+
target:
27+
required: true
28+
type: string
29+
workflow_dispatch:
30+
inputs:
31+
action:
32+
description: Action
33+
options:
34+
- apply
35+
- destroy
36+
- plan
37+
required: true
38+
type: choice
39+
target:
40+
description: Targets
41+
options:
42+
- dev-mainnet@us-east-1
43+
- dev-preprod@us-east-1@v2
44+
- dev-preview@us-east-1
45+
- dev-sanchonet@us-east-1
46+
- live-mainnet@eu-central-1@v2
47+
- live-mainnet@us-east-2@v2
48+
- live-preprod@eu-central-1@v2
49+
- live-preprod@us-east-2@v2
50+
- live-preview@eu-central-1@v2
51+
- live-preview@us-east-2@v2
52+
- live-sanchonet@eu-central-1
53+
- live-sanchonet@us-east-2
54+
- local-network@us-east-1@v1
55+
- ops-preprod-1@us-east-1
56+
- ops-preview-1@us-east-1
57+
- staging-mainnet@eu-west-1@v2
58+
- staging-preprod@us-east-1@v2
59+
required: true
60+
type: choice
61+
permissions:
62+
contents: read
63+
id-token: write

flake.lock

Lines changed: 32 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
n2c.url = "github:nlewo/nix2container";
1111
n2c.inputs.nixpkgs.follows = "nixpkgs";
1212

13-
nix-helm.url = "github:gytis-ivaskevicius/nix-helm";
14-
nix-helm.inputs.nixpkgs.follows = "nixpkgs";
13+
nix-toolbox.url = "github:DevPalace/nix-toolbox/";
14+
#nix-toolbox.inputs.nixpkgs.follows = "nixpkgs";
15+
nix-toolbox.inputs.flake-parts.follows = "flake-parts";
16+
nix-toolbox.inputs.nix2container.follows = "";
17+
1518

1619
std = {
1720
url = "github:divnix/std";
@@ -35,7 +38,7 @@
3538
outputs = {
3639
std,
3740
self,
38-
nix-helm,
41+
nix-toolbox,
3942
devshell,
4043
...
4144
} @ inputs:
@@ -72,7 +75,7 @@
7275
system,
7376
...
7477
}: {
75-
legacyPackages.cardano-services = import ./nix/cardano-services/deployments {inherit pkgs nix-helm inputs;};
78+
legacyPackages.cardano-services = import ./nix/cardano-services/deployments {inherit pkgs nix-toolbox inputs;};
7679
};
7780
};
7881
}

nix/cardano-services/deployments/asset.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
values,
44
lib,
55
utils,
6-
chart,
76
...
87
}: {
98
providers.asset-provider = {

nix/cardano-services/deployments/backend-ingress.nix

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
{
22
lib,
33
values,
4-
chart,
54
config,
65
utils,
76
...
87
}: {
98
templates.accelerator = lib.mkIf (values.useAccelerator && values.ingress.enabled) {
109
apiVersion = "operator.h3poteto.dev/v1alpha1";
1110
kind = "EndpointGroupBinding";
12-
metadata.name = "${chart.name}-main";
11+
metadata.name = "${config.name}-main";
1312
spec = {
1413
endpointGroupArn = values.acceleratorArn;
15-
ingressRef.name = "${chart.name}-backend";
14+
ingressRef.name = "${config.name}-backend";
1615
};
1716
};
1817

1918
templates.backend-ingress = lib.mkIf values.ingress.enabled {
2019
apiVersion = "networking.k8s.io/v1";
2120
kind = "Ingress";
2221
metadata = {
23-
name = "${chart.name}-backend";
22+
name = "${config.name}-backend";
2423
labels = utils.appLabels "backend";
2524
annotations =
2625
if values.useAccelerator
@@ -62,7 +61,7 @@
6261
# Use latency routing policy
6362
"external-dns.alpha.kubernetes.io/aws-region" = config.region;
6463
"external-dns.alpha.kubernetes.io/set-identifier" = values.backend.dnsId;
65-
"alb.ingress.kubernetes.io/group.name" = chart.namespace;
64+
"alb.ingress.kubernetes.io/group.name" = config.namespace;
6665
"alb.ingress.kubernetes.io/group.order" = toString values.cardano-services.ingresOrder;
6766
};
6867
};
@@ -77,7 +76,7 @@
7776
pathType = "Prefix";
7877
path = "/v${lib.last (lib.sort lib.versionOlder values.cardano-services.versions.handle)}/asset";
7978
backend.service = {
80-
name = "${chart.name}-asset-provider";
79+
name = "${config.name}-asset-provider";
8180
port.name = "http";
8281
};
8382
}
@@ -87,7 +86,7 @@
8786
pathType = "Prefix";
8887
path = "/v${lib.last (lib.sort lib.versionOlder values.cardano-services.versions.handle)}/handle";
8988
backend.service = {
90-
name = "${chart.name}-handle-provider";
89+
name = "${config.name}-handle-provider";
9190
port.name = "http";
9291
};
9392
}
@@ -97,7 +96,7 @@
9796
pathType = "Prefix";
9897
path = "/v${version}/chain-history";
9998
backend.service = {
100-
name = "${chart.name}-chain-history-provider";
99+
name = "${config.name}-chain-history-provider";
101100
port.name = "http";
102101
};
103102
})
@@ -118,7 +117,7 @@
118117
pathType = "Prefix";
119118
path = it;
120119
backend.service = {
121-
name = "${chart.name}-backend";
120+
name = "${config.name}-backend";
122121
port.name = "http";
123122
};
124123
}
@@ -129,7 +128,7 @@
129128
pathType = "Prefix";
130129
path = "/v${lib.last (lib.sort lib.versionOlder values.cardano-services.versions.stakePool)}/stake-pool";
131130
backend.service = {
132-
name = "${chart.name}-stake-pool-provider";
131+
name = "${config.name}-stake-pool-provider";
133132
port.name = "http";
134133
};
135134
}
@@ -139,7 +138,7 @@
139138
pathType = "Exact";
140139
path = "/ws";
141140
backend.service = {
142-
name = "${chart.name}-ws-server";
141+
name = "${config.name}-ws-server";
143142
port.name = "http";
144143
};
145144
}

nix/cardano-services/deployments/blockfrost-worker-deployment.nix

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
{
22
lib,
33
values,
4-
chart,
54
utils,
65
config,
76
...
87
}: {
9-
templates.blockfrost-worker-deployment = lib.mkIf values.blockfrost-worker.enabled {
10-
apiVersion = "apps/v1";
11-
kind = "Deployment";
8+
resources.deployments.blockfrost-worker = lib.mkIf values.blockfrost-worker.enabled {
129
metadata = {
13-
name = "${chart.name}-blockfrost-worker";
10+
name = "${config.name}-blockfrost-worker";
1411
labels = utils.appLabels "blockfrost-worker";
1512
};
1613
spec = {
1714
selector.matchLabels = utils.appLabels "blockfrost-worker";
1815
template = {
1916
metadata.labels = utils.appLabels "blockfrost-worker";
2017
spec = {
21-
imagePullSecrets = [
22-
{
23-
name = "dockerconfigjson";
24-
}
25-
];
18+
imagePullSecrets.dockerconfigjson = {};
2619
containers = [
2720
{
2821
inherit (values.cardano-services) image;
2922
inherit (values.blockfrost-worker) resources;
3023
name = "blockfrost-worker";
3124
args = ["start-blockfrost-worker"];
32-
ports = [
33-
{
34-
containerPort = 3000;
35-
name = "http";
36-
}
37-
];
25+
ports.http.containerPort = 3000;
3826
livenessProbe = {
3927
timeoutSeconds = 5;
4028
httpGet = {
@@ -87,12 +75,7 @@
8775
];
8876
}
8977
];
90-
volumes = [
91-
{
92-
name = "tls";
93-
secret.secretName = "postgresql-server-cert";
94-
}
95-
];
78+
volumes.tls.secret.secretName = "postgresql-server-cert";
9679
};
9780
};
9881
};

nix/cardano-services/deployments/chain-history.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
config,
32
values,
43
lib,
54
utils,
6-
chart,
5+
config,
76
...
87
}: {
98
providers.chain-history-provider = {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
lib,
3+
modules,
4+
config,
5+
...
6+
}: {
7+
imports = [
8+
modules.githubAction
9+
];
10+
11+
ci.github = {
12+
name = "cardano-services";
13+
deploymentAttrPath = config.ci.github.name;
14+
outputPath = "$PRJ_ROOT/.github/workflows/${config.ci.github.name}.yaml";
15+
extraDefinitions.permissions = {
16+
id-token = "write"; # This is required for AWS credentials action
17+
contents = "read";
18+
};
19+
extraSteps = lib.singleton {
20+
uses = "aws-actions/[email protected]";
21+
"with" = {
22+
role-to-assume = "\${{ contains(github.ref, \"release/\") && 'arn:aws:iam::926093910549:role/eks-admin' || 'arn:aws:iam::926093910549:role/eks-devs' }}";
23+
aws-region = "us-east-1";
24+
};
25+
};
26+
};
27+
}

0 commit comments

Comments
 (0)