diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb04aa4..f8b9d15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ jobs: runs-on: buildjet-8vcpu-ubuntu-2204 container: ghcr.io/${{ github.repository }} steps: + - name: sentry begin + run: curl ${{ secrets.SENTRY_CRONS }}?status=in_progress - uses: actions/checkout@v4 with: path: rdk-apk @@ -29,7 +31,7 @@ jobs: run: | mkdir -p ~/.android [ -n "$DEBUG_KEYSTORE" ] && echo "$DEBUG_KEYSTORE" | base64 > ~/.android/debug.keystore - # todo: put tflite and x264 in same etc/android/prefix, then try pkgconfig + # todo: put x264 in same etc/android/prefix, then try pkgconfig # todo: look at short-lived cache of etc/android/prefix - name: build x264 if: hashFiles('rdk/etc/android/build-x264.sh') != '' @@ -37,14 +39,9 @@ jobs: run: | make etc/android/prefix/aarch64 make etc/android/prefix/x86_64 - - name: build tflite - working-directory: rdk - # we need tflite headers but not the full build. add SRC_ONLY flag - # if: false - run: ANDROID_NDK=$NDK_ROOT KEEP_TFLITE_SRC=1 etc/android/build-tflite.sh - name: build AAR working-directory: rdk - run: CGO_CFLAGS="-I $HOME/tensorflow/tensorflow-2.12.0" PLATFORM_NDK_ROOT=$NDK_ROOT NDK_ROOT=$NDK_ROOT make droid-rdk.aar + run: PLATFORM_NDK_ROOT=$NDK_ROOT NDK_ROOT=$NDK_ROOT make droid-rdk.aar # todo: pass down APK + RDK version information - name: build APKs working-directory: rdk-apk @@ -92,6 +89,12 @@ jobs: glob: rdk-apk-latest.*.apk destination: packages.viam.com/apps/rdk-apk parent: false + - name: sentry ok + if: success() + run: curl ${{ secrets.SENTRY_CRONS }}?status=ok + - name: sentry error + if: failure() + run: curl ${{ secrets.SENTRY_CRONS }}?status=error # todo: get a working token and re-enable this # - uses: slackapi/slack-github-action@v1 # # todo: switch to slack integration when https://github.com/integrations/slack/issues/1563 is resolved (only report errors) diff --git a/Dockerfile b/Dockerfile index 689891b..143aabc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # base image for APK builds -FROM ubuntu:latest +FROM ubuntu:jammy RUN --mount=type=cache,target=/var/cache/apt apt-get update # make...python3 for tflite build @@ -7,11 +7,11 @@ RUN --mount=type=cache,target=/var/cache/apt apt-get update RUN --mount=type=cache,target=/var/cache/apt apt-get install -qy \ zip \ openjdk-21-jdk-headless \ - make curl patch cmake git python3 \ + make curl patch cmake git python3 wget pkg-config \ nasm -ENV ANDROID_HOME /droid -ENV ANDROID_SDK_ROOT /droid +ENV ANDROID_HOME=/droid +ENV ANDROID_SDK_ROOT=/droid WORKDIR ${ANDROID_SDK_ROOT} @@ -19,9 +19,9 @@ WORKDIR ${ANDROID_SDK_ROOT} ARG CLI_TOOLS=commandlinetools-linux-11076708_latest.zip RUN curl --fail --silent --show-error -o ${CLI_TOOLS} https://dl.google.com/android/repository/${CLI_TOOLS} && unzip -q ${CLI_TOOLS} && rm ${CLI_TOOLS} -ENV PATH ${PATH}:/droid/cmdline-tools/bin +ENV PATH=${PATH}:/droid/cmdline-tools/bin ARG NDK_VERSION=26.2.11394342 -ENV NDK_ROOT ${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION} +ENV NDK_ROOT=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION} # note: we target android 28, but compileSdk is 34 in our gradle files; check if both are needed # we're removing unused tools to shrink the image size @@ -30,7 +30,7 @@ RUN yes | sdkmanager --sdk_root=$(realpath .) --install "platforms;android-28" " && rm -rf tools/lib/monitor* \ && rm -rf ${NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/musl -ENV SDKMAN_DIR /usr/local/sdkman +ENV SDKMAN_DIR=/usr/local/sdkman # this is the sdk manager script from https://get.sdkman.io/ # we have a copy checked-in to get a consistent version # todo: look at getting openjdk from here as well @@ -38,8 +38,15 @@ RUN --mount=type=bind,source=etc/get-sdkman.sh,target=get-sdkman.sh ./get-sdkman # requires bash because it uses 'source' keyword internally RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk install gradle 8.2" -# note: actions/setup-go fails at the jni step in a way I don't understand. apt getting for now. -ENV PATH ${PATH}:/usr/lib/go-1.21/bin:/root/go/bin -RUN --mount=type=cache,target=/var/cache/apt apt-get install -qy golang-1.21-go +# note: actions/setup-go fails at the jni step in a way I don't understand. manually installing for now. +ARG GO_VERSION=1.23.2 +RUN wget --quiet https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz \ + && tar xf go*.linux-*.tar.gz -C /usr/local/lib \ + && mv /usr/local/lib/go /usr/local/lib/go-${GO_VERSION} \ + && rm go*.linux-*.tar.gz \ + && update-alternatives --install /usr/bin/go go /usr/local/lib/go-${GO_VERSION}/bin/go 10 \ + --slave /usr/bin/gofmt gofmt /usr/local/lib/go-${GO_VERSION}/bin/gofmt + # todo: pin gomobile in rdk tools.go +ENV PATH=${PATH}:/root/go/bin RUN go install golang.org/x/mobile/cmd/gomobile@latest && gomobile init