Skip to content

Commit

Permalink
fix UI, improve init, compose
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed May 3, 2024
1 parent f0501a1 commit a84fe9b
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.curio
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN make curio-devnet
#####################################
FROM ubuntu:22.04 AS curio-all-in-one

RUN apt-get update && apt-get install -y dnsutils coreutils build-essential
RUN apt-get update && apt-get install -y dnsutils vim curl

# Copy libraries and binaries from curio-builder
COPY --from=curio-builder /etc/ssl/certs /etc/ssl/certs
Expand Down
2 changes: 1 addition & 1 deletion cmd/curio/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var runCmd = &cli.Command{
Name: "listen",
Usage: "host address and port the worker api will listen on",
Value: "0.0.0.0:12300",
EnvVars: []string{"LOTUS_WORKER_LISTEN"},
EnvVars: []string{"CURIO_LISTEN"},
},
&cli.BoolFlag{
Name: "nosync",
Expand Down
10 changes: 4 additions & 6 deletions curiosrc/docker/curio/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ while [[ $head -le 9 ]]; do
done

echo All ready. Lets go
myip=`nslookup curio | grep -v "#" | grep Address | awk '{print $2}'`

if [ ! -f $CURIO_REPO_PATH/.init.curio ]; then

Expand All @@ -35,20 +36,17 @@ if [ ! -f $CURIO_REPO_PATH/.init.curio ]; then
echo Initiating a new Curio cluster ...
curio config new-cluster $newminer
echo Enabling market ...
myip=`nslookup curio | grep -v "#" | grep Address | awk '{print $2}'`
curio config get seal | sed -e $'$a\\\n BoostAdapters = ["'"$newminer"':'"$myip"':32100"]' | curio config set --title sealm
curio config get seal | sed -e $'$a\\\n BoostAdapters = ["'"$newminer"':'"$myip"':32100"]' | curio config set --title seal
touch $CURIO_REPO_PATH/.init.config
fi

echo Starting Curio node to attach storage ...
curio run --nosync --layers sealm,post,gui &
curio run --nosync --layers seal,post,gui &
CURIO_PID=`echo $!`
until curio cli --machine $myip:12300 wait-api; do
echo "Waiting for the curio CLI to become ready..."
sleep 5
done
# sleep 120
# curio cli --machine $myip:12300 wait-api
curio cli --machine $myip:12300 storage attach --init --seal --store $CURIO_REPO_PATH
touch $CURIO_REPO_PATH/.init.curio
echo Stopping Curio node ...
Expand All @@ -58,5 +56,5 @@ if [ ! -f $CURIO_REPO_PATH/.init.curio ]; then
fi

echo Starting curio node ...
exec curio run --nosync --layers sealm,post,gui
exec curio run --nosync --layers seal,post,gui

19 changes: 17 additions & 2 deletions curiosrc/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ x-logging:
driver: json-file

networks:
default:
name: curio-devnet
curio-net:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16

services:
lotus:
Expand All @@ -30,6 +33,9 @@ services:
- ./data/lotus:/var/lib/lotus:rw
- ./data/genesis:/var/lib/genesis:rw
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw
networks:
curio-net:
ipv4_address: 172.20.0.2

lotus-miner:
container_name: lotus-miner
Expand All @@ -51,6 +57,9 @@ services:
- ./data/lotus:/var/lib/lotus:ro
- ./data/genesis:/var/lib/genesis:ro
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw
networks:
curio-net:
ipv4_address: 172.20.0.3

curio:
container_name: curio
Expand All @@ -70,6 +79,9 @@ services:
- ./data/lotus:/var/lib/lotus:ro
- ./data/lotus-miner:/var/lib/lotus-miner:ro
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw
networks:
curio-net:
ipv4_address: 172.20.0.4

yugabyte:
container_name: yugabyte
Expand All @@ -84,3 +96,6 @@ services:
volumes:
- ./data/yugabyte-data:/root/var/data
- ./data/yugabyte-logs:/root/var/logs
networks:
curio-net:
ipv4_address: 172.20.0.5
6 changes: 5 additions & 1 deletion curiosrc/seal/task_porep.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,16 @@ func (p *PoRepTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.Task
}

func (p *PoRepTask) TypeDetails() harmonytask.TaskTypeDetails {
gpu := 1.0
if isDevnet {
gpu = 0
}
res := harmonytask.TaskTypeDetails{
Max: p.max,
Name: "PoRep",
Cost: resources.Resources{
Cpu: 1,
Gpu: 1,
Gpu: gpu,
Ram: 50 << 30, // todo correct value
MachineID: 0,
},
Expand Down
1 change: 1 addition & 0 deletions curiosrc/web/hapi/web/root.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>{{.PageTitle}}</title>
<script src="https://unpkg.com/htmx.org@1.9.5" integrity="sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO" crossorigin="anonymous"></script>
<script type="module" src="chain-connectivity.mjs"></script>
<link href="https://fonts.cdnfonts.com/css/metropolis-2" rel="stylesheet" crossorigin="anonymous">
<link rel="stylesheet" href="/main.css">
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack-subset.css'>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
Expand Down
1 change: 1 addition & 0 deletions curiosrc/web/static/chain-connectivity.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ window.customElements.define('chain-connectivity', class MyElement extends LitEl
render = () => html`
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="/ux/main.css">
<link href="https://fonts.cdnfonts.com/css/metropolis-2" rel="stylesheet" crossorigin="anonymous">
<table class="table table-dark">
<thead>
<tr>
Expand Down
1 change: 1 addition & 0 deletions curiosrc/web/static/pipeline_porep.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<script src="https://unpkg.com/htmx.org@1.9.5" integrity="sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO" crossorigin="anonymous"></script>
<script type="module" src="/ux/curio-ux.mjs"></script>
<script type="module" src="/chain-connectivity.mjs"></script>
<link href="https://fonts.cdnfonts.com/css/metropolis-2" rel="stylesheet" crossorigin="anonymous">
<link rel="stylesheet" href="/ux/main.css">
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack-subset.css'>
<style>
Expand Down
1 change: 1 addition & 0 deletions curiosrc/web/static/ux/curio-ux.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CurioUX extends LitElement {
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://fonts.cdnfonts.com/css/metropolis-2" rel="stylesheet" crossorigin="anonymous">
<link rel="stylesheet" href="/ux/main.css" onload="document.body.style.visibility = 'initial'">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
`
Expand Down
2 changes: 1 addition & 1 deletion curiosrc/web/static/ux/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://fonts.cdnfonts.com/css/metropolis-2');
/*@import url('https://fonts.cdnfonts.com/css/metropolis-2');*/

html {
min-height: 100vh;
Expand Down
2 changes: 1 addition & 1 deletion documentation/en/cli-curio.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ USAGE:
curio run [command options] [arguments...]
OPTIONS:
--listen value host address and port the worker api will listen on (default: "0.0.0.0:12300") [$LOTUS_WORKER_LISTEN]
--listen value host address and port the worker api will listen on (default: "0.0.0.0:12300") [$CURIO_LISTEN]
--nosync don't check full-node sync status (default: false)
--manage-fdlimit manage open file limit (default: true)
--storage-json value path to json file containing storage config (default: "~/.curio/storage.json")
Expand Down
4 changes: 2 additions & 2 deletions documentation/en/default-curio-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@

# BoostAdapters is a list of tuples of miner address and port/ip to listen for market (e.g. boost) requests.
# This interface is compatible with the lotus-miner RPC, implementing a subset needed for storage market operations.
# Strings should be in the format "actor:port" or "actor:ip:port". Default listen address is 0.0.0.0
# Example: "f0123:32100", "f0123:127.0.0.1:32100". Multiple addresses can be specified.
# Strings should be in the format "actor:ip:port". IP cannot be 0.0.0.0. We recommend using a private IP.
# Example: "f0123:127.0.0.1:32100". Multiple addresses can be specified.
#
# When a market node like boost gives Curio's market RPC a deal to placing into a sector, Curio will first store the
# deal data in a temporary location "Piece Park" before assigning it to a sector. This requires that at least one
Expand Down
4 changes: 2 additions & 2 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ type CurioSubsystemsConfig struct {

// BoostAdapters is a list of tuples of miner address and port/ip to listen for market (e.g. boost) requests.
// This interface is compatible with the lotus-miner RPC, implementing a subset needed for storage market operations.
// Strings should be in the format "actor:port" or "actor:ip:port". Default listen address is 0.0.0.0
// Example: "f0123:32100", "f0123:127.0.0.1:32100". Multiple addresses can be specified.
// Strings should be in the format "actor:ip:port". IP cannot be 0.0.0.0. We recommend using a private IP.
// Example: "f0123:127.0.0.1:32100". Multiple addresses can be specified.
//
// When a market node like boost gives Curio's market RPC a deal to placing into a sector, Curio will first store the
// deal data in a temporary location "Piece Park" before assigning it to a sector. This requires that at least one
Expand Down

0 comments on commit a84fe9b

Please sign in to comment.