Skip to content

Commit f0be71b

Browse files
committed
RPM builder
1 parent f45398b commit f0be71b

File tree

8 files changed

+1178
-632
lines changed

8 files changed

+1178
-632
lines changed

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM centos:latest
2+
3+
# Create work & result dirs
4+
RUN mkdir -p /clickhouse
5+
RUN mkdir -p /clickhouse/result
6+
7+
WORKDIR /clickhouse
8+
9+
# Install ClickHouse from local RPMs
10+
COPY /rpmbuild/RPMS/x86_64/clickhouse-* /clickhouse/
11+
RUN yum localinstall -y /clickhouse/*.rpm
12+
13+
# Install dependencies for clickhouse-test itself
14+
RUN yum install -y epel-release
15+
RUN yum install -y python-lxml
16+
RUN yum install -y python-requests
17+
RUN yum install -y python2-pip
18+
RUN pip install termcolor
19+
20+
# Install dependencies required by test scripts
21+
RUN yum install -y perl
22+
RUN yum install -y sudo
23+
24+
# Install main script
25+
COPY /runscript.sh /clickhouse/
26+
RUN chmod a+x /clickhouse/runscript.sh
27+
28+
29+
# Launch entrypoint
30+
#CMD "/usr/bin/clickhouse-test > /clickhouse/result/result.txt 2>&1"
31+
#CMD "/bin/bash"
32+
CMD "./runscript.sh"
33+
34+
MAINTAINER Vladislav Klimenko
35+
LABEL version="0.1"
36+
LABEL description="Install ClickHouse RPMs and run clickhouse-test in order to verify RPMs are operational"
37+
38+
# IMAGE_NAME=clickhouse_test_$(date +%s)
39+
# sudo docker build -t $IMAGE_NAME .
40+
# sudo docker run -it --mount src="$(pwd)",target=/clickhouse/result,type=bind $IMAGE_NAME
41+
42+
#/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml
43+
#/usr/bin/clickhouse-test > /clickhouse/result/out.txt
44+
45+
46+
#docker run --ulimit nofile=90000:90000 <image-tag>
47+
#
48+
#First 90000 is soft limit, second 90000 is hard limit. When you launch the container, of course with -it flag, and enter command ulimit -n you’ll see the limit is 90000 now.
49+

README.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,54 @@ Run `build.sh` on any RHEL 6 or RHEL 7 based distribution and get ClickHouse sou
1111
```bash
1212
Usage:
1313

14-
./build.sh version - display default version to build
14+
./builder version
15+
display default version to build
1516

16-
./build.sh all - most popular point of entry - the same as idep_all
17+
./builder all
18+
install build deps, download sources, build RPMs
19+
./builder all --test
20+
install build+test deps, download sources, build+test and test RPMs
1721

18-
./build.sh idep_all - install dependencies from RPMs, download CH sources and build RPMs
19-
./build.sh bdep_all - build dependencies from sources, download CH sources and build RPMs
20-
!!! YOU MAY NEED TO UNDERSTAND INTERNALS !!!
22+
./builder install --build-deps
23+
install build dependencies
24+
./builder install --test-deps
25+
install test dependencies
26+
./builder install --deps
27+
install all dependencies (both build and test)
28+
./builder install --rpms [--from-sources]
29+
install RPMs, if available (do not build RPMs)
2130

22-
./build.sh install_deps - just install dependencies (do not download sources, do not build RPMs)
23-
./build.sh build_deps - just build dependencies (do not download sources, do not build RPMs)
24-
./build.sh src - just download sources
25-
./build.sh spec - just create SPEC file (do not download sources, do not build RPMs)
26-
./build.sh packages - download sources, create SPEC file and build RPMs (do not install dependencies)
27-
./build.sh rpms - just build RPMs from .zip sourcesi
28-
(do not download sources, do not create SPEC file, do not install dependencies)
29-
MYSRC=yes ./build.sh rpms - just build RPMs from unpacked sources - most likely you have modified them
30-
(do not download sources, do not create SPEC file, do not install dependencies)
31+
./builder build --spec
32+
just create SPEC file
33+
do not download sources, do not build RPMs
34+
./builder build --rpms [--test]
35+
download sources, build SPEC file, build RPMs
36+
do not install dependencies
37+
./builder build --rpms --from-archive [--test]
38+
just build RPMs from .zip sources
39+
(do not download sources, do not create SPEC file, do not install dependencies)
40+
./builder build --rpms --from-unpacked-archive [--test]
41+
just build RPMs from unpacked sources - most likely you have modified them
42+
(do not download sources, do not create SPEC file, do not install dependencies)
43+
./builder build --rpms --from-sources [--test]
44+
build from source codes
3145

32-
./build.sh publish packagecloud <packagecloud USER ID> - publish packages on packagecloud as USER
33-
./build.sh delete packagecloud <packagecloud USER ID> - delete packages on packagecloud as USER
46+
./builder test --docker [--from-sources]
47+
build Docker image and install produced RPM files in it. Run clickhouse-test
48+
./builder test --local
49+
install required dependencies and run clickhouse-test on locally installed ClickHouse
50+
./builder test --local-sql
51+
run several SQL queries on locally installed ClickHouse
3452

35-
./build.sh publish ssh - publish packages via SSH
53+
./builder repo --publish --packagecloud=<packagecloud USER ID>
54+
publish packages on packagecloud as USER
55+
./builder repo --delete --packagecloud=<packagecloud USER ID>
56+
delete packages on packagecloud as USER
57+
58+
./builder src --download
59+
just download sources
3660
```
3761
38-
In most cases just run `./build.sh all`
62+
In most cases just run `./builder all`
3963
4064

0 commit comments

Comments
 (0)