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

feat: Upgrade to bacalhau 1.5 #441

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .local.dev
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ WEB3_PAYMENTS_ADDRESS=0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6
WEB3_POW_ADDRESS_=0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1
WEB3_STORAGE_ADDRESS_=0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e
WEB3_TOKEN_ADDRESS_=0xa513E6E4b8f2a923D98304ec87F64353C4D5C853
WEB3_USERS_ADDRESS=0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82
WEB3_USERS_ADDRESS=0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82
BACALHAU_API_HOST=localhost
BACALHAU_API_PORT=1234
JOB_STATUS_POLL_INTERVAL=5
BACALHAU_RESULTS_DIRECTORY=

9 changes: 1 addition & 8 deletions cmd/lilypad/mediator.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package lilypad

import (
"fmt"

"github.com/lilypad-tech/lilypad/pkg/executor/bacalhau"
"github.com/lilypad-tech/lilypad/pkg/ipfs"
"github.com/lilypad-tech/lilypad/pkg/mediator"
optionsfactory "github.com/lilypad-tech/lilypad/pkg/options"
"github.com/lilypad-tech/lilypad/pkg/system"
Expand Down Expand Up @@ -48,12 +45,8 @@ func runMediator(cmd *cobra.Command, options mediator.MediatorOptions) error {
return err
}

ipfsClient, err := ipfs.NewClient(commandCtx.Ctx, options.IPFS.Addr)
if err != nil {
return fmt.Errorf("error creating IPFS client: %s", err.Error())
}

executor, err := bacalhau.NewBacalhauExecutor(options.Bacalhau, ipfsClient)
executor, err := bacalhau.NewBacalhauExecutor(options.Bacalhau)
if err != nil {
return err
}
Expand Down
10 changes: 1 addition & 9 deletions cmd/lilypad/resource-provider.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package lilypad

import (
"fmt"

"github.com/lilypad-tech/lilypad/pkg/executor/bacalhau"
"github.com/lilypad-tech/lilypad/pkg/ipfs"
optionsfactory "github.com/lilypad-tech/lilypad/pkg/options"
"github.com/lilypad-tech/lilypad/pkg/resourceprovider"
"github.com/lilypad-tech/lilypad/pkg/system"
Expand Down Expand Up @@ -53,12 +50,7 @@ func runResourceProvider(cmd *cobra.Command, options resourceprovider.ResourcePr
return err
}

ipfsClient, err := ipfs.NewClient(commandCtx.Ctx, options.IPFS.Addr)
if err != nil {
return fmt.Errorf("error creating IPFS client: %s", err.Error())
}

executor, err := bacalhau.NewBacalhauExecutor(options.Bacalhau, ipfsClient)
executor, err := bacalhau.NewBacalhauExecutor(options.Bacalhau)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/lilypad/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions, network st
os.Exit(1)
}

// UPDATE FUNCTION
// fmt.Printf("evOffer: %s --------------------------------------\n")
// spew.Dump(evOffer)


})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions docker/bacalhau/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN mkdir -pm755 /etc/apt/keyrings && curl -o /etc/apt/keyrings/docker.asc -fsSL
RUN nvidia-ctk runtime configure --runtime=docker --set-as-default

# Install Bacalhau
ADD https://github.com/bacalhau-project/bacalhau/releases/download/v1.3.2/bacalhau_v1.3.2_linux_amd64.tar.gz .
RUN tar xfv bacalhau_v1.3.2_linux_amd64.tar.gz
ADD https://github.com/bacalhau-project/bacalhau/releases/download/v1.5.1/bacalhau_v1.5.1_linux_amd64.tar.gz .
RUN tar xfv bacalhau_v1.5.1_linux_amd64.tar.gz
RUN mv bacalhau /usr/local/bin

