Skip to content

Commit 48ff787

Browse files
authored
Merge pull request #1358 from input-output-hk/jpraynaud/1356-manual-deploy-test-network
Manual deployment of test Mithril network
2 parents 89b689f + 44cdb58 commit 48ff787

File tree

2 files changed

+121
-4
lines changed

2 files changed

+121
-4
lines changed

.github/workflows/test-deploy.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Test network deploy
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mithril_image_id:
7+
description: |
8+
Mithril Docker image id of a distribution to deploy. (Must exist in the Docker images registry)
9+
required: true
10+
type: string
11+
environment:
12+
description: |
13+
Mithril network name to deploy the distribution to.
14+
required: true
15+
type: choice
16+
options:
17+
- dev-preview
18+
dry_run:
19+
description: Dry run will not deploy the distribution to the Mithril network
20+
required: true
21+
type: boolean
22+
default: true
23+
24+
jobs:
25+
deploy-testing:
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
environment: [ dev-preview ]
30+
include:
31+
- environment: dev-preview
32+
environment_prefix: dev
33+
cardano_network: preview
34+
mithril_api_domain: api.mithril.network
35+
mithril_protocol_parameters: |
36+
{
37+
k = 100
38+
m = 60
39+
phi_f = 0.95
40+
}
41+
mithril_signers: |
42+
{
43+
"1" = {
44+
type = "unverified",
45+
pool_id = "pool1vapqexnsx6hvc588yyysxpjecf3k43hcr5mvhmstutuvy085xpa",
46+
},
47+
}
48+
terraform_backend_bucket: hydra-terraform-admin
49+
google_region: europe-west1
50+
google_zone: europe-west1-b
51+
google_machine_type: e2-highmem-2
52+
google_compute_instance_boot_disk_size: 200
53+
google_compute_instance_data_disk_size: 250
54+
55+
environment: ${{ matrix.environment }}
56+
runs-on: ubuntu-22.04
57+
defaults:
58+
run:
59+
working-directory: mithril-infra
60+
steps:
61+
- name: Checkout sources
62+
if: inputs.environment == matrix.environment
63+
uses: actions/checkout@v3
64+
65+
- name: ${{ inputs.dry_run == 'true' && 'Plan' || 'Apply' }} terraform infrastructure
66+
if: inputs.environment == matrix.environment
67+
uses: ./.github/workflows/actions/deploy-terraform-infrastructure
68+
with:
69+
dry_run: ${{ inputs.dry_run }}
70+
terraform_backend_bucket: ${{ matrix.terraform_backend_bucket }}
71+
environment_prefix: ${{ matrix.environment_prefix }}
72+
environment: ${{ matrix.environment }}
73+
cardano_network: ${{ matrix.cardano_network }}
74+
google_region: ${{ matrix.google_region }}
75+
google_zone: ${{ matrix.google_zone }}
76+
google_machine_type: ${{ matrix.google_machine_type }}
77+
google_compute_instance_boot_disk_size: ${{ matrix.google_compute_instance_boot_disk_size }}
78+
google_compute_instance_data_disk_size: ${{ matrix.google_compute_instance_data_disk_size }}
79+
google_application_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
80+
mithril_api_domain: ${{ matrix.mithril_api_domain }}
81+
mithril_image_id: ${{ inputs.mithril_image_id }}
82+
mithril_protocol_parameters: ${{ toJSON(matrix.mithril_protocol_parameters) }}
83+
mithril_signers: ${{ toJSON(matrix.mithril_signers) }}
84+
mithril_genesis_secret_key: ${{ secrets.GENESIS_SECRET_KEY }}
85+
mithril_genesis_verification_key_url: ${{ vars.GENESIS_VERIFICATION_KEY_URL }}
86+
mithril_era_reader_address_url: ${{ vars.ERA_READER_ADDRESS_URL }}
87+
mithril_era_reader_verification_key_url: ${{ vars.ERA_READER_VERIFICATION_KEY_URL }}
88+
mithril_era_reader_secret_key: ${{ secrets.ERA_READER_SECRET_KEY }}
89+
mithril_aggregator_cdn_cname: ${{ vars.AGGREGATOR_CDN_CNAME }}
90+
mithril_aggregator_snapshot_use_cdn_domain: ${{ vars.AGGREGATOR_USE_CDN_DOMAIN }}
91+
mithril_aggregator_snapshot_compression_algorithm: ${{ vars.AGGREGATOR_SNAPSHOT_COMPRESSION_ALGORITHM }}
92+
mithril_aggregator_zstandard_parameters_level: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_LEVEL }}
93+
mithril_aggregator_zstandard_parameters_workers: ${{ vars.AGGREGATOR_SNAPSHOT_ZSTANDARD_WORKERS }}
94+
mithril_aggregator_cexplorer_pools_url: ${{ vars.AGGREGATOR_CEXPLORER_POOLS_URL }}
95+
prometheus_auth_username: ${{ secrets.PROMETHEUS_AUTH_USERNAME }}
96+
prometheus_auth_password: ${{ secrets.PROMETHEUS_AUTH_PASSWORD }}
97+
prometheus_ingest_host: ${{ vars.PROMETHEUS_INGEST_HOST }}
98+
prometheus_ingest_username: ${{ secrets.PROMETHEUS_INGEST_USERNAME }}
99+
prometheus_ingest_password: ${{ secrets.PROMETHEUS_INGEST_PASSWORD }}
100+
loki_auth_username: ${{ secrets.LOKI_AUTH_USERNAME }}
101+
loki_auth_password: ${{ secrets.LOKI_AUTH_PASSWORD }}
102+
loki_ingest_host: ${{ vars.LOKI_INGEST_HOST }}
103+
loki_ingest_username: ${{ secrets.LOKI_INGEST_USERNAME }}
104+
loki_ingest_password: ${{ secrets.LOKI_INGEST_PASSWORD }}

