From d22f6b128b925a3c9a19d7071a93ac5386cd759b Mon Sep 17 00:00:00 2001 From: xmariachi Date: Tue, 9 Jan 2024 18:13:46 +0100 Subject: [PATCH 1/2] Use dev.3 extension release asset (uses passing params) (#12) * Use `dev.3` release asset id to pass params to py function --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index fb8758b..87d6233 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,7 +18,7 @@ RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime RUN python3 -m pip install --upgrade pip # get the upshot-extension -RUN curl -L -s -H "Authorization: token ${ghcr_token}" -H 'Accept:application/octet-stream' "https://api.github.com/repos/upshot-tech/upshot-blockless-extension/releases/assets/142012669" -o upshot-extension.tar.gz +RUN curl -L -s -H "Authorization: token ${ghcr_token}" -H 'Accept:application/octet-stream' "https://api.github.com/repos/upshot-tech/upshot-blockless-extension/releases/assets/144563646" -o upshot-extension.tar.gz RUN mkdir /app/runtime/extensions && tar -xvkf ./upshot-extension.tar.gz -C /app/runtime/extensions # libssl 1.1 From c01a42405dae125668cff54b25e13adf93327a31 Mon Sep 17 00:00:00 2001 From: Derek Anderson Date: Tue, 9 Jan 2024 11:43:03 -0600 Subject: [PATCH 2/2] add the ability to easily debug with vscode (#13) adds an easy way to debug using vscode play functionality. --- .gitignore | 4 +- .vscode/launch.json | 77 +++++++++++++++++++++++++++++++ README.md | 10 +++- configs/testkeys/ident1/identity | 1 + configs/testkeys/ident1/priv.bin | Bin 0 -> 68 bytes configs/testkeys/ident1/pub.bin | Bin 0 -> 36 bytes configs/testkeys/ident2/identity | 1 + configs/testkeys/ident2/priv.bin | 2 + configs/testkeys/ident2/pub.bin | 2 + 9 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 configs/testkeys/ident1/identity create mode 100644 configs/testkeys/ident1/priv.bin create mode 100644 configs/testkeys/ident1/pub.bin create mode 100644 configs/testkeys/ident2/identity create mode 100644 configs/testkeys/ident2/priv.bin create mode 100644 configs/testkeys/ident2/pub.bin diff --git a/.gitignore b/.gitignore index 7773828..c4115c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -dist/ \ No newline at end of file +dist/ +peer-db/ +function-db/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b352841 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,77 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Head Node", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/node", + "args": [ + "--peer-db", + "/tmp/upt/head-peer-db", + "--function-db", + "/tmp/upt/head-fdb", + "--log-level", + "debug", + "--port", + "9527", + "--role", + "head", + "--workspace", + "/tmp/debug/head", + "--private-key", + "${workspaceFolder}/configs/testkeys/ident1/priv.bin", + "--rest-api", + ":8081" + ], + "cwd": "${workspaceFolder}" + }, + { + "name": "Launch Worker Node", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/node", + "args": [ + "--peer-db", + "/tmp/upt/worker-peer-db", + "--function-db", + "/tmp/upt/worker-fdb", + "--log-level", + "debug", + "--port", + "0", + "--role", + "worker", + "--runtime-path", + "/tmp/runtime", + "--runtime-cli", + "bls-runtime", + "--workspace", + "/tmp/debug/worker", + "--private-key", + "${workspaceFolder}/configs/testkeys/ident2/priv.bin", + "--boot-nodes", + "/ip4/0.0.0.0/tcp/9527/p2p/12D3KooWH9GerdSEroL2nqjpd2GuE5dwmqNi7uHX7FoywBdKcP4q" + ], + "cwd": "${workspaceFolder}" + }, + { + "name": "Launch Manager", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/manager", + "args": [ + "-l", + "3333", + "--private-key", + "${workspaceFolder}/configs/testkeys/ident2/priv.bin", + "--allowed-peer", + "QmSz8bJZjg9gWfvrJjYibo4UhSo8dXYtpNRb4kxn28SoHG" + ], + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/README.md b/README.md index 659fe8c..a5649ca 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,12 @@ This node allows model providers to participate providing inferences to the Upsh ``` GOOS=linux GOARCH=amd64 make docker build -f docker/Dockerfile -t upshot:dev --build-arg "ghcr_token=${YOU_GH_TOKEN}" . -``` \ No newline at end of file +``` + +# Debugging Locally Using VSCode. + +This project comes with some static identities, as well as debug settings for `VSCode`. Use the `VSCode` debugger to start a head node instance, and a worker node instance. + +* Ensure you've installed the Runtime `make setup` +* Start the Head Node First +* Start the Worker Node \ No newline at end of file diff --git a/configs/testkeys/ident1/identity b/configs/testkeys/ident1/identity new file mode 100644 index 0000000..cf4a86b --- /dev/null +++ b/configs/testkeys/ident1/identity @@ -0,0 +1 @@ +12D3KooWH9GerdSEroL2nqjpd2GuE5dwmqNi7uHX7FoywBdKcP4q \ No newline at end of file diff --git a/configs/testkeys/ident1/priv.bin b/configs/testkeys/ident1/priv.bin new file mode 100644 index 0000000000000000000000000000000000000000..6c46276d525ba32f0724ac1b4bc52a572df583dd GIT binary patch literal 68 zcmV-K0K5MP0TMvi?Co~%@to)FP}-uQovFXBr!Ze<(FtnNNY<&EEaq5j*_)85IrhQN az_R>30=n1nj2ED+I$a;9%6tG>?re@hza~lm literal 0 HcmV?d00001 diff --git a/configs/testkeys/ident1/pub.bin b/configs/testkeys/ident1/pub.bin new file mode 100644 index 0000000000000000000000000000000000000000..570651e404cc901a4fbf4fdac7105fa55c720061 GIT binary patch literal 36 ucmV+<0Neiv0TLi=*_)85IrhQNz_R>30=n1nj2ED+I$a;9%6tG>?re@in-UfP literal 0 HcmV?d00001 diff --git a/configs/testkeys/ident2/identity b/configs/testkeys/ident2/identity new file mode 100644 index 0000000..570f85d --- /dev/null +++ b/configs/testkeys/ident2/identity @@ -0,0 +1 @@ +12D3KooWQrN5U3BApv4JYjE5HyKXFKkRF2U8c5FgK3zMPjzkZTpQ \ No newline at end of file diff --git a/configs/testkeys/ident2/priv.bin b/configs/testkeys/ident2/priv.bin new file mode 100644 index 0000000..17a09c6 --- /dev/null +++ b/configs/testkeys/ident2/priv.bin @@ -0,0 +1,2 @@ +@!Y Fgob\Mɏdn +o}mVz wC5 \ No newline at end of file diff --git a/configs/testkeys/ident2/pub.bin b/configs/testkeys/ident2/pub.bin new file mode 100644 index 0000000..de24a2a --- /dev/null +++ b/configs/testkeys/ident2/pub.bin @@ -0,0 +1,2 @@ + b\Mɏdn +o}mVz wC5 \ No newline at end of file