diff --git a/.github/actions/build-and-tag-locally/action.yml b/.github/actions/build-and-tag-locally/action.yml index 70c2a052f..b169108c9 100644 --- a/.github/actions/build-and-tag-locally/action.yml +++ b/.github/actions/build-and-tag-locally/action.yml @@ -88,6 +88,7 @@ runs: password: ${{ inputs.registry_password }} - name: Build + id: build uses: docker/build-push-action@v6 with: context: ${{ inputs.distribution }} @@ -97,6 +98,59 @@ runs: tags: ${{ github.sha }}:${{ steps.platform.outputs.display_name }} cache-from: type=gha cache-to: type=gha,mode=max + env: + BUILDKIT_PROGRESS: plain + + - name: Capture build logs on failure + shell: bash + if: failure() && steps.build.outcome == 'failure' + run: | + mkdir -p /tmp/build-logs + + echo "Build failed for ${{ inputs.distribution }} on ${{ inputs.platform }}" + echo "Capturing detailed logs for troubleshooting..." + + # Get docker history for the built image (might not exist if build failed early) + docker history ${{ github.sha }}:${{ steps.platform.outputs.display_name }} > /tmp/build-logs/image-history.log 2>&1 || echo "Failed to get image history" + + # Get docker inspect output (might not exist if build failed early) + docker inspect ${{ github.sha }}:${{ steps.platform.outputs.display_name }} > /tmp/build-logs/image-inspect.json 2>&1 || echo "Failed to inspect image" + + # Get docker build cache info + docker buildx du > /tmp/build-logs/buildx-du.log 2>&1 || echo "Failed to get build cache info" + + # Get system info + uname -a > /tmp/build-logs/system-info.log 2>&1 + docker info > /tmp/build-logs/docker-info.log 2>&1 + + # Create a summary file + { + echo "Build failure summary for ${{ inputs.distribution }} on ${{ inputs.platform }}" + echo "Date: $(date)" + echo "GitHub SHA: ${{ github.sha }}" + echo "Platform: ${{ steps.platform.outputs.display_name }}" + echo "Distribution: ${{ inputs.distribution }}" + } > /tmp/build-logs/failure-summary.txt + + # Try to extract error information from the build logs + echo "Analyzing build failure..." + + # Check for common error patterns + if docker buildx build --no-cache ${{ inputs.distribution }} --platform=${{ inputs.platform }} 2>&1 | tee /tmp/build-logs/build-error.log | grep -q "ERROR"; then + echo "Found ERROR in build output" + grep -A 10 -B 5 "ERROR" /tmp/build-logs/build-error.log > /tmp/build-logs/error-context.log || true + fi + + echo "Log capture complete" + + - name: Upload build failure logs + if: failure() && steps.build.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: build-failure-${{ steps.platform.outputs.display_name }}-${{ inputs.distribution }} + path: /tmp/build-logs/ + retention-days: 30 + if-no-files-found: warn - name: Save image shell: bash @@ -203,13 +257,3 @@ runs: echo "ReJSON test failed: expected 'allkeys-lru', got $result" exit 1 fi - - - name: Push image - uses: docker/build-push-action@v6 - if: ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }} - with: - context: ${{ inputs.distribution }} - push: true - tags: ${{ inputs.registry_repository }}:${{ github.sha }}-${{ inputs.distribution }} - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/pre-merge.yml b/.github/workflows/pre-merge.yml index 0357891ac..3a458e320 100644 --- a/.github/workflows/pre-merge.yml +++ b/.github/workflows/pre-merge.yml @@ -1,15 +1,15 @@ -name: Build and Test +name: Build and Test Unstable on: pull_request: branches: - - master - - release/* + - unstable workflow_call: jobs: build-and-test: - runs-on: ${{ contains(matrix.platform, 'arm64') && 'ubuntu24-arm64-2-8' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' strategy: + fail-fast: false matrix: distribution: - debian @@ -23,7 +23,7 @@ jobs: - linux/mips64le - linux/ppc64le - linux/s390x - - linux/arm64 +# - linux/arm64 # Currently the unstable isn't running on arm64 - linux/riscv64 exclude: - distribution: alpine diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 4c2755cba..9ed1dfbca 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -14,8 +14,7 @@ RUN set -eux; \ # we need setpriv package as busybox provides very limited functionality setpriv \ ; -ENV REDIS_DOWNLOAD_URL=https://github.com/redis/redis/archive/refs/tags/8.0.0.tar.gz -ENV REDIS_DOWNLOAD_SHA=6d1b428d289426b68cff933d61f2d5c0a44a316f17236c51fbb33bc9e5c5a385 +ENV REDIS_DOWNLOAD_URL=https://github.com/redis/redis/archive/refs/heads/unstable.tar.gz RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ @@ -70,11 +69,18 @@ RUN set -eux; \ # install required python packages for RedisJSON module pip install -q --upgrade setuptools && pip install -q --upgrade pip && PIP_BREAK_SYSTEM_PACKAGES=1 pip install -q addict toml jinja2 ramp-packer ;\ wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \ - echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; \ mkdir -p /usr/src/redis; \ tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; \ rm redis.tar.gz; \ \ + # Update module versions to master - will be removed once modules are updated to latest version on redis unstable. RED-159986 + if [ "$BUILD_WITH_MODULES" = "yes" ]; then \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisbloom/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisjson/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisearch/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redistimeseries/Makefile; \ + fi; \ + \ # disable Redis protected mode [1] as it is unnecessary in context of Docker # (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P) # [1]: https://github.com/redis/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da diff --git a/debian/Dockerfile b/debian/Dockerfile index 469bde1a7..456d797c6 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -14,8 +14,7 @@ RUN set -eux; \ ; \ rm -rf /var/lib/apt/lists/* -ENV REDIS_DOWNLOAD_URL=https://github.com/redis/redis/archive/refs/tags/8.0.0.tar.gz -ENV REDIS_DOWNLOAD_SHA=6d1b428d289426b68cff933d61f2d5c0a44a316f17236c51fbb33bc9e5c5a385 +ENV REDIS_DOWNLOAD_URL=https://github.com/redis/redis/archive/refs/heads/unstable.tar.gz RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -56,11 +55,18 @@ RUN set -eux; \ rm -rf /var/lib/apt/lists/*; \ \ wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \ - echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; \ mkdir -p /usr/src/redis; \ tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; \ rm redis.tar.gz; \ \ + # Update module versions to master - will be removed once modules are updated to latest version on redis unstable. RED-159986 + if [ "$BUILD_WITH_MODULES" = "yes" ]; then \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisbloom/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisjson/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redisearch/Makefile; \ + sed -i 's/^MODULE_VERSION = .*/MODULE_VERSION = master/' /usr/src/redis/modules/redistimeseries/Makefile; \ + fi; \ + \ # disable Redis protected mode [1] as it is unnecessary in context of Docker # (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P) # [1]: https://github.com/redis/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da