.github/workflows/test-docker.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Docker images test
33
on:
44
workflow_dispatch:
55
inputs:
6+
distribution_code:
7+
description: |
8+
Specific code to identify the new distribution. The distribution package will be named with the following nomenclature: `test-{{distribution_code}}-{{sha}}`
9+
required: true
10+
type: string
611
commit_sha:
712
description: |
813
SHA of the commit on which the mithril binaries should be obtained, a "ci.yml" workflow must have run
@@ -26,15 +31,19 @@ jobs:
2631
strategy:
2732
fail-fast: false
2833
matrix:
29-
project: [ mithril-aggregator, mithril-client-cli, mithril-signer ]
34+
project: [ mithril-aggregator, mithril-client-cli, mithril-signer, mithril-relay ]
35+
36+
include:
37+
- project: mithril-client-cli
38+
package: mithril-client
3039

3140
permissions:
3241
contents: read
3342
packages: write
3443

3544
env:
3645
REGISTRY: ghcr.io
37-
IMAGE_NAME: ${{ github.repository_owner }}/${{ matrix.project }}
46+
PACKAGE: ${{ github.repository_owner }}/${{ matrix.package != '' && matrix.package || matrix.project }}
3847
DOCKER_FILE: ./${{ matrix.project }}/Dockerfile.ci
3948
CONTEXT: .
4049
GITHUB_REF: ${{ github.ref}}
@@ -43,6 +52,10 @@ jobs:
4352
- name: Checkout repository
4453
uses: actions/checkout@v3
4554

55+
- name: Get short SHA
56+
id: slug
57+
run: echo "sha8=$(echo ${{ inputs.commit_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
58+
4659
- name: Checkout commit
4760
run: |
4861
git checkout ${{ inputs.commit_sha }}
@@ -67,10 +80,10 @@ jobs:
6780
id: meta
6881
uses: docker/metadata-action@v4
6982
with:
70-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
83+
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
7184
tags: |
7285
test
73-
type=raw,value=test-${{ inputs.commit_sha }}
86+
type=raw,value=test-${{ inputs.distribution_code }}-${{ steps.slug.outputs.sha8 }}
7487
7588
- name: Build and push Docker image
7689
uses: docker/build-push-action@v3

0 commit comments

Comments
 (0)