From efe23e38dc6ad3d08286786dc602b7924aaa0ff8 Mon Sep 17 00:00:00 2001 From: Dhriti Naidu <91502508+dhritinaidu@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:45:04 -0400 Subject: [PATCH] added build.sh (#13) --- .gitignore | 2 ++ build.sh | 28 ++++++++++++++++++++++++++++ meta.json | 4 ++++ 3 files changed, 34 insertions(+) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index 0afb554..59d8ab5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ ocean-prefilter *.swp +module.tar.gz +ocean-prefilter-appimage \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..061efbc --- /dev/null +++ b/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# check if Docker is installed +if ! command -v docker &> /dev/null; then + echo "Docker is not installed. Please install Docker and try again." + exit 1 +fi + +# check the architecture +ARCH=$(uname -m) + +# pull the Docker image and log in +DOCKER_IMAGE="ghcr.io/viamrobotics/ocean-prefilter:$ARCH" + +docker pull $DOCKER_IMAGE + +if [ $? -ne 0 ]; then + echo "Failed to pull Docker image: $DOCKER_IMAGE" + exit 1 +fi + +docker run --rm \ + -e ARCH_TAG=$ARCH \ + -v "$(pwd)":/workspace \ + -w /workspace \ + $DOCKER_IMAGE \ + /bin/bash -c "make ocean-prefilter && make ocean-prefilter-appimage && make module.tar.gz" + diff --git a/meta.json b/meta.json index 8027ace..33c58ab 100644 --- a/meta.json +++ b/meta.json @@ -9,5 +9,9 @@ "model": "viam-labs:vision:ocean-prefilter" } ], + "build": { + "build": "./build.sh", + "arch": ["linux/arm64", "linux/amd64"] + }, "entrypoint": "ocean-prefilter-appimage" }