ADD https://raw.githubusercontent.com/moby/moby/refs/heads/master/hack/dind /usr/local/bin/dind
Expand Down
29 changes: 2 additions & 27 deletions docker/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,11 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=solver-db
ipfs:
image: ipfs/kubo:v0.32.1
container_name: ipfs
restart: unless-stopped
ports:
- 127.0.0.1:5001:5001
- 127.0.0.1:8080:8080
volumes:
- ipfs-data:/data/ipfs
bacalhau:
image: ghcr.io/lilypad-tech/bacalhau
container_name: bacalhau
restart: unless-stopped
privileged: true
depends_on:
ipfs:
condition: service_healthy
build:
context: ..
dockerfile: ./docker/bacalhau/Dockerfile
Expand All @@ -74,23 +62,10 @@ services:
- BACALHAU_ENVIRONMENT=local
ports:
- 1234:1234
command:
[
"bacalhau",
"serve",
"--node-type",
"compute,requester",
"--peer",
"none",
"--private-internal-ipfs=false",
"--job-selection-accept-networked",
"--ipfs-connect",
"/dns4/ipfs/tcp/5001",
]
command: ["bacalhau", "serve", "--orchestrator", "--compute"]
volumes:
- bacalhau-data:/root/.bacalhau
- ${HOME}/.bacalhau:/root/.bacalhau
volumes:
chain-data:
ipfs-data:
bacalhau-data:
postgres-data:
3 changes: 1 addition & 2 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ services:
container_name: resource-provider
restart: unless-stopped
depends_on:
ipfs:
condition: service_healthy
solver:
condition: service_healthy
bacalhau:
Expand All @@ -68,6 +66,7 @@ services:
- "localhost:host-gateway"
volumes:
- lilypad-data:/tmp/lilypad/data
- ${HOME}/.bacalhau:/root/.bacalhau
environment:
- WEB3_PRIVATE_KEY=${RESOURCE_PROVIDER_PRIVATE_KEY}
- IPFS_CONNECT=/dns4/ipfs/tcp/5001
Expand Down
28 changes: 2 additions & 26 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
# This is a docker-compose file for use by Resource Providers
services:
ipfs:
image: ipfs/kubo:v0.32.1
container_name: ipfs
restart: unless-stopped
ports:
- 4001:4001
- 127.0.0.1:5001:5001
- 127.0.0.1:8080:8080
volumes:
- ipfs-data:/data/ipfs
bacalhau:
image: ghcr.io/lilypad-tech/bacalhau
container_name: bacalhau
restart: unless-stopped
privileged: true
depends_on:
ipfs:
condition: service_healthy
build:
context: ..
dockerfile: ./docker/bacalhau/Dockerfile
environment:
- BACALHAU_ENVIRONMENT=local
command:
[
"bacalhau",
"serve",
"--node-type",
"compute,requester",
"--peer",
"none",
"--private-internal-ipfs=false",
"--job-selection-accept-networked",
"--ipfs-connect",
"/dns4/ipfs/tcp/5001",
]
command: ["bacalhau", "serve", "--orchestrator", "--compute"]
volumes:
- bacalhau-data:/root/.bacalhau
resource-provider:
Expand All @@ -51,6 +26,7 @@ services:
- COMPUTE_MODE=gpu
volumes:
- lilypad-data:/tmp/lilypad/data
- bacalhau-data:/root/.bacalhau
environment:
- WEB3_PRIVATE_KEY
- WEB3_RPC_URL
Expand Down
13 changes: 1 addition & 12 deletions docker/resource-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG COMPUTE_MODE=gpu

FROM golang:1.22.4 AS base
FROM golang:latest AS base
WORKDIR /usr/src/app
ARG NETWORK=testnet
ARG VERSION
Expand Down Expand Up @@ -33,24 +33,13 @@ RUN mv lilypad /usr/local/bin
# Install necessary dependencies
RUN apt update && apt install -y wget bash curl && apt clean

# Install Bacalhau
RUN cd /tmp && \
wget https://github.com/bacalhau-project/bacalhau/releases/download/v1.3.2/bacalhau_v1.3.2_linux_amd64.tar.gz && \
tar xfv bacalhau_v1.3.2_linux_amd64.tar.gz && \
mv bacalhau /usr/local/bin/bacalhau && \
rm bacalhau_v1.3.2_linux_amd64.tar.gz

# Add both lilypad and bacalhau executables to PATH
ENV PATH="/usr/local/bin:${PATH}"

# Create a startup script to run both services simultaneously
RUN touch run
RUN echo "#!/bin/bash" >> run

# Ensure bacalhau is initialized
RUN echo "export BACALHAU_ENVIRONMENT=local" >> run
RUN echo "bacalhau id" >> run

# Launch Lilypad
RUN echo "/usr/local/bin/lilypad resource-provider --network ${NETWORK} --disable-pow=${DISABLE_POW} --disable-telemetry=${DISABLE_TELEMETRY} &" >> run
RUN echo "wait -n" >> run
Expand Down
41 changes: 23 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
module github.com/lilypad-tech/lilypad

go 1.22
go 1.23

toolchain go1.23.2

require (
github.com/BurntSushi/toml v0.3.1
github.com/bacalhau-project/bacalhau v1.4.0
github.com/davecgh/go-spew v1.1.1
github.com/bacalhau-project/bacalhau v1.5.1
github.com/ethereum/go-ethereum v1.13.4
github.com/fatih/color v1.15.0
github.com/fatih/color v1.16.0
github.com/go-chi/httprate v0.14.1
github.com/go-git/go-git/v5 v5.10.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/holiman/uint256 v1.2.4
github.com/ipfs/boxo v0.24.0
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-merkledag v0.11.0
github.com/ipfs/kubo v0.30.0
github.com/jaypipes/ghw v0.12.0
github.com/multiformats/go-multiaddr v0.13.0
github.com/multiformats/go-multicodec v0.9.0
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.31.0
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
Expand All @@ -32,8 +35,8 @@ require (
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.55.0
go.opentelemetry.io/otel v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.32.0
go.opentelemetry.io/otel/metric v1.32.0
go.opentelemetry.io/otel/sdk v1.32.0
go.opentelemetry.io/otel/sdk/metric v1.32.0
Expand Down Expand Up @@ -65,6 +68,7 @@ require (
github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 // indirect
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand Down Expand Up @@ -96,7 +100,6 @@ require (
github.com/ipfs/go-bitfield v1.1.0 // indirect
github.com/ipfs/go-block-format v0.2.0 // indirect
github.com/ipfs/go-blockservice v0.5.2 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ds-measure v0.2.0 // indirect
github.com/ipfs/go-fs-lock v0.0.7 // indirect
github.com/ipfs/go-ipfs-blockstore v1.3.1 // indirect
Expand Down Expand Up @@ -145,18 +148,17 @@ require (
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.4.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.34.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
Expand All @@ -165,26 +167,30 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/samber/lo v1.46.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/skeema/knownhosts v1.2.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect
github.com/whyrusleeping/cbor-gen v0.1.2 // indirect
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
Expand Down Expand Up @@ -212,5 +218,4 @@ require (
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
lukechampine.com/blake3 v1.3.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading
Loading