Skip to content

Commit b1beabb

Browse files
authored
CircleCI fixes (#13)
1 parent c0d68bb commit b1beabb

File tree

4 files changed

+106
-42
lines changed

4 files changed

+106
-42
lines changed

.circleci/config.yml

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
version: 2.1
22

33
commands:
4+
early-returns:
5+
steps:
6+
- run:
7+
name: Early return if this branch should ignore CI
8+
command: |
9+
if [[ $CIRCLE_BRANCH == *noci ]]; then
10+
echo "Identifies as actively ignoring CI, no testing required."
11+
circleci step halt
12+
fi
13+
414
setup-executor:
515
steps:
616
- run:
@@ -33,11 +43,19 @@ jobs:
3343
machine:
3444
enabled: true
3545
image: ubuntu-2004:202010-01
36-
resource_class: medium
46+
resource_class: large
3747
parameters:
3848
platforms:
3949
type: string
50+
force:
51+
type: string
52+
default: ""
4053
steps:
54+
- early-returns
55+
- run:
56+
name: Skip?
57+
command: |
58+
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder ]]; then circleci step halt; fi
4159
- checkout-all
4260
- run:
4361
name: Setup automation
@@ -51,9 +69,9 @@ jobs:
5169
command: |
5270
cd rmbuilder
5371
for nick in <<parameters.platforms>>; do
54-
sudo bash -l -c "make build X64=1 OSNICK=$nick"
72+
bash -l -c "make build X64=1 OSNICK=$nick"
5573
if [[ $CIRCLE_BRANCH == master ]]; then
56-
sudo bash -l -c "make publish X64=1 OSNICK=$nick"
74+
bash -l -c "make publish X64=1 OSNICK=$nick"
5775
fi
5876
done
5977
no_output_timeout: 30m
@@ -64,7 +82,15 @@ jobs:
6482
parameters:
6583
platform:
6684
type: string
85+
force:
86+
type: string
87+
default: ""
6788
steps:
89+
- early-returns
90+
- run:
91+
name: Skip?
92+
command: |
93+
[[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder ]] && circleci step halt
6894
- setup-executor
6995
- checkout-all
7096
- setup-automation
@@ -78,6 +104,44 @@ jobs:
78104
fi
79105
no_output_timeout: 30m
80106

107+
clang-builder:
108+
machine:
109+
enabled: true
110+
image: ubuntu-2004:202010-01
111+
resource_class: large
112+
parameters:
113+
force:
114+
type: string
115+
default: ""
116+
steps:
117+
- early-returns
118+
- run:
119+
name: Skip?
120+
command: |
121+
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *clang ]]; then circleci step halt; fi
122+
- checkout-all
123+
- run:
124+
name: Setup automation
125+
command: |
126+
sudo ./deps/readies/bin/getpy3
127+
sudo ./deps/readies/bin/getdocker --just-enable-exp
128+
docker version
129+
- run:
130+
name: Build
131+
command: |
132+
cd clang
133+
bash -l -c "make build"
134+
no_output_timeout: 30m
135+
- run:
136+
name: Publish
137+
command: |
138+
cd clang
139+
if [[ $CIRCLE_BRANCH == master ]]; then
140+
docker login --username redisfab --password "$DOCKER_REDISFAB_PWD"
141+
bash -l -c "make publish"
142+
fi
143+
no_output_timeout: 30m
144+
81145
#----------------------------------------------------------------------------------------------------------------------------------
82146

83147
on-any-branch: &on-any-branch
@@ -161,6 +225,14 @@ workflows:
161225
parameters:
162226
platform: [centos7, centos8, focal, bionic, xenial]
163227
context: common
228+
- clang-builder:
229+
<<: *not-on-integ-branch
230+
context: common
231+
- clang-builder:
232+
name: integ-clang-builder
233+
<<: *on-integ-branch
234+
context: common
235+
force: "1"
164236
weekly:
165237
triggers:
166238
- schedule:
@@ -173,10 +245,16 @@ workflows:
173245
- platform-vm-builder:
174246
name: weekly-vm-build
175247
platforms: "bullseye"
248+
force: "1"
176249
context: common
177250
- platform-docker-builder:
178251
name: weekly-docker-build-<< matrix.platform >>
179252
matrix:
180253
parameters:
181254
platform: [buster, centos7, centos8, focal, bionic, xenial]
255+
force: "1"
256+
context: common
257+
- clang-builder:
258+
name: weekly-clang-builder
182259
context: common
260+
force: "1"

clang/Dockerfile

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# BUILD redisfab/clang:${CLANG_VER}-${ARCH}-${OSNICK}
22

3-
ARG OSNICK=stretch
4-
ARG CLANG_VER=12
5-
ARG CMAKE_VER=3.18.3
3+
ARG OSNICK=bullseye
4+
ARG CLANG_VER=13
65
ARG NINJA_VER=1.10.1
7-
ARG REDIS_VER=6
86

97
#----------------------------------------------------------------------------------------------
108
FROM debian:$OSNICK
@@ -13,23 +11,32 @@ ARG OSNICK
1311
ARG CLANG_VER
1412
ARG CMAKE_VER
1513
ARG NINJA_VER
16-
ARG REDIS_VER
1714

