From dc064eeffae3032479c113985dc28fb20ee7304c Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 14 Aug 2024 16:43:57 +1000 Subject: [PATCH] Remove `march=native`. Build executable outside. --- .github/workflows/ci.yml | 14 +++++++------- Dockerfile | 12 +----------- build.gradle.kts | 1 - 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3103626..ce83864 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,16 +51,16 @@ jobs: steps: - uses: actions/checkout@v4 -# - uses: graalvm/setup-graalvm@v1 -# with: -# distribution: 'graalvm-community' -# java-version: '22' -# github-token: ${{ secrets.GITHUB_TOKEN }} + - uses: graalvm/setup-graalvm@v1 + with: + distribution: 'graalvm-community' + java-version: '22' + github-token: ${{ secrets.GITHUB_TOKEN }} - uses: gradle/actions/setup-gradle@v4 -# - name: Build GraalVM native executable -# run: ./gradlew nativeCompile --no-configuration-cache + - name: Build GraalVM native executable + run: ./gradlew nativeCompile --no-configuration-cache - uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 838e05d..b505c5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,5 @@ -# Build stage -FROM ghcr.io/graalvm/graalvm-community:22 AS build - -WORKDIR /app - -COPY . . - -RUN ./gradlew nativeCompile --no-configuration-cache - -# Runtime stage FROM ubuntu:latest -COPY --from=build /app/build/native/nativeCompile/kstreamlined-backend /app/kstreamlined-backend +COPY build/native/nativeCompile/kstreamlined-backend /app/kstreamlined-backend ENTRYPOINT ["/app/kstreamlined-backend"] diff --git a/build.gradle.kts b/build.gradle.kts index 5404dc1..4a21f22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,7 +36,6 @@ graalvmNative { resources.autodetect() buildArgs( "-R:MaxHeapSize=100m", - "-march=native", ) } }