Skip to content

Commit

Permalink
docs for upgrading production
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemarsden committed Nov 15, 2023
1 parent f70e4e1 commit 2cad3ee
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ Whenever you make changes to the smart contracts, regenerate the Go bindings in
```
sudo sysctl -w net.core.rmem_max=2500000
sudo sysctl -w net.core.wmem_max=2500000
```
```
100 changes: 100 additions & 0 deletions docs/upgrade-production.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# how to upgrade production

## if only the binary has changed:

### control plane

```
gcloud compute ssh --zone "us-central1-a" "lilypad-v2" --project "mlops-consulting-production"
```

```
cd /app/lilypad
git checkout main
git pull
go build
sudo mv lilypad /usr/bin/lilypad
sudo systemctl restart solver
sudo systemctl restart mediator # not used currently
```

```
journalctl -f -u solver
```

### gpu node(s)

```
ssh node05.lukemarsden.net
```

```
cd /app/lilypad
git checkout main
git pull
go build
sudo mv lilypad /usr/bin/lilypad
sudo systemctl restart resource-provider-gpu
```

```
journalctl -f -u resource-provider-gpu
```

## if the smart contract has changed:

we have to wipe out the whole world and start from scratch (for now)


```
gcloud compute ssh --zone "us-central1-a" "lilypad-v2" --project "mlops-consulting-production"
```

```
cd /app/lilypad
git checkout main
git pull
sudo systemctl stop solver
sudo systemctl stop mediator
./stack boot # THIS WILL WIPE OUT GETH AND ALL THE BLOCKCHAIN DATA
```

now we need to edit the code to set the new default controller contract address from `stack boot` above
https://github.com/bacalhau-project/lilypad/blob/main/pkg/options/web3.go#L21

commit and push and then use the resulting binary for the control plane and resource providers

```
go build
sudo mv lilypad /usr/bin/lilypad
sudo systemctl start solver
sudo systemctl start mediator # not used currently
```
```
journalctl -f -u solver
```

### gpu node(s)

```
ssh node05.lukemarsden.net
```

github should have build the binary by now, go download the latest one from https://github.com/bacalhau-project/lilypad/releases

```
cd /app/lilypad
## CHANGE THE HASH BELOW TO THE LATEST FROM RELEASES PAGE!!
wget https://github.com/bacalhau-project/lilypad/releases/download/v2.0.0-f70e4e1/lilypad-linux-amd64
chmod +x lilypad-linux-amd64
sudo mv lilypad-linux-amd64 /usr/bin/lilypad
sudo systemctl restart resource-provider-gpu
```

```
journalctl -f -u resource-provider-gpu
```

0 comments on commit 2cad3ee

Please sign in to comment.