Skip to content

Commit a388186

Browse files
authored
Merge pull request #577 from input-output-hk/jpraynaud/542-new-preview-environments
Activate new Mithril networks
2 parents 925bfe8 + 57fb865 commit a388186

File tree

6 files changed

+201
-14
lines changed

6 files changed

+201
-14
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@ jobs:
361361
strategy:
362362
fail-fast: false
363363
matrix:
364-
environment: [ release-preprod ]
364+
environment: [ testing-preview ]
365365
include:
366-
- environment: release-preprod
367-
environment_prefix: release
368-
cardano_network: preprod
366+
- environment: testing-preview
367+
environment_prefix: testing
368+
cardano_network: preview
369369
mithril_api_domain: api.mithril.network
370370
mithril_protocol_parameters: |
371371
{
@@ -376,13 +376,13 @@ jobs:
376376
mithril_signers: |
377377
{
378378
"1" = {
379-
pool_id = "pool1zr907nmfsq5kalxdjju349nwg6f03lyfmcjfqcz52jf45gcgh03",
379+
pool_id = "pool18r62tz408lkgfu6pq5svwzkh2vslkeg6mf72qf3h8njgvzhx9ce",
380380
},
381381
}
382382
terraform_backend_bucket: hydra-terraform-admin
383383
google_region: europe-west1
384384
google_zone: europe-west1-b
385-
google_machine_type: e2-highmem-2
385+
google_machine_type: e2-medium
386386

387387
runs-on: ubuntu-22.04
388388

.github/workflows/pre-release.yml

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,100 @@ jobs:
136136
tags: ${{ steps.meta.outputs.tags }}
137137

138138
deploy-pre-release:
139+
strategy:
140+
fail-fast: false
141+
matrix:
142+
environment: [ pre-release-preview ]
143+
include:
144+
- environment: pre-release-preview
145+
environment_prefix: pre-release
146+
cardano_network: preview
147+
mithril_api_domain: api.mithril.network
148+
mithril_protocol_parameters: |
149+
{
150+
k = 5
151+
m = 100
152+
phi_f = 0.65
153+
}
154+
mithril_signers: |
155+
{
156+
"1" = {
157+
pool_id = "pool18r62tz408lkgfu6pq5svwzkh2vslkeg6mf72qf3h8njgvzhx9ce",
158+
},
159+
}
160+
terraform_backend_bucket: hydra-terraform-admin
161+
google_region: europe-west1
162+
google_zone: europe-west1-b
163+
google_machine_type: e2-medium
164+
139165
runs-on: ubuntu-22.04
166+
140167
needs:
141168
- build-push-docker
169+
170+
environment: ${{ matrix.environment }}
171+
172+
env:
173+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
174+
GENESIS_SECRET_KEY: ${{ secrets.GENESIS_SECRET_KEY }}
175+
GENESIS_VERIFICATION_KEY_URL: ${{ secrets.GENESIS_VERIFICATION_KEY_URL }}
176+
DOCKER_IMAGE_ID: pre-release
177+
178+
defaults:
179+
run:
180+
working-directory: mithril-infra
181+
142182
steps:
143-
- name: TODO
144-
run: echo "Add terraform deployment to a pre-release environment here"
183+
184+
- name: Checkout sources
185+
uses: actions/checkout@v3
186+
187+
- name: Prepare service account credentials
188+
run: |
189+
echo '${{ env.GOOGLE_APPLICATION_CREDENTIALS}}' > ./google-application-credentials.json
190+
chmod u+x ./assets/tools/google-credentials-public-key.sh
191+
./assets/tools/google-credentials-public-key.sh ./google-application-credentials.json ./assets/ssh_keys curry
192+
193+
- name: Prepare terraform variables
194+
run: |
195+
cat > ./env.variables.tfvars << EOF
196+
environment_prefix = "${{ matrix.environment_prefix }}"
197+
cardano_network = "${{ matrix.cardano_network }}"
198+
google_region = "${{ matrix.google_region }}"
199+
google_zone = "${{ matrix.google_zone }}"
200+
google_machine_type = "${{ matrix.google_machine_type }}"
201+
google_service_credentials_json_file = "./google-application-credentials.json"
202+
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
203+
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
204+
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
205+
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
206+
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
207+
mithril_signers = ${{ matrix.mithril_signers }}
208+
EOF
209+
terraform fmt ./env.variables.tfvars
210+
cat ./env.variables.tfvars
211+
212+
- name: Setup Terraform
213+
uses: hashicorp/setup-terraform@v2
214+
with:
215+
terraform_wrapper: false
216+
217+
- name: Init Terraform
218+
run: |
219+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ matrix.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ matrix.environment }}"
220+
221+
- name: Check Terraform
222+
run: terraform fmt -check
223+
224+
- name: Terraform Plan
225+
run: |
226+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform plan --var-file=./env.variables.tfvars
227+
228+
- name: Terraform Apply
229+
run: |
230+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform apply -auto-approve --var-file=./env.variables.tfvars
231+
232+
- name: Cleanup
233+
run: |
234+
rm -f ./env.variables.tfvars
235+
rm -f ./google-application-credentials.json

