Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use centos7 instead of ubuntu for ci #392

Merged
merged 4 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions docker/builder/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions docker/builder/Dockerfile-tics

This file was deleted.

8 changes: 0 additions & 8 deletions docker/builder/Dockerfile-tics-base

This file was deleted.

17 changes: 0 additions & 17 deletions docker/builder/Makefile

This file was deleted.

9 changes: 9 additions & 0 deletions release-centos7/Dockerfile-builder-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM hub.pingcap.net/tiflash/tiflash-builder:latest

USER root
WORKDIR /root/

ENV HOME /root/

COPY tiflash/libtiflash_proxy.so /libtiflash-proxy/libtiflash_proxy.so
COPY tiflash/flash_cluster_manager /flash_cluster_manager
22 changes: 14 additions & 8 deletions release-centos7/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
build_release:
docker run --rm -v $(realpath ..):/tics hub.pingcap.net/tiflash/tiflash-builder /tics/release-centos7/build/build-release.sh

image_builder:
image_builder_release:
docker build -f Dockerfile-builder -t hub.pingcap.net/tiflash/tiflash-builder .

push_image_builder:
docker push hub.pingcap.net/tiflash/tiflash-builder
image_builder_ci:
docker run --rm -v $(realpath ..):/tics hub.pingcap.net/tiflash/tiflash-builder /tics/release-centos7/build/build-ci.sh
docker build -f Dockerfile-builder-ci -t hub.pingcap.net/tiflash/tiflash-builder-ci .

build_tiflash_release:
docker run --rm -v $(realpath ..):/tics hub.pingcap.net/tiflash/tiflash-builder /tics/release-centos7/build/build-release.sh

build_tiflash_ci:
docker run --rm -v $(realpath ..):/tics hub.pingcap.net/tiflash/tiflash-builder-ci /tics/release-centos7/build/build-tiflash-ci.sh

image_tiflash:
image_tiflash_release:
docker build -f Dockerfile-tiflash-centos7 -t hub.pingcap.net/tiflash/tiflash-server-centos7 .
docker build -f Dockerfile-tiflash-ubuntu -t hub.pingcap.net/tiflash/tiflash-server-ubuntu .

image_tiflash_ci:
docker build -f Dockerfile-tiflash-centos7 -t hub.pingcap.net/tiflash/tiflash-ci-centos7 .
23 changes: 18 additions & 5 deletions release-centos7/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# How to build
# How to build tiflash-release-builder-image

```shell
#prepare build enviroment
make image_builer
# build tiflash-release-builder-image
make image_builder_release

# push tiflash-release-builder-image to hub
docker push hub.pingcap.net/tiflash/tiflash-builder
```

# How to build tiflash-ci-builder-image
```shell
# build tiflash-ci-builder-image
make image_builder_ci

# push tiflash-ci-builder-image to hub
docker push hub.pingcap.net/tiflash/tiflash-builder-ci
```

# How to build tiflash-release-binary
```shell
#compile
make build_release
# build tilfash-release-binary
make build_tiflash_release
```

The executable files are located in `tiflash` dir.
Expand Down
17 changes: 17 additions & 0 deletions release-centos7/build/build-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -ueox pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)}

install_dir="$SRCPATH/release-centos7/tiflash"
if [ -d "$install_dir" ]; then rm -rf "$install_dir"/*; else mkdir -p "$install_dir"; fi

$SCRIPTPATH/build-tiflash-proxy.sh
$SCRIPTPATH/build-cluster-manager.sh

rm -f "$install_dir/libtiflash_proxy.so"
rm -rf "$install_dir/flash_cluster_manager"
cp "$SRCPATH/contrib/tiflash-proxy/target/release/libtiflash_proxy.so" "$install_dir/libtiflash_proxy.so"
cp "$SRCPATH/cluster_manage/dist/flash_cluster_manager" "$install_dir/flash_cluster_manager"
2 changes: 1 addition & 1 deletion release-centos7/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if [ -d "$install_dir" ]; then rm -rf "$install_dir"/*; else mkdir -p "$install_

$SCRIPTPATH/build-tiflash-proxy.sh
$SCRIPTPATH/build-cluster-manager.sh
$SCRIPTPATH/build-tiflash.sh
$SCRIPTPATH/build-tiflash-release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

set -ueo pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)}
NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}

ENABLE_TEST=${ENABLE_TEST:-1}
ENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER:-1}
ENABLE_EMBEDDED_COMPILER="FALSE"
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug}

if [[ "${CMAKE_BUILD_TYPE}" != "Debug" ]]; then
Expand All @@ -14,7 +16,7 @@ fi

set -xe

install_dir="$SRCPATH/docker/builder/tics"
install_dir="$SRCPATH/release-centos7/tiflash"
if [ -d "$install_dir" ]; then rm -rf "$install_dir"/*; else mkdir -p "$install_dir"; fi

cp -r /flash_cluster_manager "$install_dir"
Expand All @@ -36,7 +38,7 @@ fi
rm -rf ${SRCPATH}/libs/libtiflash-proxy
ln -s /libtiflash-proxy ${SRCPATH}/libs/libtiflash-proxy

build_dir="$SRCPATH/build_docker"
build_dir="$SRCPATH/release-centos7/build-release"
mkdir -p $build_dir && cd $build_dir
cmake "$SRCPATH" \
-DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \
Expand All @@ -45,11 +47,7 @@ cmake "$SRCPATH" \
make -j $NPROC

cp -f "$build_dir/dbms/src/Server/theflash" "$install_dir/theflash"

ldd "$build_dir/dbms/src/Server/theflash" | grep '/' | grep '=>' | \
awk -F '=>' '{print $2}' | awk '{print $1}' | while read lib; do
cp -f "$lib" "$install_dir"
done
cp -f "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.so" "$install_dir/libtiflash_proxy.so"

# copy gtest binary under Debug mode
if [[ "${CMAKE_BUILD_TYPE}" = "Debug" && ${ENABLE_TEST} -ne 0 ]]; then
Expand Down
4 changes: 2 additions & 2 deletions tests/docker/Dockerfile-tiflash-with-mysql-client
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG TAG=master
FROM hub.pingcap.net/tiflash/tics:${TAG}
RUN apt-get update
RUN apt-get install -y mysql-client
RUN yum update -y
RUN yum install mysql -y
2 changes: 1 addition & 1 deletion tests/docker/_env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export build_dir="/tics"
export build_dir="/tiflash"

# Executable path
export storage_bin="$build_dir/theflash"
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/config/tiflash.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interserver_http_port = 9009
refresh_interval = 20
update_rule_interval = 5
master_ttl = 60
cluster_manager_path = "/tics/flash_cluster_manager"
cluster_manager_path = "/tiflash/flash_cluster_manager"
[flash.proxy]
addr = "0.0.0.0:20170"
advertise-addr = "tiflash0:20170"
Expand Down