diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 4b64e67..da49e89 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -6,6 +6,11 @@ - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) - LPS distribution Google spreadsheet URL or CSV file path - Install `zstd` using `sudo apt install zstd` +- laconicd-stack + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull + ``` ## Setup node @@ -57,12 +62,6 @@ - Run the following steps in the machine where genesis file is to be generated -- Fetch Stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - - Run playbook to build laconicd container: ```bash @@ -87,12 +86,6 @@ laconic-so deployment --dir stop ``` -- Fetch the stack in machine where the testnet chain node is running: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - - Run script to export state from testnet chain: ```bash @@ -105,12 +98,6 @@ - Run the following steps in secure machine separate from the one where the node is setup -- Fetch the stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - - Copy over compressed `testnet-state.zst` file to target machine - Set envs: diff --git a/docs/run-validator.md b/docs/run-validator.md index b3a3b9c..03613db 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -4,6 +4,11 @@ - [ansible](playbooks/README.md#ansible-installation) - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) +- laconicd-stack + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull + ``` ## Setup Node @@ -23,12 +28,6 @@ laconic-so deployment --dir stop ``` -- Fetch the stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator. - Copy the example variables file: @@ -141,12 +140,6 @@ - Run the following steps in the machine from where the create-validator transaction is to be signed -- Fetch Stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - - Run playbook to build laconicd container: ```bash @@ -179,12 +172,6 @@ - Run these steps in a secure machine separate from the one where the node is setup -- Fetch the stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - ``` - This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator. - Copy the example variables file: diff --git a/playbooks/first-validator/setup-first-validator.yml b/playbooks/first-validator/setup-first-validator.yml index 3c32bff..830684d 100644 --- a/playbooks/first-validator/setup-first-validator.yml +++ b/playbooks/first-validator/setup-first-validator.yml @@ -8,6 +8,7 @@ mainnet_deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}" spec_file: "{{data_directory}}/laconicd-spec.yml" spec_template: "./templates/specs/spec-template.yml.j2" + build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" tasks: - name: Fail if DATA_DIRECTORY or MAINNET_DEPLOYMENT_DIR env vars are not set fail: @@ -16,9 +17,6 @@ Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook. when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '' - - name: Fetch laconicd stack - shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - - name: Setup required repositories shell: > laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd @@ -26,7 +24,7 @@ - name: Build container images shell: | - laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers --force-rebuild + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }} - name: Create deployment spec file shell: | diff --git a/playbooks/validator/build-laconicd.yml b/playbooks/validator/build-laconicd.yml index de87497..3aeefbe 100644 --- a/playbooks/validator/build-laconicd.yml +++ b/playbooks/validator/build-laconicd.yml @@ -2,12 +2,14 @@ - name: Build Laconicd hosts: localhost connection: local + vars: + build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" tasks: - - name: Fetch repositories - ansible.builtin.shell: - cmd: "laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd setup-repositories --git-ssh --pull" + - name: Setup required repositories + shell: > + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd + setup-repositories --git-ssh --pull - # TODO: Add a flag to control force rebuild - - name: Build containers - ansible.builtin.shell: - cmd: "laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers --force-rebuild" + - name: Build container images + shell: | + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }} diff --git a/playbooks/validator/setup-validator.yml b/playbooks/validator/setup-validator.yml index 703016c..79ac21c 100644 --- a/playbooks/validator/setup-validator.yml +++ b/playbooks/validator/setup-validator.yml @@ -8,6 +8,7 @@ mainnet_deployment_dir: "{{ lookup('env', 'MAINNET_DEPLOYMENT_DIR') }}" spec_file: "{{data_directory}}/laconicd-validator-spec.yml" spec_template: "./templates/specs/spec-template.yml.j2" + build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" tasks: - name: Fail if DATA_DIRECTORY or MAINNET_DEPLOYMENT_DIR env vars are not set fail: @@ -23,9 +24,6 @@ Please set genesis_file and staking_amount_file in validator-vars.yml. when: not genesis_file or not staking_amount_file - - name: Fetch laconicd stack - shell: laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull - - name: Setup required repositories shell: > laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd @@ -33,7 +31,7 @@ - name: Build container images shell: | - laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers --force-rebuild + laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }} - name: Create deployment spec file shell: |