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

Commit

Permalink
Merge branch 'main' into vlad/ora-190-ensure-all-repos-are-deployable…
Browse files Browse the repository at this point in the history
…-on-aws-cloud-with-a-merge
  • Loading branch information
vladupshot committed Jan 10, 2024
2 parents 1f43442 + c01a424 commit bb80b94
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 17 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build_push_ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ jobs:
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and push it to ECR so that it can be deployed to ECS.
docker build -f docker/Dockerfile --build-arg "GH_TOKEN=${{ secrets.GHCR_TOKEN }}" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
# To build it with particular BLS_EXTENSION version pass --build-arg "BLS_EXTENSION_VER=RELEASE_NAME"
# If BLS_EXTENSION_VER is not passed will be built with the latest available version
docker build -f docker/Dockerfile \
--build-arg "GH_TOKEN=${{ secrets.GHCR_TOKEN }}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> "$GITHUB_OUTPUT"
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist/
dist/
peer-db/
function-db/
77 changes: 77 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
]
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}" .
```
```

# 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
1 change: 1 addition & 0 deletions configs/testkeys/ident1/identity
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12D3KooWH9GerdSEroL2nqjpd2GuE5dwmqNi7uHX7FoywBdKcP4q
Binary file added configs/testkeys/ident1/priv.bin
Binary file not shown.
Binary file added configs/testkeys/ident1/pub.bin
Binary file not shown.
1 change: 1 addition & 0 deletions configs/testkeys/ident2/identity
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12D3KooWQrN5U3BApv4JYjE5HyKXFKkRF2U8c5FgK3zMPjzkZTpQ
2 changes: 2 additions & 0 deletions configs/testkeys/ident2/priv.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@��!������Y�����F��g��o�����b\�Mɏd�n
��o}�m���Vz wC��5
Expand Down
2 changes: 2 additions & 0 deletions configs/testkeys/ident2/pub.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 �b\�Mɏd�n
��o}�m���Vz wC��5
37 changes: 23 additions & 14 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,40 @@ RUN apt update && \
curl \
unzip \
ca-certificates \
libssl-dev \
gh && \
rm -rf /var/cache/apt/*
# libssl-dev \ # - temporary use libssl 1.1 TODO: Should use fresher libssl

# libssl 1.1
RUN curl -o ./libssl.deb -sSL http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
dpkg -i ./libssl.deb && \
rm ./libssl.deb

# gomplete for updating config with env vars
RUN GOMPLATE_VER="v3.11.6" && \
curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VER}/gomplate_linux-amd64 && \
chmod 755 /usr/local/bin/gomplate

# get the runtime
ARG GH_TOKEN
RUN BLS_RUNTIME_VER="v0.3.1" && \
curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/bls-runtime/releases/download/${BLS_RUNTIME_VER}/blockless-runtime.linux-latest.x86_64.tar.gz && \
mkdir /app/runtime && \
tar -xvkf ./runtime.tar.gz -C /app/runtime && \
rm ./runtime.tar.gz
RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.ubuntu-20.04.x86_64.tar.gz
RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime
RUN python3 -m pip install --upgrade pip

ARG GH_TOKEN
# get the upshot-extension
RUN BLS_EXTENSION_VER="dev.3" && \
gh release download \
--repo "upshot-tech/upshot-blockless-extension" \
--pattern '*linux-amd64.tar.gz' \
--output upshot-extension.tar.gz && \
mkdir /app/runtime/extensions && \
ARG BLS_EXTENSION_VER
# If BLS_EXTENSION_VER install the version else install latest
RUN if [ -n $BLS_EXTENSION_VER]; then \
gh release download $BLS_EXTENSION_VER \
--repo "upshot-tech/upshot-blockless-extension" \
--pattern '*linux-amd64.tar.gz' \
--output upshot-extension.tar.gz; \
else \
gh release download $(gh release list --repo "upshot-tech/upshot-blockless-extension" | grep Latest | awk '{print($1)}') \
--repo "upshot-tech/upshot-blockless-extension" \
--pattern '*linux-amd64.tar.gz' \
--output upshot-extension.tar.gz; \
fi && \
mkdir -p /app/runtime/extensions && \
tar -xvkf ./upshot-extension.tar.gz -C /app/runtime/extensions && \
rm ./upshot-extension.tar.gz

Expand Down

0 comments on commit bb80b94

Please sign in to comment.