Remove grpc-balancer.py and update deployment configuration

- Deleted grpc-balancer.py as part of the cleanup process, streamlining the application setup.
- Updated playbook.yml to include new commands for managing the grpcbalancer service and SSL certificate.
- Modified docker-compose.yaml to remove the mounting of the SSL certificate, reflecting the updated deployment strategy.
- Adjusted rebuild.sh to change the working directory to ~/node for consistency in project structure.
This commit is contained in:
vvzvlad
2025-01-20 23:55:26 +03:00
parent 64d57407e0
commit 63e27f31ac
4 changed files with 4 additions and 416 deletions

View File

@ -24,6 +24,9 @@
docker logs infernet-node -f
docker logs --since 10m infernet-node -f
journalctl -u node-checker.service
journalctl -u grpcbalancer.service
nano ~/node/deploy/config.json
docker compose -f deploy/docker-compose.yaml down; docker compose -f deploy/docker-compose.yaml up -d
marker: ""
mode: '0644'
@ -119,7 +122,6 @@
name: web3
extra_args: --break-system-packages
# - name: Install Docker
# ansible.builtin.shell: curl -sL https://get.docker.com | sudo sh -
#
@ -137,9 +139,6 @@
name: docker
state: restarted
#- name: Docker login
# ansible.builtin.shell: docker login -u {{ docker_username }} -p {{ docker_password }}
- name: Docker pull hello-world
ansible.builtin.shell: docker pull ritualnetwork/hello-world-infernet:latest
@ -194,79 +193,6 @@
changed_when: false
- name: Install grpcbalancer dependencies
ansible.builtin.pip:
name:
- grist-api
- flask
- requests
- gunicorn
extra_args: --break-system-packages
- name: Create SSL certificate for grpcbalancer
ansible.builtin.shell: |
mkdir -p /root/node
openssl req -x509 -newkey rsa:4096 -keyout /root/node/key.pem -out /root/node/cert.pem -days 365 -nodes -subj "/CN=localhost"
args:
creates: /root/node/cert.pem
- name: Install SSL certificate to system store
ansible.builtin.shell: |
cp /root/node/cert.pem /usr/local/share/ca-certificates/grpcbalancer.crt
update-ca-certificates
args:
executable: /bin/bash
- name: Copy grpcbalancer service file
ansible.builtin.copy:
dest: /etc/systemd/system/grpcbalancer.service
content: |
[Unit]
Description=GRPC Balancer Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory={{ ansible_env.HOME }}/node
ExecStart=/usr/local/bin/gunicorn --certfile=/root/node/cert.pem --keyfile=/root/node/key.pem -b 0.0.0.0:5000 grpc-balancer:app
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
mode: '0644'
- name: Enable and start node-checker service
ansible.builtin.systemd:
name: grpcbalancer
enabled: yes
state: started
daemon_reload: yes
#- name: Copy grpcbalancer files
# ansible.builtin.shell: |
# cp {{ ansible_env.HOME }}/node/grpcbalancer/grpc-balancer.py /usr/local/bin/
# chmod 755 /usr/local/bin/grpc-balancer.py
# args:
# executable: /bin/bash
#- name: Install grpcbalancer service
# ansible.builtin.shell: |
# cp {{ ansible_env.HOME }}/node/grpcbalancer/grpc-balancer.service /etc/systemd/system/
# chmod 644 /etc/systemd/system/grpc-balancer.service
# args:
# executable: /bin/bash
#- name: Start and enable grpcbalancer service
# ansible.builtin.systemd:
# name: grpc-balancer
# state: started
# enabled: yes
# daemon_reload: yes
- name: Install Forge and Infernet SDK
ansible.builtin.shell: |
rm -rf {{ ansible_env.HOME }}/node/projects/hello-world/contracts/lib/forge-std
@ -283,11 +209,6 @@
args:
chdir: "{{ ansible_env.HOME }}/node"
- name: Update certificates in container
ansible.builtin.shell: docker exec infernet-node update-ca-certificates
args:
executable: /bin/bash
- name: Deploy contracts
ansible.builtin.shell: project=hello-world make deploy-contracts 2>&1
register: contract_deploy_output
@ -319,14 +240,6 @@
until: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" in contract_call_output.stdout'
failed_when: false
# - name: Set Docker containers to restart unless stopped
# ansible.builtin.shell: |
# docker update --restart unless-stopped hello-world
# docker update --restart unless-stopped infernet-node
# docker update --restart unless-stopped deploy-redis-1
# docker update --restart unless-stopped infernet-anvil
# docker update --restart unless-stopped deploy-fluentbit-1
- name: Copy checker service file
ansible.builtin.copy:
dest: /etc/systemd/system/node-checker.service
@ -353,6 +266,3 @@
enabled: yes
state: started
daemon_reload: yes
#- name: Remove docker login credentials
# ansible.builtin.shell: rm -rf /root/.docker/config.json