Lilypad-Tech / lilypad

Run AI workloads easily in a decentralized GPU network. https://www.youtube.com/watch?v=yQnB2Yxia4Y
https://lilypad.tech
Apache License 2.0
51 stars 16 forks source link

Create a 'Demo Net' for stable place to run jobs #430

Open walkerlj0 opened 3 hours ago

walkerlj0 commented 3 hours ago

General Description

We need to spin up a third 'demo net' (outside of regular and testnet) with a few select, stable RPs so JCs can run jobs on our network while we fix scaling issues on our mainnet

Which system(s) or functionality does this affect

solver, job-creation, executor, mediation, protocol-smart-contracts, apis, cron-server, , infrastructure-devops

Describe the changes, and how this affects/ interacts with each system.

To-Dos

-[] Thing

walkerlj0 commented 3 hours ago

@noryev I created this initially - can you fill in a few details and a better effort estimate?

Also - will you be doing it this sprint, or do you have work to do still on devnet?

bgins commented 1 hour ago

Writing up some details about configuration changes that will be required.

Embedded configs

We currently have config files for dev, devnet, and testnet: https://github.com/Lilypad-Tech/lilypad/tree/main/pkg/options/configs

The configs are in an embedded filesystem. We check if attempt to load the config file by name:

https://github.com/Lilypad-Tech/lilypad/blob/ce26bf76465d2dcf5357141f36983cdac9d19d4a/pkg/options/config.go#L29-L33

Adding a demonet config should be as simple as adding a demonet.toml config alongisde the existing config files.

Services will be run with the --network demonet option.

Configuration

Our testnet config looks like this:

[services]
solver = "0xe05e1b71955da4934938a6b16f97e1db9de6b764"
mediator = ["0x7B49d6ee530B0A538D26E344f3B02E79ACa96De2"]
api_host = "https://api-testnet.lilypad.tech/"

[web3]
rpc_url = "wss://arbitrum-sepolia-rpc.publicnode.com,wss://rpc.ankr.com/arbitrum_sepolia,wss://arbitrum-sepolia.drpc.org/,wss://testnet-rpc.etherspot.io/v1/421614,wss://endpoints.omniatech.io/v1/arbitrum/sepolia/public"
chain_id = 421614
controller_address = "0x4a83270045FB4BCd1bdFe1bD6B00762A9D8bbF4E"
payments_address = "0xdE7CEa09A23e7Aa4980B95F69B8912F39A0e323A"
storage_address = "0x8d06cEB457d336c6c938FCe9C4862615a4F79af0"
users_address = "0x90ed1AC9c74B9340468134F8c669BA1169A11c58"
token_address = "0x0352485f8a3cB6d305875FaC0C40ef01e0C06535"
mediation_address = "0xD1377D4617CD634426A8b595507fd2045A2DFB03"
jobcreator_address = "0xDBA89e33EFE2eD227c04CB31356EFdE618d4953F"
pow_address = "0x8B852BA45293d6dd51B10c57625C6c5f25ADFB40"

[ipfs]
addr = "/ip4/127.0.0.1/tcp/5001"

[telemetry]
url = "https://observe.lilypad.tech"
token = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJ1c2VyIjoicmVzb3VyY2UtcHJvdmlkZXIifQ.n36M_ngwC4XPQ_pEkkWAnPiOinnx6-0VO1v_WgCTUEERD7b_p9KHCU6SY5bUdFh5UXRZHAhc1gfyc7rjAnmeDQ"

We can adapt this config file for demonet as follows.

The solver and mediator services should be updated with appropriate wallet addresses based on our deployment.

The api_host can be set to "" (empty string) because we don't need to collect metrics, and it removes an external dependency that could impact reliability.

The web3 section can be filled out with appropriate contract rpc_url, chain_id and contract addresses.

The ipfs section only matters for resource providers and can be left unchanged.

The telemetry section can be left unchanged. Contacting the observability server is another external dependency that we may want to remove, but the telemetry might be nice to track successful and failed job runs. If we don't want it, we can disable it with the --disable-telemetry option when starting services.

Debugging configs

It can sometimes be helpful to print the config to make sure it is loading properly. The can be done immediately after processing options. For example, in the solver:

https://github.com/Lilypad-Tech/lilypad/blob/ce26bf76465d2dcf5357141f36983cdac9d19d4a/cmd/lilypad/solver.go#L23-L27

We can temporarily add a fmt.Printf("Options: %+v", options) line in between lines 24 and 25.

walkerlj0 commented 38 minutes ago

No need to set up API Server, Cron server, or Job Creator or do anything for telemetry (up to you, can run services with --disable-telemetry)