Skip to content

Commit 6086c8a

Browse files
authored
Merge pull request #1206 from input-output-hk/jpraynaud/986-add-cloudflare-support
Add aggregator CDN support in infrastructure
2 parents 0d75602 + 0f37c48 commit 6086c8a

File tree

21 files changed

+152
-24
lines changed

21 files changed

+152
-24
lines changed

.github/workflows/actions/deploy-terraform-infrastructure/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ inputs:
6060
mithril_era_reader_secret_key:
6161
description: Mithril era reader secret key (onlye for test networks).
6262
required: false
63+
mithril_aggregator_cdn_cname:
64+
description: Mithril aggregator uses CDN domain for constructing snapshot url.
65+
required: true
66+
mithril_aggregator_snapshot_use_cdn_domain:
67+
description: Mithril aggregator CNAME field used for the snapshot CDN.
68+
required: false
69+
default: "false"
6370
mithril_aggregator_snapshot_compression_algorithm:
6471
description: Mithril aggregator snapshot compression algorithm.
6572
required: false
@@ -136,6 +143,8 @@ runs:
136143
mithril_era_reader_address_url = "${{ inputs.mithril_era_reader_address_url }}"
137144
mithril_era_reader_verification_key_url = "${{ inputs.mithril_era_reader_verification_key_url }}"
138145
mithril_era_reader_secret_key = "${{ inputs.mithril_era_reader_secret_key }}"
146+
mithril_aggregator_cdn_cname = "${{ inputs.mithril_aggregator_cdn_cname }}"
147+
mithril_aggregator_snapshot_use_cdn_domain = ${{ inputs.mithril_aggregator_snapshot_use_cdn_domain }}
139148
mithril_aggregator_snapshot_compression_algorithm = "${{ inputs.mithril_aggregator_snapshot_compression_algorithm }}"
140149
mithril_aggregator_zstandard_parameters_level = "${{ inputs.mithril_aggregator_zstandard_parameters_level }}"
141150
mithril_aggregator_zstandard_parameters_workers = "${{ inputs.mithril_aggregator_zstandard_parameters_workers }}"
@@ -162,7 +171,7 @@ runs:
162171
shell: bash
163172
working-directory: mithril-infra
164173
run: |
165-
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ inputs.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ inputs.environment }}"
174+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ inputs.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ inputs.environment }}" -upgrade
166175
167176
- name: Check Terraform
168177
shell: bash

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ jobs:
476476
mithril_era_reader_address_url: ${{ vars.ERA_READER_ADDRESS_URL }}
477477
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
478478
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
479+
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
480+
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
479481
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}
480482
mithril_aggregator_zstandard_parameters_level: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_LEVEL }}
481483
mithril_aggregator_zstandard_parameters_workers: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_WORKERS }}

.github/workflows/pre-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ jobs:
201201
mithril_era_reader_address_url: ${{ vars.ERA_READER_ADDRESS_URL }}
202202
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
203203
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
204+
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
205+
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
204206
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}
205207
mithril_aggregator_zstandard_parameters_level: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_LEVEL }}
206208
mithril_aggregator_zstandard_parameters_workers: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_WORKERS }}

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ jobs:
191191
mithril_genesis_verification_key_url: ${{ vars.GENESIS_VERIFICATION_KEY_URL }}
192192
mithril_era_reader_address_url: ${{ vars.ERA_READER_ADDRESS_URL }}
193193
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
194+
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
195+
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
194196
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}
195197
mithril_aggregator_zstandard_parameters_level: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_LEVEL }}
196198
mithril_aggregator_zstandard_parameters_workers: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_WORKERS }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/website/root/manual/developer-docs/nodes/mithril-aggregator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ Here is a list of the available parameters:
437437
| `snapshot_store_type` | - | - | `SNAPSHOT_STORE_TYPE` | Type of snapshot store to use | - | `gcp` or `local` | :heavy_check_mark: |
438438
| `snapshot_uploader_type` | - | - | `SNAPSHOT_UPLOADER_TYPE` | Type of snapshot uploader to use | - | `gcp` or `local` | :heavy_check_mark: |
439439
| `snapshot_bucket_name` | - | - | `SNAPSHOT_BUCKET_NAME` | Name of the bucket where the snapshots are stored | - | `snapshot-bucket` | :heavy_check_mark: | Required if `snapshot_uploader_type` is `gcp`
440+
| `snapshot_use_cdn_domain` | - | - | `SNAPSHOT_USE_CDN_DOMAIN` | Use CDN domain for constructing snapshot url | `false` | - | - | To be used if `snapshot_uploader_type` is `gcp`
440441
| `run_interval` | - | - | `RUN_INTERVAL` | Interval between two runtime cycles in ms | - | `60000` | :heavy_check_mark: |
441-
| `url_snapshot_manifest` | - | - | `URL_SNAPSHOT_MANIFEST` | Snapshots manifest location | - | Only if `snapshot_store_type` is `gcp`, else it should be `` | :heavy_check_mark: |
442442
| `era_reader_adapter_type` | `--era-reader-adapter-type` | - | `ERA_READER_ADAPTER_TYPE` | Era reader adapter type that can be `cardano-chain`, `file` or `bootstrap`. | `bootstrap` | - | - |
443443
| `era_reader_adapter_params` | `--era-reader-adapter-params` | - | `ERA_READER_ADAPTER_PARAMS` | Era reader adapter params that is an optional JSON encoded parameters structure that is expected depending on the `era_reader_adapter_type` parameter | - | - | - |
444444
| `snapshot_compression_algorithm` | `--snapshot-compression-algorithm` | - | `SNAPSHOT_COMPRESSION_ALGORITHM` | Compression algorithm of the snapshot archive | `zstandard` | `gzip` or `zstandard` | - |

