Chia-Network / chia-operator

A Kubernetes operator for Chia
Apache License 2.0
2 stars 0 forks source link

Where to run `chia plotnft show`? #113

Open skandragon opened 1 month ago

skandragon commented 1 month ago

If this runs on the wallet pod, it seems like it cannot connect to the farmer.

If I run this on the farmer pod, it seems like it cannot connect to the wallet.

Am I missing some config? If not, is there a good place to run commands that can talk to all of the components, especially when a command might need two of them to do its job?

~: kubectl -n chia get pods
NAME                                 READY   STATUS      RESTARTS   AGE
mainnet-ca-chiaca-generator-fmgxq    0/1     Completed   0          11h
mainnet-farmer-6d4d676887-xntt6      1/1     Running     0          11h
mainnet-harvester-5d85ffb6d5-5spgs   1/1     Running     0          10h
mainnet-node-0                       1/1     Running     0          11h
mainnet-wallet-866dbfbbd7-4lj2f      1/1     Running     0          10h

~: kubectl -n chia get svc
NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGE
mainnet-farmer              ClusterIP   10.106.213.187   <none>        8447/TCP    11h
mainnet-farmer-daemon       ClusterIP   10.97.57.152     <none>        55400/TCP   11h
mainnet-farmer-metrics      ClusterIP   10.106.149.188   <none>        9914/TCP    11h
mainnet-farmer-rpc          ClusterIP   10.105.112.29    <none>        8559/TCP    11h
mainnet-harvester           ClusterIP   10.103.91.21     <none>        8448/TCP    10h
mainnet-harvester-daemon    ClusterIP   10.98.59.197     <none>        55400/TCP   10h
mainnet-harvester-metrics   ClusterIP   10.99.129.43     <none>        9914/TCP    10h
mainnet-harvester-rpc       ClusterIP   10.106.114.2     <none>        8560/TCP    10h
mainnet-node                ClusterIP   10.102.209.32    <none>        8444/TCP    11h
mainnet-node-daemon         ClusterIP   10.106.214.158   <none>        55400/TCP   11h
mainnet-node-headless       ClusterIP   None             <none>        8444/TCP    11h
mainnet-node-internal       ClusterIP   10.100.180.62    <none>        8444/TCP    11h
mainnet-node-metrics        ClusterIP   10.99.180.121    <none>        9914/TCP    11h
mainnet-node-rpc            ClusterIP   10.101.89.150    <none>        8555/TCP    11h
mainnet-wallet              ClusterIP   10.102.66.30     <none>        8449/TCP    10h
mainnet-wallet-daemon       ClusterIP   10.100.71.172    <none>        55400/TCP   10h
mainnet-wallet-metrics      ClusterIP   10.105.118.42    <none>        9914/TCP    10h
mainnet-wallet-rpc          ClusterIP   10.107.207.229   <none>        9256/TCP    10h
Starttoaster commented 1 month ago

This is an interesting Issue, and can confirm that it seems like you can't run that command in the operator's context of separate Pods for each specific Chia service. In the short term, I'd say that the place you should run that command is on a local Chia installation. In the longer term, I'm asking around to see if it makes sense to add a farmer/wallet peer option to the chia config, which this operator could then leverage.

skandragon commented 1 month ago

Going forward, I'd love two additional components:

  1. A client config tool. I know this may be out of bounds, but what I'd like to do is "given my cluster and these endpoints, make a client config that will use that cluster's endpoints"
  2. A pod that uses that config that I can deploy using another CRD, where I can run all the chia commands to manage the cluster's resources. I understand there are limitations here as PVCs would need to be created and mounted out of band, but generally "what is my status" should be something this pod can run.

Ideally, I could also point the GUI MacOS client to this cluster and have it also show me status.

Starttoaster commented 1 month ago

A client config tool. I know this may be out of bounds, but what I'd like to do is "given my cluster and these endpoints, make a client config that will use that cluster's endpoints"

