From 7e452a356902bc4b06c9a3c3b730826769787a56 Mon Sep 17 00:00:00 2001 From: Travis Person Date: Mon, 23 Aug 2021 19:43:11 +0000 Subject: [PATCH] remove chainwatch chainwatch has been removed by lotus https://github.com/filecoin-project/lotus/pull/6912 --- .../group_vars/chainwatch/vars.yml | 2 - .../group_vars/chainwatch/vault.yml | 13 --- .../group_vars/chainwatch/vars.yml | 2 - .../group_vars/chainwatch/vars.yml | 2 - .../group_vars/chainwatch/vault.yml | 13 --- .../group_vars/chainwatch/vars.yml | 2 - .../testnet.fildev.network/hosts.yml | 7 -- .../vagrant/group_vars/chainwatch/vars.yml | 2 - .../vagrant/group_vars/chainwatch/vault.yml | 8 -- ansible/inventories/vagrant/hosts.yml | 5 -- ansible/lotus_devnet_provision.yml | 2 - ansible/lotus_devnet_start.yml | 11 --- ansible/roles/chainwatch/defaults/main.yml | 7 -- ansible/roles/chainwatch/handlers/main.yml | 3 - ansible/roles/chainwatch/tasks/main.yml | 88 ------------------- .../templates/chainwatch.service.j2 | 23 ----- ansible/roles/chainwatch/vars/main.yml | 3 - .../templates/filebeat.yml.j2 | 14 --- .../roles/telegraf/templates/telegraf.conf.j2 | 7 -- ansible/setup_fildev_network.bash | 2 - 20 files changed, 216 deletions(-) delete mode 100644 ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vars.yml delete mode 100644 ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vault.yml delete mode 100644 ansible/inventories/calibration.fildev.network/group_vars/chainwatch/vars.yml delete mode 100644 ansible/inventories/interop.fildev.network/group_vars/chainwatch/vars.yml delete mode 100644 ansible/inventories/interop.fildev.network/group_vars/chainwatch/vault.yml delete mode 100644 ansible/inventories/testnet.fildev.network/group_vars/chainwatch/vars.yml delete mode 100644 ansible/inventories/vagrant/group_vars/chainwatch/vars.yml delete mode 100644 ansible/inventories/vagrant/group_vars/chainwatch/vault.yml delete mode 100644 ansible/roles/chainwatch/defaults/main.yml delete mode 100644 ansible/roles/chainwatch/handlers/main.yml delete mode 100644 ansible/roles/chainwatch/tasks/main.yml delete mode 100644 ansible/roles/chainwatch/templates/chainwatch.service.j2 delete mode 100644 ansible/roles/chainwatch/vars/main.yml diff --git a/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vars.yml b/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vars.yml deleted file mode 100644 index 00fd8ee1b..000000000 --- a/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -chainwatch_golog_file: "/var/log/chainwatch.log" -chainwatch_db: "{{ vault_timescale_conn }}" diff --git a/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vault.yml b/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vault.yml deleted file mode 100644 index 59f7f9c6e..000000000 --- a/ansible/inventories/butterfly.fildev.network/group_vars/chainwatch/vault.yml +++ /dev/null @@ -1,13 +0,0 @@ -$ANSIBLE_VAULT;1.1;AES256 -64383561336663336234636537373839303132633630313633623764366239663562653433393431 -6137373632333661393135323537303038633339306230310a396330393031386433656365306234 -32333665373335663664343066373332666532383465376232303766306463666339356165643964 -6437343135663564390a333338396133353464376361663962623236343663326435666361616563 -32363139316663383362353434373630396164353738316432613031303836646361616635616539 -63623136633532313763376431666333306530633839666531306266373033376333633034386330 -61643735613338363436306234323438613761343262653665363163326464666531663265646136 -66306364336437633132363833346235326639396666356564303261643435393034633966313936 -39626638633637666462623035326366393663356464333534646565623162396461376636643236 -33646362643337663637396339373231366231373866323835323761643634646135663765643638 -34653132613138323437336633376134323765353434373663313731373366306336646165613237 -37346632636262646139 diff --git a/ansible/inventories/calibration.fildev.network/group_vars/chainwatch/vars.yml b/ansible/inventories/calibration.fildev.network/group_vars/chainwatch/vars.yml deleted file mode 100644 index 00fd8ee1b..000000000 --- a/ansible/inventories/calibration.fildev.network/group_vars/chainwatch/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -chainwatch_golog_file: "/var/log/chainwatch.log" -chainwatch_db: "{{ vault_timescale_conn }}" diff --git a/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vars.yml b/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vars.yml deleted file mode 100644 index 00fd8ee1b..000000000 --- a/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -chainwatch_golog_file: "/var/log/chainwatch.log" -chainwatch_db: "{{ vault_timescale_conn }}" diff --git a/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vault.yml b/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vault.yml deleted file mode 100644 index 59f7f9c6e..000000000 --- a/ansible/inventories/interop.fildev.network/group_vars/chainwatch/vault.yml +++ /dev/null @@ -1,13 +0,0 @@ -$ANSIBLE_VAULT;1.1;AES256 -64383561336663336234636537373839303132633630313633623764366239663562653433393431 -6137373632333661393135323537303038633339306230310a396330393031386433656365306234 -32333665373335663664343066373332666532383465376232303766306463666339356165643964 -6437343135663564390a333338396133353464376361663962623236343663326435666361616563 -32363139316663383362353434373630396164353738316432613031303836646361616635616539 -63623136633532313763376431666333306530633839666531306266373033376333633034386330 -61643735613338363436306234323438613761343262653665363163326464666531663265646136 -66306364336437633132363833346235326639396666356564303261643435393034633966313936 -39626638633637666462623035326366393663356464333534646565623162396461376636643236 -33646362643337663637396339373231366231373866323835323761643634646135663765643638 -34653132613138323437336633376134323765353434373663313731373366306336646165613237 -37346632636262646139 diff --git a/ansible/inventories/testnet.fildev.network/group_vars/chainwatch/vars.yml b/ansible/inventories/testnet.fildev.network/group_vars/chainwatch/vars.yml deleted file mode 100644 index 00fd8ee1b..000000000 --- a/ansible/inventories/testnet.fildev.network/group_vars/chainwatch/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -chainwatch_golog_file: "/var/log/chainwatch.log" -chainwatch_db: "{{ vault_timescale_conn }}" diff --git a/ansible/inventories/testnet.fildev.network/hosts.yml b/ansible/inventories/testnet.fildev.network/hosts.yml index 411cbe45b..3d2d50def 100644 --- a/ansible/inventories/testnet.fildev.network/hosts.yml +++ b/ansible/inventories/testnet.fildev.network/hosts.yml @@ -109,7 +109,6 @@ all: children: faucet: stats: - chainwatch: pcr: #### @@ -126,12 +125,6 @@ all: children: toolshed2: - chainwatch: - vars: - ssh_keys_access: "{{ ssh_ops + ssh_lotus + ssh_sentinel | unique }}" - children: - toolshed3: - pcr: vars: ssh_keys_access: "{{ ssh_ops }}" diff --git a/ansible/inventories/vagrant/group_vars/chainwatch/vars.yml b/ansible/inventories/vagrant/group_vars/chainwatch/vars.yml deleted file mode 100644 index ea78a622b..000000000 --- a/ansible/inventories/vagrant/group_vars/chainwatch/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -chainwatch_golog_file: "/var/log/chainwatch.log" -chainwatch_db: "postgres://postgres:protocol@10.10.100.1:15432/chainwatch?sslmode=disable" diff --git a/ansible/inventories/vagrant/group_vars/chainwatch/vault.yml b/ansible/inventories/vagrant/group_vars/chainwatch/vault.yml deleted file mode 100644 index 89fe9af88..000000000 --- a/ansible/inventories/vagrant/group_vars/chainwatch/vault.yml +++ /dev/null @@ -1,8 +0,0 @@ -$ANSIBLE_VAULT;1.1;AES256 -30363737336236663534666461326339623464323935326536626130346336313439633563656534 -3037396633363261656136363537646638613438333163360a633165663164373232653634376563 -32343139643163303763323730326130616538653164653436393166363965653165373535323864 -3364336237653061330a373031626463386663393736643338616530316563376564313661383632 -37313961303830333863393634346431396461633438303639353462383665393066303238356265 -32353165386634363264323161396534396239346661623232356135303137383933303933336334 -656434363362356139633264396333326331 diff --git a/ansible/inventories/vagrant/hosts.yml b/ansible/inventories/vagrant/hosts.yml index e49df5987..3281e57d5 100644 --- a/ansible/inventories/vagrant/hosts.yml +++ b/ansible/inventories/vagrant/hosts.yml @@ -39,7 +39,6 @@ all: children: faucet: stats: - chainwatch: faucet: children: @@ -49,10 +48,6 @@ all: children: toolshed0: - chainwatch: - children: - toolshed0: - preminer: children: t01000: diff --git a/ansible/lotus_devnet_provision.yml b/ansible/lotus_devnet_provision.yml index 482c2c2a5..0a569de98 100644 --- a/ansible/lotus_devnet_provision.yml +++ b/ansible/lotus_devnet_provision.yml @@ -47,8 +47,6 @@ when: "'faucet' in group_names" - include_role: name=stats when: "'stats' in group_names" - - include_role: name=chainwatch - when: "'chainwatch' in group_names" - include_role: name=lotus_pcr when: "'pcr' in group_names" diff --git a/ansible/lotus_devnet_start.yml b/ansible/lotus_devnet_start.yml index 663acee52..295b9fd12 100644 --- a/ansible/lotus_devnet_start.yml +++ b/ansible/lotus_devnet_start.yml @@ -47,17 +47,6 @@ state: started when: start_services|bool -- hosts: chainwatch - become: true - vars: - start_services: true - tasks: - - name: Ensure chainwatch started - service: - name: "chainwatch" - state: started - when: start_services|bool - - hosts: faucet become: true vars: diff --git a/ansible/roles/chainwatch/defaults/main.yml b/ansible/roles/chainwatch/defaults/main.yml deleted file mode 100644 index ae76b46fc..000000000 --- a/ansible/roles/chainwatch/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ -chainwatch_reset: no -chainwatch_db_reset: no -chainwatch_batch_size: 100 -chainwatch_golog_log_fmt: json -chainwatch_golog_log_level: info -chainwatch_env: {} -chainwatch_systemd_extras: {} diff --git a/ansible/roles/chainwatch/handlers/main.yml b/ansible/roles/chainwatch/handlers/main.yml deleted file mode 100644 index ac26e7c79..000000000 --- a/ansible/roles/chainwatch/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: systemd-daemon-reload - systemd: - daemon_reload: yes diff --git a/ansible/roles/chainwatch/tasks/main.yml b/ansible/roles/chainwatch/tasks/main.yml deleted file mode 100644 index 5b6bbad5c..000000000 --- a/ansible/roles/chainwatch/tasks/main.yml +++ /dev/null @@ -1,88 +0,0 @@ -- include_tasks: ../../../includes/required_vars.yml -- include_tasks: ../../../includes/lotus_general_runtime_deps.yml - -- name: Ensure ansible postgresql deps - package: - name: - - python3-psycopg2 - state: present -- name: Reset system - block: - - name: Ensure chainwatch stopped - service: - name: chainwatch - state: stopped - ignore_errors: yes - - name: Truncate log file - shell: - cmd: truncate -s 0 "{{ chainwatch_golog_file }}" - when: chainwatch_reset == "yes" - -- name: Copy binary - copy: - src: "{{ chainwatch_binary_src }}" - dest: /usr/local/bin/chainwatch - owner: root - group: root - mode: "0755" - when: chainwatch_binary_src is defined - -- name: Reset database - block: - - name: Terminate database connections - postgresql_query: - db: "{{ chainwatch_db | urlsplit('path') | basename }}" - port: "{{ chainwatch_db | urlsplit('port') }}" - login_host: "{{ chainwatch_db | urlsplit('hostname') }}" - login_user: "{{ chainwatch_db | urlsplit('username') }}" - login_password: "{{ chainwatch_db | urlsplit('password') }}" - query: "SELECT *, pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = %s;" - positional_args: - - "{{ chainwatch_db | urlsplit('path') | basename }}" - - name: Ensure database dropped - postgresql_db: - name: "{{ chainwatch_db | urlsplit('path') | basename }}" - maintenance_db: "{{ chainwatch_db | urlsplit('path') | basename }}" - port: "{{ chainwatch_db | urlsplit('port') }}" - login_host: "{{ chainwatch_db | urlsplit('hostname') }}" - login_user: "{{ chainwatch_db | urlsplit('username') }}" - login_password: "{{ chainwatch_db | urlsplit('password') }}" - state: absent - when: chainwatch_db_reset == "yes" - -- name: Ensure log file exists - file: - state: touch - path: "{{ chainwatch_golog_file }}" - owner: "{{ lotus_user }}" - group: "{{ lotus_user }}" - mode: "0644" - -- name: Ensure chainwatch database is created - postgresql_db: - name: "{{ chainwatch_db | urlsplit('path') | basename }}" - maintenance_db: "{{ chainwatch_db | urlsplit('path') | basename }}" - port: "{{ chainwatch_db | urlsplit('port') }}" - login_host: "{{ chainwatch_db | urlsplit('hostname') }}" - login_user: "{{ chainwatch_db | urlsplit('username') }}" - login_password: "{{ chainwatch_db | urlsplit('password') }}" - state: present - -- name: Ensure service file - template: - src: ../templates/chainwatch.service.j2 - dest: /etc/systemd/system/chainwatch.service - owner: root - group: root - mode: "0644" - notify: - - systemd-daemon-reload - -- name: Ensure chainwatch enabled - service: - name: chainwatch - enabled: true - -- set_fact: - lotus_chainwatch_telegraf_inputs_procstat: - - "lotus-chainwatch" diff --git a/ansible/roles/chainwatch/templates/chainwatch.service.j2 b/ansible/roles/chainwatch/templates/chainwatch.service.j2 deleted file mode 100644 index dfb04ec99..000000000 --- a/ansible/roles/chainwatch/templates/chainwatch.service.j2 +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Chainwatch -After=network.target -After=lotus-daemon.service -PartOf=lotus-daemon.service - -[Service] -User={{ lotus_user }} -Group={{ lotus_user }} -ExecStart=/usr/local/bin/chainwatch run --max-batch="{{ chainwatch_batch_size }}" -Environment=LOTUS_PATH="{{ lotus_path }}" -Environment=LOTUS_DB="{{ chainwatch_db }}" -Environment=GOLOG_FILE="{{ chainwatch_golog_file }}" -Environment=GOLOG_LOG_FMT="{{ chainwatch_golog_log_fmt }}" -Environment=GOLOG_LOG_LEVEL="{{ chainwatch_golog_log_level }}" -{% for item in chainwatch_env | dict2items -%} -Environment={{ item.key }}="{{ item.value }}" -{% endfor %} -Restart=always -RestartSec=30 - -[Install] -WantedBy=multi-user.target diff --git a/ansible/roles/chainwatch/vars/main.yml b/ansible/roles/chainwatch/vars/main.yml deleted file mode 100644 index 9260f2333..000000000 --- a/ansible/roles/chainwatch/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -required_vars: - - chainwatch_golog_file - - chainwatch_db diff --git a/ansible/roles/filebeat_logz_io/templates/filebeat.yml.j2 b/ansible/roles/filebeat_logz_io/templates/filebeat.yml.j2 index 0036d2021..808fb9a65 100644 --- a/ansible/roles/filebeat_logz_io/templates/filebeat.yml.j2 +++ b/ansible/roles/filebeat_logz_io/templates/filebeat.yml.j2 @@ -1,20 +1,6 @@ ############################# Filebeat ##################################### filebeat.inputs: -{% if 'chainwatch' in group_names %} -- encoding: utf-8 - type: log - fields: - logzio_codec: plain - token: "{{ logz_io_shared_token }}" - type: lotus-chainwatch - paths: - - "{{ chainwatch_golog_file }}" - fields_under_root: true - json.keys_under_root: true - json.message_key: msg - ignore_older: 3h -{% endif %} {% if 'pcr' in group_names %} - encoding: utf-8 type: log diff --git a/ansible/roles/telegraf/templates/telegraf.conf.j2 b/ansible/roles/telegraf/templates/telegraf.conf.j2 index 1148fe99a..9ec70e00f 100644 --- a/ansible/roles/telegraf/templates/telegraf.conf.j2 +++ b/ansible/roles/telegraf/templates/telegraf.conf.j2 @@ -31,9 +31,6 @@ {% if 'stats' in group_names %} lotus_stats = "true" {% endif %} -{% if 'chainwatch' in group_names %} - lotus_chainwatch = "true" -{% endif %} {% if 'pcr' in group_names %} lotus_pcr = "true" {% endif %} @@ -259,10 +256,6 @@ [[inputs.procstat]] systemd_unit = "stats.service" {% endif %} -{% if 'chainwatch' in group_names %} -[[inputs.procstat]] - systemd_unit = "chainwatch.service" -{% endif %} {% if 'pcr' in group_names %} [[inputs.procstat]] systemd_unit = "lotus-pcr.service" diff --git a/ansible/setup_fildev_network.bash b/ansible/setup_fildev_network.bash index 7e0103d69..169dc44c5 100755 --- a/ansible/setup_fildev_network.bash +++ b/ansible/setup_fildev_network.bash @@ -168,9 +168,7 @@ ansible-playbook -i $hostfile lotus_devnet_provision.yml -e lotus_pcr_binary_src="$GOPATH/src/github.com/filecoin-project/lotus/lotus-pcr" \ -e lotus_fountain_binary_src="$GOPATH/src/github.com/filecoin-project/lotus/lotus-fountain" \ -e stats_binary_src="$GOPATH/src/github.com/filecoin-project/lotus/lotus-stats" \ - -e chainwatch_binary_src="$GOPATH/src/github.com/filecoin-project/lotus/lotus-chainwatch" \ -e lotus_reset=yes -e lotus_miner_reset=yes -e stats_reset=yes -e lotus_pcr_reset=yes \ - -e chainwatch_db_reset=no -e chainwatch_reset=yes \ -e certbot_create_certificate=${create_certificate} \ --diff "${ansible_args[@]}"