Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace update.sh with an external dependency #109

Closed
joaosa opened this issue Nov 15, 2022 · 3 comments · Fixed by #168
Closed

Replace update.sh with an external dependency #109

joaosa opened this issue Nov 15, 2022 · 3 comments · Fixed by #168
Labels
enhancement New feature or request

Comments

@joaosa
Copy link
Contributor

joaosa commented Nov 15, 2022

The less code we have to maintain, the less complexity we have to focus on and the better it will be on the long run.

This principle can be applied to update.sh which can be replaced by watchtower, for instance.

Since we can't have all nodes rebooting at the same time, as that would kill the network, we can use lifecycle hooks to wait a random time, as it is currently done here.

This guide offers a good way to get started. This is another good ref.

One should note that watchtower does not support rollbacks. Doing so would be ideal, as per this issue.

@joaosa joaosa added the enhancement New feature or request label Nov 17, 2022
@vorburger
Copy link
Contributor

One should note that watchtower containrrr/watchtower#90. Doing so would be ideal, as per #32.

I think that is an "orthogonal" issue - you probably (I haven't tried it) COULD already replace the update.sh script "as-is" with Watchtower, and just --stop-timeout 900, to replicate this...

... and then, in a future next step, you (probably, TBD) can somehow get Watchtower to attempt a "roling update", perhaps with this and/or this? (Their doc isn't clear if and how exactly they support it, at least to me.) But perhaps this would be easier if the container first had #124 and #125?

@joaosa
Copy link
Contributor Author

joaosa commented Dec 2, 2022

One should note that watchtower containrrr/watchtower#90. Doing so would be ideal, as per #32.

I think that is an "orthogonal" issue - you probably (I haven't tried it) COULD already replace the update.sh script "as-is" with Watchtower, and just --stop-timeout 900, to replicate this...

yeah you're absolutely right! These are orthogonal issues.

... and then, in a future next step, you (probably, TBD) can somehow get Watchtower to attempt a "roling update", perhaps with this and/or this? (Their doc isn't clear if and how exactly they support it, at least to me.) But perhaps this would be easier if the container first had #124 and #125?

that sounds like a good approach. thank you for looking it up :)

@AnomalRoil
Copy link
Contributor

AnomalRoil commented Jan 4, 2023

FYI, I've successfully setup my node with automatic updates through Watchtower using the following docker-compose.yml file:

version: "3.8"
services:
  saturn-node:
    image: ghcr.io/filecoin-saturn/l1-node:main
    container_name: saturn_node
    restart: always
    environment:
      SATURN_NETWORK: "main"
      FIL_WALLET_ADDRESS: "YOUR FIL ADDRESS"
      NODE_OPERATOR_EMAIL: "YOUR EMAIL"
      SPEEDTEST_SERVER_CONFIG: "--server-id=ID OF THE CLOSEST SPEEDTEST SERVER"
    ulimits:
        nofile:
          soft: 65536
          hard: 65536
    ports:
      - 80:80
      - 443:443
    network_mode: host
    stop_signal: SIGTERM
    stop_grace_period: 30m
    labels:
      com.centurylinklabs.watchtower.lifecycle.pre-update-timeout: 30
      com.centurylinklabs.watchtower.lifecycle.post-update-timeout: 30
    volumes:
      - saturn_data:/usr/src/app/shared

  watchtower:
      image: containrrr/watchtower
      environment:
        WATCHTOWER_POLL_INTERVAL: 10800
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock

volumes:
  saturn_data:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/srv/saturn-data'

Note how I'm using stop_signal and stop_grace_period instead of the update.sh script.

AnomalRoil added a commit to AnomalRoil/L1-node that referenced this issue Jan 11, 2023
AnomalRoil added a commit to AnomalRoil/L1-node that referenced this issue Jan 11, 2023
@joaosa joaosa closed this as completed in df19399 Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants