Skip to content

Commit

Permalink
Merge branch 'dev' (0.5.4-1)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosabalde committed Feb 19, 2025
2 parents 57a879d + 22e0fc9 commit 7d5124a
Show file tree
Hide file tree
Showing 16 changed files with 311 additions and 222 deletions.
31 changes: 1 addition & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- jammy
- bookworm
- rhel9
- rhel8
architecture:
- amd64

Expand Down Expand Up @@ -57,36 +58,6 @@ jobs:
- uses: actions/checkout@v4

- uses: ./extras/github/build-action
id: attempt1
continue-on-error: true
with:
platform: ${{ matrix.platform }}
architecture: ${{ matrix.architecture }}
go-version: ${{ env.GO_VERSION }}

# XXX: for ARM64 builds, jobs occasionally fail with an error suggesting
# that Docker is not ready. This is a workaround to retry the build once.
# >Run ./extras/github/build-action
# >Run docker/setup-buildx-action@v3
# >Docker info
# >Buildx version
# >Inspecting default docker context
# >Creating a new builder instance
# Error: ERROR: failed to initialize builder builder-7cfe3cdd-acf8-4116-a011-40173ca3d469
# (builder-7cfe3cdd-acf8-4116-a011-40173ca3d4690): Cannot connect to the Docker daemon at
# unix:///var/run/docker.sock. Is the docker daemon running?
- uses: ./extras/github/build-action
if: steps.attempt1.outcome == 'failure'
id: attempt2
continue-on-error: true
with:
platform: ${{ matrix.platform }}
architecture: ${{ matrix.architecture }}
go-version: ${{ env.GO_VERSION }}

# XXX: same as above, but for the second retry.
- uses: ./extras/github/build-action
if: steps.attempt2.outcome == 'failure'
with:
platform: ${{ matrix.platform }}
architecture: ${{ matrix.architecture }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.env
/coverage.txt
/build/
/duckdb-static-bundle/
/assets/webpack/node_modules/
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
- 0.5.4-1 (2025-02-19):
+ Updated dependencies.
* DuckDB 1.1.3 ➙ 1.2.0
* uv 0.5.27 ➙ 0.6.0
* Go
- client_golang 1.20.5 ➙ 1.21.0
- cobra 1.8.1 ➙ 1.9.1
- fasthttp 1.58.0 ➙ 1.59.0
* Node.js 22.13.1 ➙ 22.14.0
- eslint 9.20.0 ➙ 9.20.1
- plotly.js-dist 3.0.0 ➙ 3.0.1
- postcss 8.5.1 ➙ 8.5.2
- sass 1.84.0 ➙ 1.85.0
- sass-loader 16.0.4 ➙ 16.0.5
- webpack 5.97.1 ➙ 5.98.0
+ Added support for `rhel8` packaging in AMD64 architecture.

- 0.5.3-1 (2025-02-13):
+ Fixed step calculation when scraper is disabled (i.e., no scraping period available).

Expand Down
67 changes: 59 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := /bin/bash
ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
UMASK := 022

VERSION := 0.5.3
VERSION := 0.5.4
ITERATION := 1
REVISION := $(shell cd '$(ROOT)' && git rev-parse --short HEAD)
ENVIRONMENT ?= production
Expand All @@ -13,6 +13,21 @@ ARCHITECTURE := $(shell go env GOARCH)

export GO111MODULE

# Precompiled DuckDB static bundles work fine for all platforms except RHEL 8
# due to an outdated glibc version. In this case, the bundle is built on demand
# (see the 'duckdb-static-bundle' target). This is a costly operation, so GitHub
# Actions caching is used to populate 'duckdb-static-bundle/libduckdb_bundle.a'
# and avoid rebuilding the bundle on every run (see
# 'extras/github/build-action/action.yml').
ifeq ($(PLATFORM),rhel8)
CGO_LDFLAGS=-lstdc++ -lm -ldl -lduckdb_bundle -L$(ROOT)/duckdb-static-bundle/
GO_BUILD_TAGS=duckdb_use_static_lib
else
CGO_LDFLAGS=
GO_BUILD_TAGS=
endif
export CGO_LDFLAGS

FPM = \
fpm -s dir \
--name varnishmon \
Expand All @@ -26,7 +41,7 @@ FPM = \
--config-files /etc/varnish/varnishmon.yml

.PHONY: build
build: mrproper
build: mrproper duckdb-static-bundle
@( \
set -e; \
\
Expand All @@ -40,7 +55,12 @@ build: mrproper
echo '> Building...'; \
for CMD in '$(ROOT)/cmd/'*; do \
echo "- $$CMD (linux $(ARCHITECTURE))"; \
GOOS=linux GOARCH=$(ARCHITECTURE) go build -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \
GOOS=linux GOARCH=$(ARCHITECTURE) go build \
-tags=$(GO_BUILD_TAGS) \
-trimpath \
-ldflags "$$LD_FLAGS" \
-o build/bin/$${CMD##*/} \
./cmd/$${CMD##*/}; \
done; \
)

Expand Down Expand Up @@ -85,7 +105,7 @@ TEST_PACKAGES ?= '$(ROOT)/...'
TEST_PATTERN ?= .

.PHONY: test
test:
test: duckdb-static-bundle
@( \
set -e; \
\
Expand All @@ -97,6 +117,7 @@ test:
-coverprofile=$(ROOT)/coverage.txt \
-covermode=atomic \
-run '$(TEST_PATTERN)' \
-tags=$(GO_BUILD_TAGS) \
-timeout=2m; \
)

Expand Down Expand Up @@ -134,7 +155,8 @@ dist: build
umask $(UMASK); \
\
[ '$(PLATFORM)' = 'noble' -o '$(PLATFORM)' = 'jammy' -o \
'$(PLATFORM)' = 'bookworm' -o '$(PLATFORM)' = 'rhel9' ] || \
'$(PLATFORM)' = 'bookworm' -o '$(PLATFORM)' = 'rhel9' -o \
'$(PLATFORM)' = 'rhel8' ] || \
{ echo >&2 'Invalid platform ($(PLATFORM))'; exit 1; }; \
\
[ '$(ENVIRONMENT)' = 'production' ] || \
Expand Down Expand Up @@ -179,7 +201,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),noble jammy bookworm))
cp '$(ROOT)/extras/packaging/debian/varnishmon.logrotate' '$(ROOT)/build/dist/etc/logrotate.d/varnishmon'; \
cp '$(ROOT)/extras/packaging/debian/varnishmon.service' '$(ROOT)/build/dist/lib/systemd/system/'; \
)
else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9))
else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9 rhel8))
@( \
set -e; \
umask $(UMASK); \
Expand Down Expand Up @@ -226,7 +248,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),noble jammy bookworm))
--config-files /etc/logrotate.d/varnishmon \
-C '$(ROOT)/build/dist' .; \
)
else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9))
else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9 rhel8))
@( \
set -e; \
umask $(UMASK); \
Expand Down Expand Up @@ -265,10 +287,39 @@ webpack-build:
npm run build; \
)

