From ae364133f75651c6c1d17d7a70cfae15b79e4211 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 13:00:28 +0200 Subject: [PATCH 1/9] feat: update deploy terraform action in CI To be able to set the data and boot disks types and snapshots from which to restore --- .../deploy-terraform-infrastructure/action.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/actions/deploy-terraform-infrastructure/action.yml b/.github/workflows/actions/deploy-terraform-infrastructure/action.yml index 58da279dbdc..837b6dfc57c 100644 --- a/.github/workflows/actions/deploy-terraform-infrastructure/action.yml +++ b/.github/workflows/actions/deploy-terraform-infrastructure/action.yml @@ -36,9 +36,23 @@ inputs: google_compute_instance_boot_disk_size: description: Google Cloud attached boot disk size in GB. required: true + google_compute_instance_boot_disk_type: + description: Google Cloud type of attached boot disk. + required: false + default: "pd-standard" + google_compute_instance_boot_disk_snapshot: + description: Google Cloud snapshot used to restore the boot disk. + required: false google_compute_instance_data_disk_size: description: Google Cloud attached data disk size in GB. required: true + google_compute_instance_data_disk_type: + description: Google Cloud type of attached data disk. + required: false + default: "pd-standard" + google_compute_instance_data_disk_snapshot: + description: Google Cloud snapshot used to restore the data disk. + required: false google_application_credentials: description: Google Cloud application credentials (service account). required: true @@ -174,7 +188,11 @@ runs: google_zone = "${{ inputs.google_zone }}" google_machine_type = "${{ inputs.google_machine_type }}" google_compute_instance_boot_disk_size = "${{ inputs.google_compute_instance_boot_disk_size }}" + google_compute_instance_boot_disk_type = "${{ inputs.google_compute_instance_boot_disk_type }}" + google_compute_instance_boot_disk_snapshot = "${{ inputs.google_compute_instance_boot_disk_snapshot }}" google_compute_instance_data_disk_size = "${{ inputs.google_compute_instance_data_disk_size }}" + google_compute_instance_data_disk_type = "${{ inputs.google_compute_instance_data_disk_type }}" + google_compute_instance_data_disk_snapshot = "${{ inputs.google_compute_instance_data_disk_snapshot }}" google_service_credentials_json_file = "./google-application-credentials.json" mithril_use_p2p_network = "${{ inputs.mithril_use_p2p_network }}" mithril_api_domain = "${{ inputs.mithril_api_domain }}" From 7cc8efd27419c16f1ec39469ebdbcd7ce989b275 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 13:02:36 +0200 Subject: [PATCH 2/9] feat: make 'Test network deployment' workflow use disks config Data and boot disks are fully configurable. --- .github/workflows/test-deploy-network.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-deploy-network.yml b/.github/workflows/test-deploy-network.yml index 45477497b03..28a2754b729 100644 --- a/.github/workflows/test-deploy-network.yml +++ b/.github/workflows/test-deploy-network.yml @@ -61,7 +61,9 @@ jobs: google_zone: europe-west1-b google_machine_type: e2-highmem-4 google_compute_instance_boot_disk_size: 200 + google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 250 + google_compute_instance_data_disk_type: pd-standard - environment: testing-mainnet environment_prefix: testing cardano_network: mainnet @@ -86,7 +88,9 @@ jobs: google_zone: europe-west1-b google_machine_type: e2-highmem-8 google_compute_instance_boot_disk_size: 250 + google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 1000 + google_compute_instance_data_disk_type: pd-standard environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 @@ -113,7 +117,10 @@ jobs: google_zone: ${{ matrix.google_zone }} google_machine_type: ${{ matrix.google_machine_type }} google_compute_instance_boot_disk_size: ${{ matrix.google_compute_instance_boot_disk_size }} + google_compute_instance_boot_disk_type: ${{ matrix.google_compute_instance_boot_disk_type }} google_compute_instance_data_disk_size: ${{ matrix.google_compute_instance_data_disk_size }} + google_compute_instance_data_disk_type: ${{ matrix.google_compute_instance_data_disk_type }} + google_compute_instance_data_disk_snapshot: ${{ vars.GOOGLE_COMPUTE_INSTANCE_DATA_DISK_SNAPSHOT }} google_application_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} mithril_use_p2p_network: ${{ matrix.mithril_use_p2p_network }} mithril_api_domain: ${{ matrix.mithril_api_domain }} From 611d41e697f071176aff584345d96de398f030df Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 13:02:55 +0200 Subject: [PATCH 3/9] feat: activate 'dev-mainnet' network --- .github/workflows/test-deploy-network.yml | 30 ++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-deploy-network.yml b/.github/workflows/test-deploy-network.yml index 28a2754b729..7471dca84aa 100644 --- a/.github/workflows/test-deploy-network.yml +++ b/.github/workflows/test-deploy-network.yml @@ -15,6 +15,7 @@ on: type: choice options: - dev-preview + - dev-mainnet - testing-mainnet dry_run: description: Dry run will not deploy the distribution to the Mithril network @@ -27,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - environment: [dev-preview, testing-mainnet] + environment: [dev-preview, dev-mainnet, testing-mainnet] include: - environment: dev-preview environment_prefix: dev @@ -64,6 +65,33 @@ jobs: google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 250 google_compute_instance_data_disk_type: pd-standard + - environment: dev-mainnet + environment_prefix: dev + cardano_network: mainnet + mithril_use_p2p_network: false + mithril_api_domain: api.mithril.network + mithril_era_reader_adapter_type: bootstrap + mithril_protocol_parameters: | + { + k = 2422 + m = 20973 + phi_f = 0.20 + } + mithril_signers: | + { + "1" = { + type = "unverified-alone", + pool_id = "pool1re8cmjt895tpx8dx2veg0cew5yqtxnt82sll03e433a4ugnh9w7", + } + } + terraform_backend_bucket: hydra-terraform-admin + google_region: europe-west1 + google_zone: europe-west1-b + google_machine_type: e2-highmem-8 + google_compute_instance_boot_disk_size: 250 + google_compute_instance_boot_disk_type: pd-standard + google_compute_instance_data_disk_size: 1000 + google_compute_instance_data_disk_type: pd-balanced - environment: testing-mainnet environment_prefix: testing cardano_network: mainnet From 4b026d0f295d1c67589db8e671ecd75e9864b955 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Wed, 24 Jul 2024 16:16:03 +0200 Subject: [PATCH 4/9] feat: upgrade data disk for 'testing-mainnet' --- .github/workflows/test-deploy-network.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-deploy-network.yml b/.github/workflows/test-deploy-network.yml index 7471dca84aa..2907cfd892e 100644 --- a/.github/workflows/test-deploy-network.yml +++ b/.github/workflows/test-deploy-network.yml @@ -118,7 +118,7 @@ jobs: google_compute_instance_boot_disk_size: 250 google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 1000 - google_compute_instance_data_disk_type: pd-standard + google_compute_instance_data_disk_type: pd-balanced environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 From f5d9a4b401ca5af12013ebec5a99f5ad1bbd3105 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 13:06:20 +0200 Subject: [PATCH 5/9] feat: make 'Pre-release' workflow use disks config Data and boot disks are fully configurable. --- .github/workflows/pre-release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 63fb4334b3f..9b977d7cc70 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -181,7 +181,9 @@ jobs: google_zone: europe-west1-b google_machine_type: e2-highmem-2 google_compute_instance_boot_disk_size: 200 + google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 250 + google_compute_instance_data_disk_type: pd-standard environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 needs: @@ -210,7 +212,10 @@ jobs: google_zone: ${{ matrix.google_zone }} google_machine_type: ${{ matrix.google_machine_type }} google_compute_instance_boot_disk_size: ${{ matrix.google_compute_instance_boot_disk_size }} + google_compute_instance_boot_disk_type: ${{ matrix.google_compute_instance_boot_disk_type }} google_compute_instance_data_disk_size: ${{ matrix.google_compute_instance_data_disk_size }} + google_compute_instance_data_disk_type: ${{ matrix.google_compute_instance_data_disk_type }} + google_compute_instance_data_disk_snapshot: ${{ vars.GOOGLE_COMPUTE_INSTANCE_DATA_DISK_SNAPSHOT }} google_application_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} mithril_api_domain: ${{ matrix.mithril_api_domain }} mithril_image_id: ${{ env.DOCKER_IMAGE_ID }} From e1059851aae28405f2a1cc7ce8bdacdfcd85ac93 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 13:06:30 +0200 Subject: [PATCH 6/9] feat: make 'Release' workflow use disks config Data and boot disks are fully configurable. --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6fd3af43c69..6c8d6fd8fee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,7 +92,9 @@ jobs: google_zone: europe-west1-b google_machine_type: e2-highmem-2 google_compute_instance_boot_disk_size: 200 + google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 250 + google_compute_instance_data_disk_type: pd-standard - environment: release-mainnet environment_prefix: release cardano_network: mainnet @@ -110,7 +112,9 @@ jobs: google_zone: europe-west1-b google_machine_type: e2-highmem-8 google_compute_instance_boot_disk_size: 250 + google_compute_instance_boot_disk_type: pd-standard google_compute_instance_data_disk_size: 1000 + google_compute_instance_data_disk_type: pd-standard environment: ${{ matrix.environment }} runs-on: ubuntu-22.04 @@ -140,7 +144,10 @@ jobs: google_zone: ${{ matrix.google_zone }} google_machine_type: ${{ matrix.google_machine_type }} google_compute_instance_boot_disk_size: ${{ matrix.google_compute_instance_boot_disk_size }} + google_compute_instance_boot_disk_type: ${{ matrix.google_compute_instance_boot_disk_type }} google_compute_instance_data_disk_size: ${{ matrix.google_compute_instance_data_disk_size }} + google_compute_instance_data_disk_type: ${{ matrix.google_compute_instance_data_disk_type }} + google_compute_instance_data_disk_snapshot: ${{ vars.GOOGLE_COMPUTE_INSTANCE_DATA_DISK_SNAPSHOT }} google_application_credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} mithril_api_domain: ${{ matrix.mithril_api_domain }} mithril_image_id: ${{ env.DOCKER_IMAGE_ID }} From eb9a350e162a427b6fcdbe5b937e683c9bcdfc84 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Wed, 24 Jul 2024 16:45:38 +0200 Subject: [PATCH 7/9] fix: data mount sequence not targeting the good disk in infra --- mithril-infra/main.data-disk.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril-infra/main.data-disk.tf b/mithril-infra/main.data-disk.tf index e7d6096a167..f8f8718aa5e 100644 --- a/mithril-infra/main.data-disk.tf +++ b/mithril-infra/main.data-disk.tf @@ -70,7 +70,7 @@ resource "null_resource" "mithril_mount_data_disk" { <<-EOT set -e # Format data disk if necessary -if sudo blkid /dev/sdb; then +if sudo blkid /dev/disk/by-id/google-mithril-data-disk; then echo "Data disk already formatted" else # Format data disk From 68b379cd43ade8cbfc0e6c446294a860b3b34cb1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Tue, 23 Jul 2024 15:54:21 +0200 Subject: [PATCH 8/9] docs: update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5210d36d5f6..a856f48a276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ As a minor extension, we have adopted a slightly different versioning convention - Support for `Cardano node` `9.1.0` in the signer and the aggregator. +- Support better disk configuration in terraform deployments with the CI/CD workflows. + - **UNSTABLE** Cardano transactions certification: - Make Cardano transaction signing settings configurable via the CD. From b7c0427127f8991a5748d192ba47f5aeda26861c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Fri, 26 Jul 2024 09:16:37 +0200 Subject: [PATCH 9/9] chore: bump infra version From '0.2.26' to '0.2.27'. --- mithril-infra/assets/infra.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril-infra/assets/infra.version b/mithril-infra/assets/infra.version index 770cb090ebc..b32698427d6 100644 --- a/mithril-infra/assets/infra.version +++ b/mithril-infra/assets/infra.version @@ -1 +1 @@ -0.2.26 +0.2.27