docs/website/root/manual/getting-started/run-mithril-devnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Creating artifacts_mithril-aggregator_1 ... done
165165
Creating artifacts_mithril-signer-node-pool1_1 ... done
166166
Creating artifacts_mithril-signer-node-pool2_1 ... done
167167
Creating artifacts_mithril-aggregator-genesis_run ... done
168-
{"msg":"Started","v":0,"name":"slog-rs","level":20,"time":"2022-09-06T09:24:31.925641527Z","hostname":"e932dff845aa","pid":1,"config":"Configuration { cardano_cli_path: \"/app/bin/cardano-cli\", cardano_node_socket_path: \"/data/ipc/node.sock\", network_magic: Some(42), network: \"devnet\", protocol_parameters: ProtocolParameters { k: 5, m: 100, phi_f: 0.65 }, url_snapshot_manifest: \"\", snapshot_store_type: Local, snapshot_uploader_type: Local, server_url: \"http://0.0.0.0:8080/\", run_interval: 1000, db_directory: \"/data/db\", snapshot_directory: \"/data/mithril/aggregator\", data_stores_directory: \"/data/mithril/aggregator/stores\", genesis_verification_key: \"5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c3235322c3138302c37322c3133342c3133372c3234372c3136312c36385d\" }","run_mode":"dev"}
168+
{"msg":"Started","v":0,"name":"slog-rs","level":20,"time":"2022-09-06T09:24:31.925641527Z","hostname":"e932dff845aa","pid":1,"config":"Configuration { cardano_cli_path: \"/app/bin/cardano-cli\", cardano_node_socket_path: \"/data/ipc/node.sock\", network_magic: Some(42), network: \"devnet\", protocol_parameters: ProtocolParameters { k: 5, m: 100, phi_f: 0.65 }, snapshot_store_type: Local, snapshot_uploader_type: Local, server_url: \"http://0.0.0.0:8080/\", run_interval: 1000, db_directory: \"/data/db\", snapshot_directory: \"/data/mithril/aggregator\", data_stores_directory: \"/data/mithril/aggregator/stores\", genesis_verification_key: \"5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c3235322c3138302c37322c3133342c3133372c3234372c3136312c36385d\" }","run_mode":"dev"}
169169
{"msg":"New LocalSnapshotUploader created","v":0,"name":"slog-rs","level":20Genesis bootstrap for test only
170170
,"time":"2022-09-06T09:24:31.925683285Z","hostname":"e932dff845aa","pid":1,"snapshot_server_url":"http://0.0.0.0:8080/"}
171171
{"msg":"New MultiSignerImpl created","v":0,"name":"slog-rs","level":20,"time":"2022-09-06T09:24:31.925711468Z","hostname":"e932dff845aa","pid":1}

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.3.86"
3+
version = "0.3.87"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/config/dev.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
"m": 100,
1111
"phi_f": 0.65
1212
},
13-
"url_snapshot_manifest": "https://storage.googleapis.com/cardano-testnet/snapshots.json",
1413
"snapshot_store_type": "local",
1514
"snapshot_uploader_type": "local",
1615
"data_stores_directory": "/tmp/mithril-aggregator/stores",
1716
"genesis_verification_key": "5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c3235322c3138302c37322c3133342c3133372c3234372c3136312c36385d",
1817
"era_adapter_type": "bootstrap"
19-
}
18+
}

mithril-aggregator/config/preview.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
"m": 100,
1010
"phi_f": 0.65
1111
},
12-
"url_snapshot_manifest": "https://storage.googleapis.com/cardano-preview/snapshots.json",
1312
"snapshot_store_type": "local",
1413
"snapshot_uploader_type": "gcp",
1514
"snapshot_bucket_name": "cardano-testnet",
1615
"stores_directory": "./mithril-aggregator/stores",
1716
"genesis_verification_key": "5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d",
1817
"limit_keys_in_stores": 5,
1918
"era_adapter_type": "bootstrap"
20-
}
19+
}

0 commit comments

Comments
 (0)