# Beware of the hardcoded DuckDB version in the 'git clone' command. See:
# https://github.com/marcboeker/go-duckdb/blob/main/.github/workflows/deps.yaml.
.PHONY: duckdb-static-bundle
duckdb-static-bundle:
@( \
set -e; \
\
if [ ! -f '$(ROOT)/duckdb-static-bundle/libduckdb_bundle.a' ]; then \
if [ '$(PLATFORM)' = 'rhel8' ]; then \
echo '> Building DuckDB static bundle for RHEL8...'; \
rm -rf /tmp/duckdb; \
git clone -b v1.1.3 --depth 1 https://github.com/duckdb/duckdb.git /tmp/duckdb; \
cd /tmp/duckdb; \
CFLAGS='-O3' \
CXXFLAGS='-O3' \
BUILD_SHELL=0 \
BUILD_UNITTESTS=0 \
DUCKDB_PLATFORM=any \
ENABLE_EXTENSION_AUTOLOADING=1 \
ENABLE_EXTENSION_AUTOINSTALL=1 \
BUILD_EXTENSIONS='json' \
make bundle-library -j 2; \
\
mkdir -p '$(ROOT)/duckdb-static-bundle'; \
cp /tmp/duckdb/build/release/libduckdb_bundle.a '$(ROOT)/duckdb-static-bundle'; \
fi; \
fi; \
)

.PHONY: mrproper
mrproper:
@( \
echo '> Cleaning up...'; \
rm -rf '$(ROOT)/build'; \
git clean -f -x -d -e .env -e assets/webpack/node_modules -e varnishmon.db $(ROOT); \
git clean -f -x -d -e .env -e assets/webpack/node_modules -e duckdb-static-bundle -e varnishmon.db $(ROOT); \
)
82 changes: 41 additions & 41 deletions assets/static/app.js

Large diffs are not rendered by default.

Loading

0 comments on commit 7d5124a

Please sign in to comment.