Skip to content

Commit

Permalink
Adding VersionStream for clickhouse-24.10 (wolfi-dev#35301)
Browse files Browse the repository at this point in the history
Co-authored-by: octo-sts[bot] <157150467+octo-sts@users.noreply.github.com>
  • Loading branch information
octo-sts[bot] and octo-sts[bot] authored Nov 27, 2024
1 parent ed644b1 commit e82fcfd
Show file tree
Hide file tree
Showing 2 changed files with 247 additions and 0 deletions.
203 changes: 203 additions & 0 deletions clickhouse-24.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
package:
name: clickhouse-24.10
version: 24.10.2.80
epoch: 0
description: ClickHouse is the fastest and most resource efficient open-source database for real-time apps and analytics.
copyright:
- license: Apache-2.0
resources:
cpu: 65
memory: 32Gi
dependencies:
provides:
- clickhouse=${{package.full-version}}

environment:
contents:
packages:
- bash
- build-base
- busybox
- ca-certificates-bundle
- clang-17
- clang-17-dev
- cmake
- coreutils
- findutils
- git
- grep
- llvm-libcxx-17
- llvm-libcxx-17-dev
- llvm-lld-17
- llvm-lld-17-dev
- nasm
- ninja
- openssf-compiler-options
- perl
- python3
- yasm

pipeline:
- uses: git-checkout
with:
repository: https://github.com/ClickHouse/ClickHouse
tag: v${{package.version}}-stable
expected-commit: 024d41a1f4325ad3b5bda333279990cc613de4f9

# The default build script is defensive and tries to protect against defining cflags.
- uses: patch
with:
patches: allow_cflags.patch

- runs: |
git submodule update --init
mkdir build
cd build
cmake \
-DCOMPILER_CACHE=disabled \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DNO_ARMV81_OR_HIGHER=1 \
-DCMAKE_INSTALL_LIBDIR=lib \
..
- runs: |
cd build
ninja -j $(nproc)
mkdir -p ${{targets.destdir}}/var/lib/clickhouse
mkdir -p ${{targets.destdir}}/var/log/clickhouse-server
DESTDIR=${{targets.destdir}} ninja install
rm -rf ${{targets.destdir}}/usr/lib/debug
- uses: strip

subpackages:
- name: "${{package.name}}-dev"
description: "headers for clickhouse"
pipeline:
- uses: split/dev

- name: "${{package.name}}-bash-completion"
description: "bash completion for clickhouse"
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/share/bash-completion/completions
mv ${{targets.destdir}}/usr/share/bash-completion/completions/clickhouse ${{targets.subpkgdir}}/usr/share/bash-completion/completions
- name: "${{package.name}}-compat"
description: "docker compat for clickhouse"
pipeline:
- runs: |
cd build
install -Dm755 ../docker/server/entrypoint.sh ${{targets.subpkgdir}}/entrypoint.sh
mkdir -p ${{targets.subpkgdir}}/etc/clickhouse-server/config.d/
cp ../docker/server/docker_related_config.xml ${{targets.subpkgdir}}/etc/clickhouse-server/config.d/docker_related_config.xml
update:
enabled: true
ignore-regex-patterns:
- '-stable$'
github:
identifier: ClickHouse/ClickHouse
tag-filter-prefix: v24.10.
strip-prefix: v
strip-suffix: -stable

test:
environment:
contents:
packages:
- bash
- coreutils
- findutils
- procps # for checking server process
- curl # for HTTP interface testing
pipeline:
# AUTOGENERATED
- runs: |
ch --version
chc --version
chl --version
clickhouse --version
clickhouse-benchmark --help
clickhouse-client --version
clickhouse-compressor --help
clickhouse-disks --version
clickhouse-format version
clickhouse-git-import version
clickhouse-keeper --version
clickhouse-keeper-client --help
clickhouse-keeper-converter --help
clickhouse-library-bridge --help
clickhouse-local --version
clickhouse-obfuscator --help
clickhouse-odbc-bridge --help
clickhouse-server --version
clickhouse-static-files-disk-uploader --help
clickhouse-su --version
ch --help
chc --help
chl --help
clickhouse --help
clickhouse-client --help
clickhouse-disks --help
clickhouse-format help
clickhouse-git-import help
clickhouse-keeper --help
clickhouse-local --help
clickhouse-obfuscator version
clickhouse-server --help
clickhouse-static-files-disk-uploader version
clickhouse-su --help
- name: "Test server startup and basic operation"
runs: |
# Start server in background
clickhouse-server --daemon
sleep 5
# Verify server is running
pgrep -f clickhouse-server
- name: "Test basic SQL queries via client"
runs: |
# Test CREATE DATABASE
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS test"
# Test CREATE TABLE
clickhouse-client --query "CREATE TABLE test.sample (id UInt32, name String) ENGINE = MergeTree() ORDER BY id"
# Test INSERT
clickhouse-client --query "INSERT INTO test.sample VALUES (1, 'test')"
# Test SELECT
clickhouse-client --query "SELECT * FROM test.sample" | grep -q "test"
- name: "Test local mode operations"
runs: |
# Test query processing in local mode
echo "1,test" | clickhouse-local --structure "id UInt32, name String" --query "SELECT * FROM table" --input-format CSV | grep -q "test"
- name: "Test HTTP interface"
runs: |
# Test basic HTTP query
curl -s "http://localhost:8123/?query=SELECT%201" | grep -q "1"
# Test database creation via HTTP
curl -s -X POST "http://localhost:8123/?query=CREATE%20DATABASE%20IF%20NOT%20EXISTS%20http_test"
- name: "Test system tables access"
runs: |
# Check access to system tables
clickhouse-client --query "SELECT * FROM system.databases WHERE name = 'system'" | grep -q "system"
clickhouse-client --query "SELECT * FROM system.tables WHERE database = 'system' LIMIT 1"
- name: "Test data types handling"
runs: |
clickhouse-client --query "
CREATE TABLE IF NOT EXISTS test.types (
int8_col Int8,
uint64_col UInt64,
float_col Float64,
string_col String,
date_col Date
) ENGINE = MergeTree() ORDER BY int8_col"
clickhouse-client --query "
INSERT INTO test.types VALUES
(1, 18446744073709551615, 3.14159, 'test string', '2024-01-01')"
clickhouse-client --query "SELECT * FROM test.types" | grep -q "test string"
- name: "Test benchmark utility"
runs: |
# Simple benchmark test with default options
clickhouse-benchmark --query "SELECT 1" --iterations 10
# Test with concurrency
clickhouse-benchmark --concurrency 2 --query "SELECT number FROM system.numbers LIMIT 10" --iterations 3
44 changes: 44 additions & 0 deletions clickhouse-24.10/allow_cflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- a/PreLoad.cmake
+++ b/PreLoad.cmake
@@ -15,41 +15,6 @@ if (NOT DEFINED ENV{XCODE_IDE})
endif ()
endif()

-# Check if environment is polluted.
-if (NOT "$ENV{CFLAGS}" STREQUAL ""
- OR NOT "$ENV{CXXFLAGS}" STREQUAL ""
- OR NOT "$ENV{LDFLAGS}" STREQUAL ""
- OR CMAKE_C_FLAGS OR CMAKE_CXX_FLAGS OR CMAKE_EXE_LINKER_FLAGS OR CMAKE_MODULE_LINKER_FLAGS
- OR CMAKE_C_FLAGS_INIT OR CMAKE_CXX_FLAGS_INIT OR CMAKE_EXE_LINKER_FLAGS_INIT OR CMAKE_MODULE_LINKER_FLAGS_INIT)
-
- # if $ENV
- message("CFLAGS: $ENV{CFLAGS}")
- message("CXXFLAGS: $ENV{CXXFLAGS}")
- message("LDFLAGS: $ENV{LDFLAGS}")
- # if *_FLAGS
- message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
- message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
- message("CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
- message("CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}")
- message("CMAKE_MODULE_LINKER_FLAGS: ${CMAKE_MODULE_LINKER_FLAGS}")
- # if *_FLAGS_INIT
- message("CMAKE_C_FLAGS_INIT: ${CMAKE_C_FLAGS_INIT}")
- message("CMAKE_CXX_FLAGS_INIT: ${CMAKE_CXX_FLAGS_INIT}")
- message("CMAKE_EXE_LINKER_FLAGS_INIT: ${CMAKE_EXE_LINKER_FLAGS_INIT}")
- message("CMAKE_MODULE_LINKER_FLAGS_INIT: ${CMAKE_MODULE_LINKER_FLAGS_INIT}")
-
- message(FATAL_ERROR "
- Some of the variables like CFLAGS, CXXFLAGS, LDFLAGS are not empty.
- It is not possible to build ClickHouse with custom flags.
- These variables can be set up by previous invocation of some other build tools.
- You should cleanup these variables and start over again.
-
- Run the `env` command to check the details.
- You will also need to remove the contents of the build directory.
-
- Note: if you don't like this behavior, you can manually edit the cmake files, but please don't complain to developers.")
-endif()
-
# Default toolchain - this is needed to avoid dependency on OS files.
execute_process(COMMAND uname -s OUTPUT_VARIABLE OS)
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH)

0 comments on commit e82fcfd

Please sign in to comment.