Yeah, that seems like a different project from this entirely. Also probably a different Issue than this entirely. :) But it would maybe be cool to do a PoC on setting up a remote GUI, and writing matching documentation, that points to the deployed infrastructure in k8s.

A pod that uses that config that I can deploy using another CRD, where I can run all the chia commands to manage the cluster's resources. I understand there are limitations here as PVCs would need to be created and mounted out of band, but generally "what is my status" should be something this pod can run.

I don't think that will be planned by this project. The scope of this project has always been to be able to set up some sane and well-managed Chia components as infrastructure in a kubernetes cluster. I would rather people have a separate installation of Chia, either not managed by this operator or outside of kubernetes entirely, for running multiple Chia services on one localhost. Running Chia services as infrastructure implying the lack of need for running commands in the container almost entirely. I'll sometimes exec into my ChiaWallet Pods to send XCH around, or run a chia show -s in my ChiaNode Pods, to give a few examples of exceptions to that general rule.

skandragon commented 1 month ago

True, connecting a GUI up for some real-time inspection is beyond the goal of this project, but it does raise the question, "how do you know it's working?" Even in distributed infrastructure, one usually has a way to query the services running there. It doesn't have to be a GUI, but the standard "chia" command suite also cannot really do this from what I can tell. Perhaps it can and I'm too new to the way the system works.

From my short-term understanding, there is a "daemon" that really acts kinda like a router and kinda like a discovery system. I would assume that there would be only one daemon and everything would chat with it, but it seems like each component (farmer, etc) all run their own daemons.

As the GUI has a place for "the daemon", as seemingly does the rest of the system, I'm not sure what "the daemon" is exactly. This assumes I can even expose port 55400 effectively.

What I'm trying to build here on top of this operator is a system where I can plot, upload to the PVC, and map that PVC into a harvester. But, while I have a small set of plots (4 right now) uploaded and "chia farm" command on the farmer pod shows there are 4 plots, the pool stats show nothing at all.

I did copy these plots from another machine, but the mnemonic is the same for the plot maker and harvester/farmer, and "show wallet" on the wallet pod shows the correct info. Just... no partials according to the pool's status page.

Are people on Discord using this operator, or should I open some subset of the above debugging as a new issue here, or am I on my own?

Starttoaster commented 1 month ago

"how do you know it's working?"

The intention is mostly to use chia-exporter as a sidecar for that. Which makes more sense if you're already in the prometheus monitoring/alerting ecosystem.

I'm not sure what "the daemon" is exactly. This assumes I can even expose port 55400 effectively.

The daemon does admittedly a lot of things, including expose a websocket subscription service for events happening in the chia services the daemon is managing, which leads me into its first job: starting chia services. You can start a chia service manually without the daemon, but the chia image was written with using the daemon in mind (which, the daemon is started by default with the chia start $service command.)

What I'm trying to build here on top of this operator is a system where I can plot, upload to the PVC, and map that PVC into a harvester. But, while I have a small set of plots (4 right now) uploaded and "chia farm" command on the farmer pod shows there are 4 plots, the pool stats show nothing at all.

This is an awesome goal! If you get a well paved way of doing this, it would be really neat if you could contribute some documentation on how to do this. I'll ask someone in the morning about your pool stats - I don't farm pool plots personally so I'd be the wrong person to talk to on that. Though I am farming blocks with my solo plots so I can confidently say that works :)

I believe at minimum you need a plotnft that was designated to a pool, and the contract address of it. And then pass that contract address to the plotter process. If you farm those plots locally, do start getting partials showing up in your pool dashboard?

Are people on Discord using this operator, or should I open some subset of the above debugging as a new issue here, or am I on my own?

I'm not aware of many people using this operator. It's frankly fairly new. And it has not been publicized much. Requiring a bit of discovery work to find it for now. We're working on using it more internally, which has increased the amount of development time I've been able to give it fairly recently.