From 71312178e377def02e3b01da9ac6e0a69034914a Mon Sep 17 00:00:00 2001 From: liya2017 Date: Thu, 18 Nov 2021 10:00:52 +0800 Subject: [PATCH] ci: remove benchmark useless code --- .github/actions/terraform/Dockerfile | 9 - .github/actions/terraform/README.md | 47 ----- .github/actions/terraform/action.yml | 14 -- .github/actions/terraform/apply.sh | 6 - .github/actions/terraform/cleanup.sh | 6 - .github/actions/terraform/main.sh | 45 ----- .github/workflows/benchmark.yml | 22 ++- .github/workflows/benchmark/ansible/README.md | 55 ------ .../workflows/benchmark/ansible/ansible.cfg | 4 - ...ChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd | 1 - ...X7xQxHJ2spbpb8uCD89LiCNbFsnFCLBA1Mu9SKgXjo | Bin 32 -> 0 bytes ...iy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX | 1 - .../ansible/files/benchmark-spec.toml | 97 --------- .../ansible/files/process-metrics.py | 31 --- .../workflows/benchmark/ansible/playbook.yml | 80 -------- .../benchmark/ansible/requirements.yml | 6 - .../workflows/benchmark/ansible/vars/all.yml | 34 ---- .../workflows/benchmark/terraform/.gitignore | 4 - .../benchmark/terraform/.terraform.lock.hcl | 42 ---- .../workflows/benchmark/terraform/README.md | 24 --- .github/workflows/benchmark/terraform/ami.tf | 9 - .github/workflows/benchmark/terraform/main.tf | 184 ------------------ .../benchmark/terraform/variables.tf | 61 ------ .../workflows/benchmark/terraform/versions.tf | 7 - devtools/ci/benchmark.sh | 2 +- 25 files changed, 13 insertions(+), 778 deletions(-) delete mode 100644 .github/actions/terraform/Dockerfile delete mode 100644 .github/actions/terraform/README.md delete mode 100644 .github/actions/terraform/action.yml delete mode 100755 .github/actions/terraform/apply.sh delete mode 100755 .github/actions/terraform/cleanup.sh delete mode 100755 .github/actions/terraform/main.sh delete mode 100644 .github/workflows/benchmark/ansible/README.md delete mode 100644 .github/workflows/benchmark/ansible/ansible.cfg delete mode 100644 .github/workflows/benchmark/ansible/files/QmUpChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd delete mode 100644 .github/workflows/benchmark/ansible/files/QmcjX7xQxHJ2spbpb8uCD89LiCNbFsnFCLBA1Mu9SKgXjo delete mode 100644 .github/workflows/benchmark/ansible/files/Qmctiy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX delete mode 100644 .github/workflows/benchmark/ansible/files/benchmark-spec.toml delete mode 100755 .github/workflows/benchmark/ansible/files/process-metrics.py delete mode 100644 .github/workflows/benchmark/ansible/playbook.yml delete mode 100644 .github/workflows/benchmark/ansible/requirements.yml delete mode 100644 .github/workflows/benchmark/ansible/vars/all.yml delete mode 100644 .github/workflows/benchmark/terraform/.gitignore delete mode 100644 .github/workflows/benchmark/terraform/.terraform.lock.hcl delete mode 100644 .github/workflows/benchmark/terraform/README.md delete mode 100644 .github/workflows/benchmark/terraform/ami.tf delete mode 100644 .github/workflows/benchmark/terraform/main.tf delete mode 100644 .github/workflows/benchmark/terraform/variables.tf delete mode 100644 .github/workflows/benchmark/terraform/versions.tf diff --git a/.github/actions/terraform/Dockerfile b/.github/actions/terraform/Dockerfile deleted file mode 100644 index d620894fd9..0000000000 --- a/.github/actions/terraform/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM hashicorp/terraform:0.15.0 - -RUN apk add bash - -COPY main.sh /terraform/main.sh -COPY apply.sh /terraform/apply.sh -COPY cleanup.sh /terraform/cleanup.sh - -ENTRYPOINT [ "/terraform/main.sh" ] diff --git a/.github/actions/terraform/README.md b/.github/actions/terraform/README.md deleted file mode 100644 index 10a9d867de..0000000000 --- a/.github/actions/terraform/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Terraform - -Suppose you have a job that applies AWS resources, runs your tests on these resources, and finally, destroys them whatever succeeded, failed or aborted. You can do this safely by writing Terraform configuration files and passing the directory path. - -This action use [`post`](https://github.com/actions/runner/blob/be9632302ceef50bfb36ea998cea9c94c75e5d4d/docs/adrs/0361-wrapper-action.md) keyword to ensure that clean work always be done. - -# Usage - - -```yaml -- uses: ./.github/actions/terraform - with: - # Required, directory path to Terraform configuration files - terraform_dir: /path/to/terraform/configuration/directory -``` - - -# Examples - -```yaml -# Generate a random SSH key pair to access instances, such as Ansible, via SSH -- run: ssh-keygen -N "" -f ${{ env.PRIVATE_KEY_PATH }} - -- name: Apply Resources - uses: ./.github/actions/terraform - env: - # You may declare Terraform variables in `variables.tf`. - # - # Setting declared variables as environment variables is a common practice. - # - # [Learn more about Terraform variables](https://www.terraform.io/docs/language/values/variables.html#environment-variables) - TF_VAR_access_key: ${{ secrets.AWS_ACCESS_KEY }} - TF_VAR_secret_key: ${{ secrets.AWS_SECRET_KEY }} - TF_VAR_private_key_path: ${{ env.PRIVATE_KEY_PATH }} - TF_VAR_public_key_path: ${{ env.PUBLIC_KEY_PATH }} - TF_VAR_instance_type: t3.micro - with: - terraform_dir: /path/to/terraform/configuration/directory - -- name: Output - working-directory: /path/to/terraform/configuration/directory - run: | - terraform output -raw "" >> /path/to/ansible/inventory-file - -# Ansible-playbook do tests -- run: ansible-playbook playbook.yml -i /path/to/ansible/inventory-file ... -``` diff --git a/.github/actions/terraform/action.yml b/.github/actions/terraform/action.yml deleted file mode 100644 index 1d710361b4..0000000000 --- a/.github/actions/terraform/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Terraform' - -description: 'Apply Terraform defined Infrastructures on-demand, destroy at job end' - -inputs: - terraform_dir: - description: 'Directory path to Terraform configuration files' - required: true - -runs: - using: 'docker' - image: 'Dockerfile' - entrypoint: '/terraform/apply.sh' - post-entrypoint: '/terraform/cleanup.sh' diff --git a/.github/actions/terraform/apply.sh b/.github/actions/terraform/apply.sh deleted file mode 100755 index 95a553b370..0000000000 --- a/.github/actions/terraform/apply.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# Call by action `entrypoint` - -SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -${SCRIPT_PATH}/main.sh apply diff --git a/.github/actions/terraform/cleanup.sh b/.github/actions/terraform/cleanup.sh deleted file mode 100755 index 967733bc43..0000000000 --- a/.github/actions/terraform/cleanup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# Call by action `post_entrypoint` - -SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -${SCRIPT_PATH}/main.sh cleanup diff --git a/.github/actions/terraform/main.sh b/.github/actions/terraform/main.sh deleted file mode 100755 index acad5d38d8..0000000000 --- a/.github/actions/terraform/main.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# Path to location of terraform files -TERRAFORM_DIR=${INPUT_TERRAFORM_DIR:-${TERRAFORM_DIR}} - -function apply_infrastructure () { - cd ${TERRAFORM_DIR} - terraform init - terraform plan - terraform apply -auto-approve -} - -function cleanup_infrastructure () { - cd ${TERRAFORM_DIR} - terraform init - terraform destroy -auto-approve -} - -function cleanup_terraform_footprint () { - rm -rf ${TERRAFORM_DIR}/.terraform - rm -rf ${TERRAFORM_DIR}/terraform.tfstate -} - -function main () { - [ $1 ] || { echo "Wrong usage"; exit 1; } - - local command="${1}" - shift 1 - case ${command} in - apply ) - apply_infrastructure - ;; - cleanup ) - cleanup_infrastructure - cleanup_terraform_footprint - ;; - * ) - echo "Wrong usage"; exit 1; - ;; - esac -} - -main "$@" diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 3b275723de..604e9b1b61 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -4,6 +4,8 @@ on: # Submit your review with a comment body containing "#benchmark" pull_request_review: types: [ submitted ] + push: + branches: ['benchmark_update'] schedule: - cron: '0 0 * * *' # Manurally trigger @@ -14,16 +16,16 @@ jobs: benchmark: name: Benchmark runs-on: ubuntu-latest - if: | - ( - github.event_name == 'pull_request_review' && - contains(github.event.review.body, '#benchmark') - ) || ( - github.event_name == 'schedule' && - github.repository_owner == 'nervosnetwork' - ) || ( - github.event_name == 'workflow_dispatch' - ) + # if: | + # ( + # github.event_name == 'pull_request_review' && + # contains(github.event.review.body, '#benchmark') + # ) || ( + # github.event_name == 'schedule' && + # github.repository_owner == 'nervosnetwork' + # ) || ( + # github.event_name == 'workflow_dispatch' + # ) env: AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} diff --git a/.github/workflows/benchmark/ansible/README.md b/.github/workflows/benchmark/ansible/README.md deleted file mode 100644 index 5b33122632..0000000000 --- a/.github/workflows/benchmark/ansible/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Ansible Playbook Used For Benchmark Workflow - -This Ansible playbook is part of the "Benchmark" workflow. - -## Pre-Install - -``` -ansible-galaxy install -r requirements.yml -``` - -## Inventory File - -To use this playbook, the provided inventory file must have 2 groups of hosts: - * Group "instances" indicates CKB nodes and hosts named by "instance-0", "instance-1" and so on. - - * Group "bastions" indicates CKB-Benchmark nodes, only have one host, named "bastion-0" - -All hosts must have `instance_type` variables, which are used to generate the benchmark report. - -Here is an example: - -```yaml -instances: - hosts: - instance-0: - ansible_user: ubuntu - ansible_host: 1.23.45.123 - instance_type: c5.large - instance-0: - ansible_user: ubuntu - ansible_host: 1.23.45.124 - instance_type: c5.large - -bastions: - hosts: - bastion-0: - ansible_user: ubuntu - ansible_host: 1.23.45.125 - instance_type: t2.large -``` - -## Usage Example - -```bash -export ANSIBLE_INVENTORY= -export ANSIBLE_PRIVATE_KEY_FILE= - -ansible-playbook playbook.yml -e 'hostname=instances' -t ckb_install,ckb_configure -ansible-playbook playbook.yml -e 'hostname=instances' -t ckb_start - -ansible-playbook playbook.yml -e 'hostname=bastions' -t ckb_benchmark_install -ansible-playbook playbook.yml -e 'hostname=bastions' -t ckb_benchmark_prepare -ansible-playbook playbook.yml -e 'hostname=bastions' -t ckb_benchmark_start -ansible-playbook playbook.yml -e 'hostname=bastions' -t process_result -``` diff --git a/.github/workflows/benchmark/ansible/ansible.cfg b/.github/workflows/benchmark/ansible/ansible.cfg deleted file mode 100644 index 09e07747a2..0000000000 --- a/.github/workflows/benchmark/ansible/ansible.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[defaults] -host_key_checking = False -gathering = explicit -timeout = 60 diff --git a/.github/workflows/benchmark/ansible/files/QmUpChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd b/.github/workflows/benchmark/ansible/files/QmUpChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd deleted file mode 100644 index 6d3bcae468..0000000000 --- a/.github/workflows/benchmark/ansible/files/QmUpChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd +++ /dev/null @@ -1 +0,0 @@ -mb\7JS_C&8Pׂ] \ No newline at end of file diff --git a/.github/workflows/benchmark/ansible/files/QmcjX7xQxHJ2spbpb8uCD89LiCNbFsnFCLBA1Mu9SKgXjo b/.github/workflows/benchmark/ansible/files/QmcjX7xQxHJ2spbpb8uCD89LiCNbFsnFCLBA1Mu9SKgXjo deleted file mode 100644 index 0756be230f178955be47540cc52d565ba06c098d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32 ocmazxKEC#L$cOvSW1fjK?QKhqcJyZ0A)lyIygkfRzHVw1011T-cK`qY diff --git a/.github/workflows/benchmark/ansible/files/Qmctiy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX b/.github/workflows/benchmark/ansible/files/Qmctiy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX deleted file mode 100644 index 99cc5060d5..0000000000 --- a/.github/workflows/benchmark/ansible/files/Qmctiy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX +++ /dev/null @@ -1 +0,0 @@ -`&{R}m@g G1t\6Yl \ No newline at end of file diff --git a/.github/workflows/benchmark/ansible/files/benchmark-spec.toml b/.github/workflows/benchmark/ansible/files/benchmark-spec.toml deleted file mode 100644 index e629505ef6..0000000000 --- a/.github/workflows/benchmark/ansible/files/benchmark-spec.toml +++ /dev/null @@ -1,97 +0,0 @@ -name = "ckb_dev" - -[genesis] -version = 0 -parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -timestamp = 0 -compact_target = 0x20010000 -uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -nonce = "0x0" - -[genesis.genesis_cell] -message = "ckb_dev" - -[genesis.genesis_cell.lock] -code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -args = "0x" -hash_type = "data" - -# An array list paths to system cell files, which is absolute or relative to -# the directory containing this config file. -[[genesis.system_cells]] -file = { bundled = "specs/cells/secp256k1_blake160_sighash_all" } -create_type_id = true -capacity = 100_000_0000_0000 -[[genesis.system_cells]] -file = { bundled = "specs/cells/dao" } -create_type_id = true -capacity = 16_000_0000_0000 -[[genesis.system_cells]] -file = { bundled = "specs/cells/secp256k1_data" } -create_type_id = false -capacity = 1_048_617_0000_0000 -[[genesis.system_cells]] -file = { bundled = "specs/cells/secp256k1_blake160_multisig_all" } -create_type_id = true -capacity = 100_000_0000_0000 - -[genesis.system_cells_lock] -code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -args = "0x" -hash_type = "data" - -# Dep group cells -[[genesis.dep_groups]] -name = "secp256k1_blake160_sighash_all" -files = [ - { bundled = "specs/cells/secp256k1_data" }, - { bundled = "specs/cells/secp256k1_blake160_sighash_all" }, -] -[[genesis.dep_groups]] -name = "secp256k1_blake160_multisig_all" -files = [ - { bundled = "specs/cells/secp256k1_data" }, - { bundled = "specs/cells/secp256k1_blake160_multisig_all" }, -] - -# For first 11 block -[genesis.bootstrap_lock] -code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -args = "0x" -hash_type = "type" - -# Burn -[[genesis.issued_cells]] -capacity = 8_400_000_000_00000000 -lock.code_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -lock.args = "0x62e907b15cbf27d5425399ebf6f0fb50ebb88f18" -lock.hash_type = "data" - -# issue for random generated private key: d00c06bfd800d27397002dca6fb0993d5ba6399b4238b2f29ee9deb97593d2bc -[[genesis.issued_cells]] -capacity = 20_000_000_000_00000000 -lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -lock.args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" -lock.hash_type = "type" - -# issue for random generated private key: 63d86723e08f0f813a36ce6aa123bb2289d90680ae1e99d4de8cdb334553f24d -[[genesis.issued_cells]] -capacity = 5_198_735_037_00000000 -lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -lock.args = "0x470dcdc5e44064909650113a274b3b36aecb6dc7" -lock.hash_type = "type" - -[params] -initial_primary_epoch_reward = 11_917_808_219178080 -secondary_epoch_reward = 613_698_63013698 -max_block_cycles = 100_000_000_000 -cellbase_maturity = 0 -primary_epoch_reward_halving_interval = 8760 -epoch_duration_target = 14400 -genesis_epoch_length = 1000 -# For development and testing purposes only. -# Keep difficulty be permanent if the pow is Dummy. (default: false) -# permanent_difficulty_in_dummy = true - -[pow] -func = "Dummy" diff --git a/.github/workflows/benchmark/ansible/files/process-metrics.py b/.github/workflows/benchmark/ansible/files/process-metrics.py deleted file mode 100755 index 3582767f0a..0000000000 --- a/.github/workflows/benchmark/ansible/files/process-metrics.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 - -# Usage: `./process-metrics.py metrics.json` - -import os -import sys -import json -import yaml - -INSTANCE_TYPE = os.getenv("INSTANCE_TYPE") -INSTANCE_BASTION_TYPE = os.getenv("INSTANCE_BASTION_TYPE") - - -def rewrite_metric(metric): - # Construct new metric - metric["instance_type"] = INSTANCE_TYPE - metric["instance_bastion_type"] = INSTANCE_BASTION_TYPE - return metric - - -def main(): - metrics = [] - for line in open(sys.argv[1]): - metric = json.loads(line) - metric = rewrite_metric(metric) - metrics.append(metric) - - print(yaml.dump(metrics)) - - -main() diff --git a/.github/workflows/benchmark/ansible/playbook.yml b/.github/workflows/benchmark/ansible/playbook.yml deleted file mode 100644 index dd19bd988b..0000000000 --- a/.github/workflows/benchmark/ansible/playbook.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -- hosts: "{{ hostname }}" - gather_facts: yes - tasks: - - include_vars: vars/all.yml - tags: [ always ] - - name: Operate CKB Via Ansible-CKB - include_role: - name: ansible-ckb - public: false - tags: - - ckb_install - - ckb_configure - - ckb_restart - - ckb_start - - ckb_stop - - ckb_status - - ckb_miner_restart - - ckb_miner_start - - ckb_miner_stop - - - name: Install And Configure CKB Benchmark Via Ansible-CKB-Benchmark - include_role: - name: ansible-ckb-benchmark - public: false - tags: - - ckb_benchmark_setup - - ckb_benchmark_install - - - name: Set Facts - `ckb_urls` - block: - - name: Set Facts - Declare `ckb_urls` - set_fact: - ckb_urls: [] - - name: Set Facts - Extend `ckb_urls` - vars: - ckb_port: "{{ hostvars[item].ckb_rpc_listen_address | default(ckb_rpc_listen_address) | regex_replace(\".*:\", \"\")}}" - ckb_host: "{{ hostvars[item].ansible_host }}" - ckb_url: "http://{{ ckb_host }}:{{ ckb_port }}" - set_fact: - ckb_urls: "{{ ckb_urls + [ ckb_url ] }}" - with_items: "{{ groups.instances }}" - tags: - - ckb_benchmark_prepare - - ckb_benchmark_start - - # NOTE: It seems bug that when uses `include_role` inside block statement, - # tags cannot pass through properly. So please do not put - # `include_role` inside block statement. - - name: Start CKB Benchmark - vars: - ckb_benchmark_rpc_urls: "{{ ckb_urls }}" - include_role: - name: ansible-ckb-benchmark - public: false - tags: - - ckb_benchmark_prepare - - ckb_benchmark_start - - - name: Fetch CKB Benchmark Logfiles - become: true - fetch: - flat: true - src: "{{ item.src }}" - dest: "{{ item.dest }}" - with_items: - - { src: "/var/lib/ckb-benchmark/data/ckb-bench.json", dest: "ckb-bench.json" } - - { src: "/var/lib/ckb-benchmark/data/ckb-bench.log", dest: "ckb-bench.log" } - tags: - - process_result - - - name: Process TPS-Bench Result `metrics.yml` - run_once: true - delegate_to: localhost - environment: - INSTANCE_TYPE: "{{ hostvars['instance-0'].instance_type }}" - INSTANCE_BASTION_TYPE: "{{ hostvars['bastion-0'].instance_type }}" - shell: ./files/process-metrics.py ckb-bench.json > report.yml - tags: - - process_result diff --git a/.github/workflows/benchmark/ansible/requirements.yml b/.github/workflows/benchmark/ansible/requirements.yml deleted file mode 100644 index 0718aca618..0000000000 --- a/.github/workflows/benchmark/ansible/requirements.yml +++ /dev/null @@ -1,6 +0,0 @@ -- src: https://github.com/keroro520/ansible-ckb - scm: git - version: main -- src: https://github.com/keroro520/ansible-ckb-benchmark - scm: git - version: main diff --git a/.github/workflows/benchmark/ansible/vars/all.yml b/.github/workflows/benchmark/ansible/vars/all.yml deleted file mode 100644 index 7d695ea4ef..0000000000 --- a/.github/workflows/benchmark/ansible/vars/all.yml +++ /dev/null @@ -1,34 +0,0 @@ -# TODO elegent way to assign bootnodes list - - -# ansible-ckb variables -ckb_workspace: "/var/lib/ckb" -ckb_data_dir: "{{ ckb_workspace }}/data" -secret_keys: - instance-0: "QmUpChEcQwBcnhTqoNXxynW2B4hNq9R2USgWZKHUnkWdGd" - instance-1: "QmcjX7xQxHJ2spbpb8uCD89LiCNbFsnFCLBA1Mu9SKgXjo" - instance-2: "Qmctiy6jRrpZnf7SCWjCskwetwKroW7bhZJc28PydsBevX" -ckb_network_secret_key: "{{ secret_keys[inventory_hostname] | default('') }}" -ckb_network_bootnodes: - - "/ip4/{{ hostvars['instance-0'].ansible_host }}/tcp/8115/p2p/{{ secret_keys['instance-0'] }}" -ckb_network_bootnode_mode: "true" -ckb_rpc_listen_address: "0.0.0.0:8114" -ckb_tx_pool_max_mem_size: "40_000_000" -ckb_tx_pool_max_cycles: "400_000_000_000" -ckb_tx_pool_min_fee_rate: "0" -ckb_chain_spec_file: "benchmark-spec.toml" - -# ansible-ckb miner variables -ckb_block_assembler: - key: "98400f6a67af07025f5959af35ed653d649f745b8f54bf3f07bef9bd605ee946" - code_hash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" - args: "0x8883a512ee2383c01574a328f60eeccbb4d78240" - hash_type: "type" - message: "0x" -ckb_miner_workers: - - worker_type: "Dummy" - delay_type: "Constant" - value: 500 - -# ansible-ckb-benchmark variables -ckb_benchmark_owner_privkey: "{{ ckb_block_assembler.key }}" diff --git a/.github/workflows/benchmark/terraform/.gitignore b/.github/workflows/benchmark/terraform/.gitignore deleted file mode 100644 index dbf7ead575..0000000000 --- a/.github/workflows/benchmark/terraform/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.terraform -/terraform.tfstate -/terraform.tfstate.backup -/terraform.tfvars diff --git a/.github/workflows/benchmark/terraform/.terraform.lock.hcl b/.github/workflows/benchmark/terraform/.terraform.lock.hcl deleted file mode 100644 index 8334cdf136..0000000000 --- a/.github/workflows/benchmark/terraform/.terraform.lock.hcl +++ /dev/null @@ -1,42 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "2.70.0" - constraints = "~> 2.53" - hashes = [ - "h1:mM6eIaG1Gcrk47TveViXBO9YjY6nDaGukbED2bdo8Mk=", - "zh:01a5f351146434b418f9ff8d8cc956ddc801110f1cc8b139e01be2ff8c544605", - "zh:1ec08abbaf09e3e0547511d48f77a1e2c89face2d55886b23f643011c76cb247", - "zh:606d134fef7c1357c9d155aadbee6826bc22bc0115b6291d483bc1444291c3e1", - "zh:67e31a71a5ecbbc96a1a6708c9cc300bbfe921c322320cdbb95b9002026387e1", - "zh:75aa59ae6f0834ed7142c81569182a658e4c22724a34db5d10f7545857d8db0c", - "zh:76880f29fca7a0a3ff1caef31d245af2fb12a40709d67262e099bc22d039a51d", - "zh:aaeaf97ffc1f76714e68bc0242c7407484c783d604584c04ad0b267b6812b6dc", - "zh:ae1f88d19cc85b2e9b6ef71994134d55ef7830fd02f1f3c58c0b3f2b90e8b337", - "zh:b155bdda487461e7b3d6e3a8d5ce5c887a047e4d983512e81e2c8266009f2a1f", - "zh:ba394a7c391a26c4a91da63ad680e83bde0bc1ecc0a0856e26e9d62a4e77c408", - "zh:e243c9d91feb0979638f28eb26f89ebadc179c57a2bd299b5729fb52bd1902f2", - "zh:f6c05e20d9a3fba76ca5f47206dde35e5b43b6821c6cbf57186164ce27ba9f15", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "2.1.2" - constraints = "~> 2.1" - hashes = [ - "h1:l0/ASa/TB1exgqdi33sOkFakJL2zAQBu+q5LgO5/SxI=", - "zh:0cc7236c1fbf971b8bad1540a7d0c5ac4579248239fd1034c023b0b660a8d1d5", - "zh:16fc2d9b10cf9e5123bf956e7032c338cc93a03be1ca2e9f3d3b7014c0e866c7", - "zh:1e26465ff40ded59cef1a9e745752eef9744471e69094d12f8bc40a060e8cdb9", - "zh:3c7afd28076245f455d4348af6c124b73409722be4a73680d4e4709a4f25ea91", - "zh:4190a92567efaa444527f19b28d65fac1a01aeba907013b5dceacd9ba2a23709", - "zh:677963437316b088fc1aac70fe7d608d2917c46530c4a25ec86a43e9acaf2811", - "zh:69fe15f6b851ff82700bc749c50a9299770515617e677c18cba2cb697daaff36", - "zh:6b505cc60cc1494e1cab61590bca127b06dd894d0b2a7dcacd23862bce1f492b", - "zh:719aa11ad7be974085af595089478eb24d5a021bc7b08364fa6745d9eb473dac", - "zh:7375b02189e14efbfaab994cd05d81e3ff8e46041fae778598b3903114093a3e", - "zh:c406573b2084a08f8faa0451923fbeb1ca6c5a5598bf039589ec2db13aacc622", - "zh:fb11299a3b20711595713d126abbbe78c554eb5995b02db536e9253686798fb6", - ] -} diff --git a/.github/workflows/benchmark/terraform/README.md b/.github/workflows/benchmark/terraform/README.md deleted file mode 100644 index 7112dca3a7..0000000000 --- a/.github/workflows/benchmark/terraform/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Terraform Configuration Files Used For Benchmark Workflow - -These Terraform configuration files are part of the ["Benchmark" workflow](../../benchmark.yml). - -## AMI - -Read [`ami.tf`](./ami.tf) - -## Variables - -Read [`variables.tf`](./variables.tf) - -## Resources - -All resources are named with prefix [`var.prefix`](./variables.tf#L33) - -* 1 bastion node named `"bastion-0"` -* [`var.instances_count`](./variables.tf#L17) instances nodes named `"instance-*"` -* `aws_vpc` -* `aws_key_pair` - -## Outputs - -* [`ansible_hosts`](./main.tf#L161) diff --git a/.github/workflows/benchmark/terraform/ami.tf b/.github/workflows/benchmark/terraform/ami.tf deleted file mode 100644 index 74c5ce68c2..0000000000 --- a/.github/workflows/benchmark/terraform/ami.tf +++ /dev/null @@ -1,9 +0,0 @@ -data "aws_ami" "ubuntu" { - most_recent = true - owners = ["099720109477"] # Canonical - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] - } -} diff --git a/.github/workflows/benchmark/terraform/main.tf b/.github/workflows/benchmark/terraform/main.tf deleted file mode 100644 index 233f4419d2..0000000000 --- a/.github/workflows/benchmark/terraform/main.tf +++ /dev/null @@ -1,184 +0,0 @@ -provider "aws" { - region = var.region - access_key = var.access_key - secret_key = var.secret_key -} - -resource "aws_vpc" "vpc" { - cidr_block = "10.0.0.0/16" - enable_dns_hostnames = true - tags = { - Name = "${var.prefix}-vpc" - } -} - -resource "aws_subnet" "subnet" { - vpc_id = aws_vpc.vpc.id - cidr_block = "${var.private_ip_prefix}.0/24" - map_public_ip_on_launch = true - tags = { - Name = "${var.prefix}-subnet" - } -} - -resource "aws_internet_gateway" "ig" { - vpc_id = aws_vpc.vpc.id - tags = { - Name = "${var.prefix}-ig" - } -} - -resource "aws_route" "internet_access" { - route_table_id = aws_vpc.vpc.main_route_table_id - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.ig.id -} - -resource "aws_key_pair" "ssh" { - key_name = "${var.prefix}-ssh_key" - public_key = file(var.public_key_path) -} - -resource "aws_security_group" "sg_bastion" { - name = "${var.prefix}-sg_bastion" - vpc_id = aws_vpc.vpc.id - - ingress { - description = "ssh" - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - description = "all inbound from anywhere" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - description = "all outbound to anywhere" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_instance" "bastion" { - key_name = aws_key_pair.ssh.id - instance_type = var.instance_type_bastion - ami = data.aws_ami.ubuntu.id - vpc_security_group_ids = [aws_security_group.sg_bastion.id] - private_ip = var.private_ip_bastion - subnet_id = aws_subnet.subnet.id - - root_block_device { - volume_size = "60" - } - - connection { - type = "ssh" - host = aws_instance.bastion.public_ip - user = var.username - private_key = file(var.private_key_path) - } - - provisioner "remote-exec" { - inline = [ - "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done", - ] - } - - tags = { - Name = "${var.prefix}-bastion" - } -} - -resource "aws_security_group" "sg_default" { - name = "${var.prefix}-sg-default" - description = "Allow inbound access from anywhere and outbound access to all" - vpc_id = aws_vpc.vpc.id - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_instance" "instance" { - count = var.instances_count - key_name = aws_key_pair.ssh.id - instance_type = var.instance_type - ami = data.aws_ami.ubuntu.id - vpc_security_group_ids = [aws_security_group.sg_default.id] - private_ip = "${var.private_ip_prefix}.${count.index + 100}" - subnet_id = aws_subnet.subnet.id - - root_block_device { - volume_size = "60" - } - - tags = { - Name = "${var.prefix}-instance-${count.index}" - Index = "${count.index}" - } -} - -resource "null_resource" "instance_provisioners" { - count = var.instances_count - - triggers = { - cluster_instance_ids = join(",", aws_instance.instance.*.id) - } - - connection { - bastion_host = aws_instance.bastion.public_ip - host = element(aws_instance.instance.*.private_ip, count.index) - user = var.username - private_key = file(var.private_key_path) - } - - provisioner "remote-exec" { - inline = [ - "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done", - ] - } -} - -output "ansible_hosts" { - value = <