Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit bfef19e

Browse files
authored
Dockerfile (#5)
* finalize docker image build * update to latest blockless for cgi support
1 parent 908bd9c commit bfef19e

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
GOOS=linux GOARCH=amd64 make
2323
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USER }}" --password-stdin
2424
docker build . --tag ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} -f docker/Dockerfile --build-arg "ghcr_token=${{ secrets.GHCR_TOKEN }}"
25-
docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }}
25+
docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }}

cmd/node/flags.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ func parseFlags() *config.Config {
3232
pflag.UintVarP(&cfg.Concurrency, "concurrency", "c", defaultConcurrency, "maximum number of requests node will process in parallel")
3333
pflag.StringVar(&cfg.API, "rest-api", "", "address where the head node REST API will listen on")
3434
pflag.StringVar(&cfg.Workspace, "workspace", "./workspace", "directory that the node can use for file storage")
35-
pflag.StringVar(&cfg.Runtime, "runtime", "", "runtime address (used by the worker node)")
35+
pflag.StringVar(&cfg.RuntimePath, "runtime-path", "", "runtime path (used by the worker node)")
36+
pflag.StringVar(&cfg.RuntimeCLI, "runtime-cli", "", "runtime path (used by the worker node)")
3637
pflag.BoolVar(&cfg.LoadAttributes, "attributes", false, "node should try to load its attribute data from IPFS")
3738

3839
// Host configuration.

cmd/node/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ func run() int {
132132
// Executor options.
133133
execOptions := []executor.Option{
134134
executor.WithWorkDir(cfg.Workspace),
135-
executor.WithRuntimeDir(cfg.Runtime),
135+
executor.WithRuntimeDir(cfg.RuntimePath),
136+
executor.WithExecutableName(cfg.RuntimeCLI),
136137
}
137138

138139
if needLimiter(cfg) {
@@ -158,7 +159,7 @@ func run() int {
158159
log.Error().
159160
Err(err).
160161
Str("workspace", cfg.Workspace).
161-
Str("runtime", cfg.Runtime).
162+
Str("runtime_path", cfg.RuntimePath).
162163
Msg("could not create an executor")
163164
return failure
164165
}

docker/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ fi
8383
if [ "$NODE_ROLE" = "head" ]; then
8484
./upshot-node --peer-db /var/tmp/upshot/peerdb --function-db /var/tmp/upshot/function-db --log-level debug --port $P2P_PORT --role head --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH --rest-api :$REST_API $dialback_args $bootnode_args
8585
else
86-
./upshot-node --peer-db ./peer-database --function-db ./function-database--log-level debug --port $P2P_PORT --role worker --runtime /app/runtime --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH $dialback_args $bootnode_args
86+
./upshot-node --peer-db ./peer-database --function-db ./function-database--log-level debug --port $P2P_PORT --role worker --runtime-path /app/runtime --runtime-cli bls-runtime --workspace $WORKSPACE_ROOT --private-key $NODE_KEY_PATH $dialback_args $bootnode_args
8787
fi

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ toolchain go1.21.4
77
require (
88
github.com/cockroachdb/pebble v0.0.0-20230903225801-a4fe05009372
99
github.com/labstack/echo/v4 v4.11.3
10+
github.com/libp2p/go-libp2p v0.31.0
1011
github.com/multiformats/go-multiaddr v0.11.0
1112
github.com/spf13/pflag v1.0.5
1213
)
@@ -78,7 +79,6 @@ require (
7879
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
7980
github.com/libp2p/go-cidranger v1.1.0 // indirect
8081
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
81-
github.com/libp2p/go-libp2p v0.31.0 // indirect
8282
github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect
8383
github.com/libp2p/go-libp2p-consensus v0.0.1 // indirect
8484
github.com/libp2p/go-libp2p-gostream v0.6.0 // indirect
@@ -150,9 +150,8 @@ require (
150150
)
151151

152152
require (
153-
github.com/blocklessnetwork/b7s v0.4.3
153+
github.com/blocklessnetwork/b7s v0.4.5
154154
github.com/labstack/gommon v0.4.0 // indirect
155-
github.com/libp2p/go-libp2p-core v0.20.1
156155
github.com/mattn/go-colorable v0.1.13 // indirect
157156
github.com/mattn/go-isatty v0.0.19 // indirect
158157
github.com/rs/zerolog v1.31.0

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
6969
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
7070
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
7171
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
72-
github.com/blocklessnetwork/b7s v0.4.3 h1:uqojfDy7rBekScFL2bVacKurmOtBo9bdxjKXJg4XhUY=
73-
github.com/blocklessnetwork/b7s v0.4.3/go.mod h1:fkA5Te5tqk+foXMS50qe0zSx4V5KaO4PLKKpt2AudQE=
72+
github.com/blocklessnetwork/b7s v0.4.5 h1:EtiP4NlkwZgDgQKQGx5PO9XWzJgDGV7Civ/BFemSHxM=
73+
github.com/blocklessnetwork/b7s v0.4.5/go.mod h1:fkA5Te5tqk+foXMS50qe0zSx4V5KaO4PLKKpt2AudQE=
7474
github.com/blocklessnetwork/b7s-attributes v0.0.0-20231003175355-c87ad3eae97e h1:MbORHFMckGPdJq3Wdya+DqrY5iyvUn4PdcWyI3ywd30=
7575
github.com/blocklessnetwork/b7s-attributes v0.0.0-20231003175355-c87ad3eae97e/go.mod h1:OvkFdYsKp1RFpfa/nLuOc4Aif08U6O9uOcAnXgz/qJY=
7676
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
@@ -370,8 +370,6 @@ github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLE
370370
github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w=
371371
github.com/libp2p/go-libp2p-consensus v0.0.1 h1:jcVbHRZLwTXU9iT/mPi+Lx4/OrIzq3bU1TbZNhYFCV8=
372372
github.com/libp2p/go-libp2p-consensus v0.0.1/go.mod h1:+9Wrfhc5QOqWB0gXI0m6ARlkHfdJpcFXmRU0WoHz4Mo=
373-
github.com/libp2p/go-libp2p-core v0.20.1 h1:fQz4BJyIFmSZAiTbKV8qoYhEH5Dtv/cVhZbG3Ib/+Cw=
374-
github.com/libp2p/go-libp2p-core v0.20.1/go.mod h1:6zR8H7CvQWgYLsbG4on6oLNSGcyKaYFSEYyDt51+bIY=
375373
github.com/libp2p/go-libp2p-gostream v0.6.0 h1:QfAiWeQRce6pqnYfmIVWJFXNdDyfiR/qkCnjyaZUPYU=
376374
github.com/libp2p/go-libp2p-gostream v0.6.0/go.mod h1:Nywu0gYZwfj7Jc91PQvbGU8dIpqbQQkjWgDuOrFaRdA=
377375
github.com/libp2p/go-libp2p-kad-dht v0.25.0 h1:T2SXQ/VlXTQVLChWY/+OyOsmGMRJvB5kiR+eJt7jtvI=

0 commit comments

Comments
 (0)