.github/workflows/release.yml

Lines changed: 95 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,100 @@ jobs:
6161
tags: ${{ steps.meta.outputs.tags }}
6262

6363
deploy-release:
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
environment: [ release-preprod ]
68+
include:
69+
- environment: release-preprod
70+
environment_prefix: release
71+
cardano_network: preprod
72+
mithril_api_domain: api.mithril.network
73+
mithril_protocol_parameters: |
74+
{
75+
k = 5
76+
m = 100
77+
phi_f = 0.65
78+
}
79+
mithril_signers: |
80+
{
81+
"1" = {
82+
pool_id = "pool1zr907nmfsq5kalxdjju349nwg6f03lyfmcjfqcz52jf45gcgh03",
83+
},
84+
}
85+
terraform_backend_bucket: hydra-terraform-admin
86+
google_region: europe-west1
87+
google_zone: europe-west1-b
88+
google_machine_type: e2-highmem-2
89+
6490
runs-on: ubuntu-22.04
91+
92+
needs:
93+
- build-push-docker
94+
95+
environment: ${{ matrix.environment }}
96+
97+
env:
98+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
99+
GENESIS_SECRET_KEY: ${{ secrets.GENESIS_SECRET_KEY }}
100+
GENESIS_VERIFICATION_KEY_URL: ${{ secrets.GENESIS_VERIFICATION_KEY_URL }}
101+
DOCKER_IMAGE_ID: latest
102+
103+
defaults:
104+
run:
105+
working-directory: mithril-infra
106+
65107
steps:
66-
- name: TODO
67-
run: echo "Add terraform deployment to a release environment here"
108+
109+
- name: Checkout sources
110+
uses: actions/checkout@v3
111+
112+
- name: Prepare service account credentials
113+
run: |
114+
echo '${{ env.GOOGLE_APPLICATION_CREDENTIALS}}' > ./google-application-credentials.json
115+
chmod u+x ./assets/tools/google-credentials-public-key.sh
116+
./assets/tools/google-credentials-public-key.sh ./google-application-credentials.json ./assets/ssh_keys curry
117+
118+
- name: Prepare terraform variables
119+
run: |
120+
cat > ./env.variables.tfvars << EOF
121+
environment_prefix = "${{ matrix.environment_prefix }}"
122+
cardano_network = "${{ matrix.cardano_network }}"
123+
google_region = "${{ matrix.google_region }}"
124+
google_zone = "${{ matrix.google_zone }}"
125+
google_machine_type = "${{ matrix.google_machine_type }}"
126+
google_service_credentials_json_file = "./google-application-credentials.json"
127+
mithril_api_domain = "${{ matrix.mithril_api_domain }}"
128+
mithril_image_id = "${{ env.DOCKER_IMAGE_ID }}"
129+
mithril_genesis_verification_key_url = "${{ env.GENESIS_VERIFICATION_KEY_URL }}"
130+
mithril_genesis_secret_key = "${{ env.GENESIS_SECRET_KEY }}"
131+
mithril_protocol_parameters = ${{ matrix.mithril_protocol_parameters }}
132+
mithril_signers = ${{ matrix.mithril_signers }}
133+
EOF
134+
terraform fmt ./env.variables.tfvars
135+
cat ./env.variables.tfvars
136+
137+
- name: Setup Terraform
138+
uses: hashicorp/setup-terraform@v2
139+
with:
140+
terraform_wrapper: false
141+
142+
- name: Init Terraform
143+
run: |
144+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform init -backend-config="bucket=${{ matrix.terraform_backend_bucket }}" -backend-config="prefix=terraform/mithril-${{ matrix.environment }}"
145+
146+
- name: Check Terraform
147+
run: terraform fmt -check
148+
149+
- name: Terraform Plan
150+
run: |
151+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform plan --var-file=./env.variables.tfvars
152+
153+
- name: Terraform Apply
154+
run: |
155+
GOOGLE_APPLICATION_CREDENTIALS=./google-application-credentials.json terraform apply -auto-approve --var-file=./env.variables.tfvars
156+
157+
- name: Cleanup
158+
run: |
159+
rm -f ./env.variables.tfvars
160+
rm -f ./google-application-credentials.json