1815
WORKDIR /build
1916
SHELL ["/bin/bash", "-c"]
2017

2118
#----------------------------------------------------------------------------------------------
22-
# Install Clang and prerequisites
19+
# Install prerequisites
2320

2421
RUN apt-get -qq update
2522
RUN apt-get install -y ca-certificates curl wget
2623
RUN apt-get install -y software-properties-common apt-transport-https
2724
RUN apt-get install -y git unzip lsb-release gnupg2 wget
2825

29-
RUN wget https://people.debian.org/~paravoid/python-all/unofficial-python-all.asc -O /etc/apt/trusted.gpg.d/unofficial-python-all.asc
30-
RUN echo "deb http://people.debian.org/~paravoid/python-all $(lsb_release -sc) main" >> /etc/apt/sources.list.d/python-all.list
31-
RUN apt update
32-
RUN apt-get install -y python3.6
26+
RUN git clone https://github.com/RedisLabsModules/readies.git
27+
28+
RUN ./readies/bin/getpy3
29+
RUN ./readies/bin/getcmake --usr
30+
31+
# install ninja
32+
RUN set -e ;\
33+
cd /tmp ;\
34+
wget -q https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}/ninja-linux.zip ;\
35+
unzip ninja-linux.zip ;\
36+
mv ninja /usr/local/bin/ninja
37+
38+
#----------------------------------------------------------------------------------------------
39+
# Install Clang
3340

3441
RUN set -e ;\
3542
wget -q https://apt.llvm.org/llvm.sh ;\
@@ -45,18 +52,6 @@ RUN set -e ;\
4552
cd /usr/bin ;\
4653
for f in llvm*-$CLANG_VER clang*-$CLANG_VER; do ln -sf $f ${f/%-$CLANG_VER/}; done
4754

48-
# install cmake
49-
RUN set -e ;\
50-
wget -q -O /tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh ;\
51-
sh /tmp/cmake.sh --skip-license --prefix=/usr/local
52-
53-
# install ninja
54-
RUN set -e ;\
55-
cd /tmp ;\
56-
wget -q https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}/ninja-linux.zip ;\
57-
unzip ninja-linux.zip ;\
58-
mv ninja /usr/local/bin/ninja
59-
6055
# build llvm for msan into /opt/llvm-project/build-msan
6156
RUN set -e ;\
6257
cd /opt ;\
@@ -75,17 +70,12 @@ RUN set -e ;\
7570
#----------------------------------------------------------------------------------------------
7671
# Build Redis with asan/msan instrumentation
7772

78-
RUN git clone https://github.com/RedisLabsModules/readies.git
79-
RUN wget -q -O /tmp/get-pip.py https://bootstrap.pypa.io/pip/3.5/get-pip.py
80-
RUN chmod +x /tmp/get-pip.py
81-
RUN python3 /tmp/get-pip.py
82-
RUN python3 -m pip install -r readies/paella/requirements.txt
83-
8473
ADD redis.blacklist /build/
8574

8675
# build sanitizer-enabled redis-server(s)
8776
# `--no-run` because Clang sanitizer requires SYS_PTRACE docker capability, which is not available in docker build
88-
RUN ./readies/bin/getredis --no-run -v6.0 --suffix asan-6.0 --clang-asan --clang-san-blacklist /build/redis.blacklist
89-
RUN ./readies/bin/getredis --no-run -v6.0 --suffix msan-6.0 --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist
90-
RUN ./readies/bin/getredis --no-run -v6.2 --suffix asan-6.2 --clang-asan --clang-san-blacklist /build/redis.blacklist
91-
RUN ./readies/bin/getredis --no-run -v6.2 --suffix msan-6.2 --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist
77+
RUN set -e ;\
78+
for redis_ver in 6.0 6.2; do \
79+
./readies/bin/getredis --no-run -v $redis_ver --suffix asan-${redis_ver} --own-openssl --clang-asan --clang-san-blacklist /build/redis.blacklist ;\
80+
./readies/bin/getredis --no-run -v $redis_ver --suffix msan-${redis_ver} --own-openssl --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist ;\
81+
done

clang/Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11

2-
CLANG_VER ?= 12
2+
CLANG_VER ?= 13
33
OSNICK ?= bullseye
44
ARCH=x64
5-
REDIS_VER=6
65

76
IMAGE=redisfab/clang:$(CLANG_VER)-$(ARCH)-$(OSNICK)
8-
ifneq ($(REDIS_VER),6)
9-
IMAGE=redisfab/clang:$(CLANG_VER)-$(ARCH)-$(OSNICK)-$(REDIS_VER)
10-
endif
117
VIEW=/w
128

139
build:
14-
docker build -t $(IMAGE) --build-arg CLANG_VER=$(CLANG_VER) --build-arg OSNICK=$(OSNICK) --build-arg REDIS_VER=$(REDIS_VER) .
10+
docker build -t $(IMAGE) --build-arg CLANG_VER=$(CLANG_VER) --build-arg OSNICK=$(OSNICK) .
1511

1612
publish:
1713
docker push $(IMAGE)

0 commit comments

Comments
 (0)