node icon indicating copy to clipboard operation
node copied to clipboard

Not able to build zeta-chain node

Open nebojsa-ristovic opened this issue 1 year ago • 10 comments

Describe the Bug When I run docker build . -f Dockerfile

[+] Building 1.2s (12/20)
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                      0.0s
 => => transferring dockerfile: 2.34kB                                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                         0.0s
 => => transferring context: 230B                                                                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/golang:1.22-alpine3.18                                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:3.18                                                                                                                                                                                            0.0s
 => [internal] load build context                                                                                                                                                                                                                         0.8s
 => => transferring context: 17.26MB                                                                                                                                                                                                                      0.8s
 => [builder 1/8] FROM docker.io/library/golang:1.22-alpine3.18                                                                                                                                                                                           0.0s
 => [stage-1 1/7] FROM docker.io/library/alpine:3.18                                                                                                                                                                                                      0.0s
 => CACHED [builder 2/8] RUN apk --no-cache add git make build-base jq openssh libusb-dev linux-headers bash curl python3 py3-pip                                                                                                                         0.0s
 => CACHED [builder 3/8] WORKDIR /go/delivery/zeta-node                                                                                                                                                                                                   0.0s
 => CACHED [builder 4/8] COPY go.mod .                                                                                                                                                                                                                    0.0s
 => CACHED [builder 5/8] COPY go.sum .                                                                                                                                                                                                                    0.0s
 => ERROR [builder 6/8] RUN go mod download                                                                                                                                                                                                               0.4s
------
 > [builder 6/8] RUN go mod download:
#14 0.292 go: go.mod requires go >= 1.22.7 (running go 1.22.3; GOTOOLCHAIN=local)
------
executor failed running [/bin/sh -c go mod download]: exit code: 1

It's expected for image to be built.

Building on macOS Sonoma Version 14.5

p.s. It's the same issue from your github action - https://github.com/zeta-chain/node/actions/runs/12237577778/job/34133645670

nebojsa-ristovic avatar Dec 18 '24 12:12 nebojsa-ristovic

https://github.com/zeta-chain/zetacored-docker is our actively supported way of running zetacored in docker.

I can fix this up if you really need it. What do you use to automate the upgrades?

gartnera avatar Dec 18 '24 20:12 gartnera

https://github.com/zeta-chain/zetacored-docker is our actively supported way of running zetacored in docker.

I can fix this up if you really need it. What do you use to automate the upgrades?

This would be much needed for us, so our nodes can run. We don't use anything to automate upgrade unfortunately. zetacored-docker is not working for us since it's wiping disk and downloading full node snapshot and we run archive nodes.

nebojsa-ristovic avatar Dec 19 '24 06:12 nebojsa-ristovic

zetacored-docker is not working for us since it's wiping disk and downloading full node snapshot and we run archive nodes.

You set ZETACHAIN_SNAPSHOT_TYPE=archive and mount a persistent volume on /root?

gartnera avatar Dec 19 '24 15:12 gartnera

zetacored-docker is not working for us since it's wiping disk and downloading full node snapshot and we run archive nodes.

You set ZETACHAIN_SNAPSHOT_TYPE=archive and mount a persistent volume on /root?

But it would still download snapshot every time, right? And for archive node it's 5Tb. Not sure for mounting persistent disk on /root, who this will effect nodedata, it'll be persistet, but wiping and snapshot download would be still present?

nebojsa-ristovic avatar Dec 20 '24 10:12 nebojsa-ristovic

But it would still download snapshot every time, right?

If the snapshot restore completes it will not be restored again so long as you have a persistent volume mounted on /root.

I did attempt to test archive snapshot restore yesterday. It did end up failing around ~1TB, I think there are some issues with cloudflare and range headers.

gartnera avatar Dec 20 '24 18:12 gartnera

Cool, we'll try this out. But is there a change you can provide image earlier on the dockerhub so we have nodes running until we switch to zetacored-docker?

nebojsa-ristovic avatar Dec 21 '24 20:12 nebojsa-ristovic

My recommendation for now would be to just bind mount the v24 binary in your existing setup (or use your current workaround), and then complete the following procedure to migrate to zetacored-docker.

To migrate, you would need to perform the following procedure to bypass the snapshot download, inserting your own existing node data:

  • Set environment variables:
    • MONIKER=WhateverYouLike (required)
    • ZETACHAIN_SNAPSHOT_TYPE=archive (it will otherwise default to fullnode)
  • Start the container, but prepare to stop it again shortly in the next step.
  • Stop the container after /root/init_started appears, which should happen quickly.
  • Copy the empty file /root/init_started to /root/init_completed. This presence of these two empty files indicate that the container is completely set up, which prevents snapshot redownload.
  • Copy /root/.zetacored/data from your existing archive node to /root/.zetacored/data in your new node.
  • Start the container

One of the key features of zetacored-docker is that it automatically will handle mandatory zetacored software upgrades by leveraging a pre-configured cosmovisor.

CryptoFewka avatar Dec 24 '24 16:12 CryptoFewka

@nebojsa-ristovic, were you able to complete the migration to zetacored-docker?

CryptoFewka avatar Jan 06 '25 21:01 CryptoFewka

Hi @CryptoFewka We did not do it yet but plan to tackle PoC next week.

One concern we have is that we have a process running in our cluster which is downloading unknown executables automatically and running them - that is a compliance nightmare for us and might prevent us from going this route. Ideally, we would have options to go with comsovisor OR zetacored docker container we can manage using standardized container lifecycle.

jajaislanina avatar Jan 10 '25 11:01 jajaislanina

downloading unknown executables

I wouldn't describe the software updates as "unknown". It's not like someone can just push and run arbitrary executables on your system. When a software upgrade is proposed on chain, you have plenty of time to ensure it's validity.

All the binaries in our software upgrade proposals have checksums that you can independently verify by running make release-build. The checksum of your local build will match what's in the software upgrade proposal.

We also use actions/attest-build-provenance to attest that the release binaries were build by github actions rather than by a user manually.

Ideally, we would have options to go with comsovisor OR zetacored docker container we can manage using standardized container lifecycle.

Nothing prevents you from building your own image. But we do have a really hard time supporting things that we do not run ourselves. We don't notice when the old docker workflow was broken because we ourselves do not use it.

For reference, here is exactly what we run and how we run it:

  • pruned fullnodes running in kubernetes via zetacored-docker which are fully automated and we never touch.
  • archive nodes running on bare metal servers via systemd services. We manually push out new binaries with ansible.
  • validator nodes which run on AWS VMs. We manually push out new binaries with ansible.

gartnera avatar Jan 10 '25 18:01 gartnera