docs/root/manual/developer-docs/references.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ For more information about the **Mithril Protocol**, please refer to the [About
2121
## Mithril Networks
2222

2323
Here is an up ot date list of all the Mithril Networks and their status
24-
> Last update: 10/28/2022
24+
> Last update: 11/02/2022
2525
2626
| Mithril Network | Cardano Network | Magic Id | Supported | Aggregator Endpoint | Genesis Verification Key | Note
2727
|------------|------------|:-----------:|:------------:|:-----------------:|:------------------:|:------------|
2828
| `release-mainnet` | `mainnet` | - | :x: | - | - | Not supported yet
29-
| `release-preprod` | `preprod` | `1` | :warning: | [:arrow_upper_right:](https://aggregator.release-preprod.api.mithril.network/aggregator) | [:arrow_upper_right:](https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey) | Supported but subject to re-genesis shortly
30-
| `testing-preview` | `preview` | `2` | :warning: | [:arrow_upper_right:](https://aggregator.api.mithril.network/aggregator) | [:arrow_upper_right:](https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey) | Supported but it will be re-spun after the `preview` network re-spin, and endpoint location will be updated
29+
| `release-preprod` | `preprod` | `1` | :heavy_check_mark: | [:arrow_upper_right:](https://aggregator.release-preprod.api.mithril.network/aggregator) | [:arrow_upper_right:](https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey) | Works on re-spun `preprod` network
30+
| `pre-release-preview` | `preview` | `2` | :heavy_check_mark: | [:arrow_upper_right:](https://aggregator.pre-release-preview.api.mithril.network/aggregator) | [:arrow_upper_right:](https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey) | Works on re-spun `preview` network
31+
| `testing-preview` | `preview` | `2` | :heavy_check_mark: | [:arrow_upper_right:](https://aggregator.testing-preview.api.mithril.network/aggregator) | [:arrow_upper_right:](https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey) | Works on re-spun `preview` network
3132
| `dev-devnet` | `devnet` | `42` | :heavy_check_mark: | [:arrow_upper_right:](http://localhost:8080/aggregator) | - | Supported on the `devnet` only
3233
| `-` | `testnet` | `1097911063` | :x: | - | - | Decommissioned, not supported anymore
3334

mithril-explorer/pages/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import styles from "../styles/Home.module.css";
88

99
const available_aggregators = [
1010
"https://aggregator.release-preprod.api.mithril.network/aggregator",
11+
"https://aggregator.pre-release-preview.api.mithril.network/aggregator",
12+
"https://aggregator.testing-preview.api.mithril.network/aggregator",
1113
"https://aggregator.api.mithril.network/aggregator",
1214
"http://localhost:8080/aggregator"
1315
];

mithril-infra/main.cloud-storage.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resource "google_storage_bucket" "cloud_storage" {
1414
}
1515

1616
resource "google_service_account" "cloud_storage" {
17-
account_id = "${local.environment_name}-cs-sa"
17+
account_id = local.environment_name
1818
display_name = "${local.environment_name}-cs-sa"
1919
description = "${local.environment_name} cloud storage service account"
2020
}

0 commit comments

Comments
 (0)