Skip to content

Commit

Permalink
Docker - Tikv - update version (#2112)
Browse files Browse the repository at this point in the history
* update version

* increase timeout
  • Loading branch information
ganochenkodg authored Mar 21, 2023
1 parent 4f94338 commit 2447183
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 64 deletions.
4 changes: 2 additions & 2 deletions cloudbuild-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

timeout: 3600s # 1h
timeout: 5400s # 1h
steps:

- id: Build C2D Docker Image
Expand Down Expand Up @@ -47,7 +47,7 @@ steps:
- builds
- submit
- --timeout
- 3600s
- 5400s
- --config
- cloudbuild.yaml
- .
Original file line number Diff line number Diff line change
@@ -1,40 +1,18 @@
FROM marketplace.gcr.io/google/debian11:latest as builder
FROM marketplace.gcr.io/google/c2d-debian11:latest as builder

RUN apt-get update \
&& apt-get install curl perl build-essential cmake git unzip -y --no-install-recommends
ENV GOLANG_VERSION=1.16
ENV GOLANG_VERSION=1.20
RUN curl -L https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o /golang.tar.gz &&tar -xzf /golang.tar.gz -C /usr/local
ENV PATH /usr/local/go/bin:$PATH

ENV TIKV_APP_VERSION=5.3.2

#build tikv
WORKDIR /tikv

RUN curl -L https://github.com/tikv/tikv/archive/refs/tags/v${TIKV_APP_VERSION}.tar.gz -o ./tikv.tar.gz && tar -xzf ./tikv.tar.gz && mv ./tikv-*/* ./

ENV LIBRARY_PATH /usr/local/lib:$LIBRARY_PATH
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
ENV PATH /root/.cargo/bin/:$PATH

RUN rustup self update \
&& rustup set profile minimal \
&& rustup default $(cat "rust-toolchain")

ENV CARGO_BUILD_JOBS 32
RUN lscpu

RUN make build_dist_release

#install jq for pd-ctl
RUN cd / && \
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o jq && \
chmod +x jq

#build pd
ENV PD_APP_VERSION=5.3.2
ENV PD_APP_VERSION=6.5.1

RUN mkdir -p /go/src/github.com/tikv/pd
WORKDIR /go/src/github.com/tikv/pd
Expand All @@ -53,17 +31,43 @@ RUN export GO111MODULE=on \
&& go get github.com/pingcap/tidb/store/tikv@kv-only-4.0 \
&& go build tikvtest.go

# Install protoc
RUN curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip"
RUN unzip protoc-3.15.8-linux-x86_64.zip -d /usr/local/
ENV PATH /usr/local/bin/:$PATH

ENV TIKV_APP_VERSION=6.5.1

#build tikv
WORKDIR /tikv

RUN curl -L https://github.com/tikv/tikv/archive/refs/tags/v${TIKV_APP_VERSION}.tar.gz -o ./tikv.tar.gz && tar -xzf ./tikv.tar.gz && mv ./tikv-*/* ./

ENV LIBRARY_PATH /usr/local/lib:$LIBRARY_PATH
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
ENV PATH /root/.cargo/bin/:$PATH

RUN rustup self update \
&& rustup set profile minimal \
&& rustup default $(cat "rust-toolchain")

ENV CARGO_BUILD_JOBS 32

RUN make build_dist_release

#copy inferno license to /usr/src
RUN cp -r $(find /root/.cargo/registry -name "inferno-*" -type d) /usr/src/

FROM marketplace.gcr.io/google/debian11:latest
FROM marketplace.gcr.io/google/c2d-debian11:latest

ENV PD_ENDPOINT 127.0.0.1:2379

#fix security issues
RUN apt-get update \
&& apt-get install --no-install-recommends -yqq \
curl openssl zlib1g libgnutls30 libc6 libc-bin libtirpc3 libtirpc-common libpcre2-8-0 libssl1.1 \
curl openssl zlib1g libgnutls30 libc6 libc-bin libtirpc3 libtirpc-common libpcre2-8-0 libssl1.1 libtasn1-6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -79,6 +83,6 @@ COPY --from=builder /jq /usr/local/bin/jq
COPY --from=builder /tikvtest/tikvtest /tikvtest

EXPOSE 2379 2380 20160 20180
ENV C2D_RELEASE 5.3.2
ENV C2D_RELEASE 6.5.1

CMD ["/tikv-server"]
50 changes: 27 additions & 23 deletions docker/tikv/templates/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,6 @@ ENV GOLANG_VERSION={{ $golang.Version }}
RUN curl -L https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o /golang.tar.gz &&tar -xzf /golang.tar.gz -C /usr/local
ENV PATH /usr/local/go/bin:$PATH

ENV TIKV_APP_VERSION={{ $tikv.Version }}

#build tikv
WORKDIR /tikv

RUN curl -L https://github.com/tikv/tikv/archive/refs/tags/v${TIKV_APP_VERSION}.tar.gz -o ./tikv.tar.gz && tar -xzf ./tikv.tar.gz && mv ./tikv-*/* ./

ENV LIBRARY_PATH /usr/local/lib:$LIBRARY_PATH
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
ENV PATH /root/.cargo/bin/:$PATH

RUN rustup self update \
&& rustup set profile minimal \
&& rustup default $(cat "rust-toolchain")

ENV CARGO_BUILD_JOBS 32
RUN lscpu

RUN make build_dist_release

#install jq for pd-ctl
RUN cd / && \
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o jq && \
Expand All @@ -57,6 +35,32 @@ RUN export GO111MODULE=on \
&& go get github.com/pingcap/tidb/store/tikv@kv-only-4.0 \
&& go build tikvtest.go

# Install protoc
RUN curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip"
RUN unzip protoc-3.15.8-linux-x86_64.zip -d /usr/local/
ENV PATH /usr/local/bin/:$PATH

ENV TIKV_APP_VERSION={{ $tikv.Version }}

#build tikv
WORKDIR /tikv

RUN curl -L https://github.com/tikv/tikv/archive/refs/tags/v${TIKV_APP_VERSION}.tar.gz -o ./tikv.tar.gz && tar -xzf ./tikv.tar.gz && mv ./tikv-*/* ./

ENV LIBRARY_PATH /usr/local/lib:$LIBRARY_PATH
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
ENV PATH /root/.cargo/bin/:$PATH

RUN rustup self update \
&& rustup set profile minimal \
&& rustup default $(cat "rust-toolchain")

ENV CARGO_BUILD_JOBS 32

RUN make build_dist_release

#copy inferno license to /usr/src
RUN cp -r $(find /root/.cargo/registry -name "inferno-*" -type d) /usr/src/

Expand All @@ -67,7 +71,7 @@ ENV PD_ENDPOINT 127.0.0.1:2379
#fix security issues
RUN apt-get update \
&& apt-get install --no-install-recommends -yqq \
curl openssl zlib1g libgnutls30 libc6 libc-bin libtirpc3 libtirpc-common libpcre2-8-0 libssl1.1 \
curl openssl zlib1g libgnutls30 libc6 libc-bin libtirpc3 libtirpc-common libpcre2-8-0 libssl1.1 libtasn1-6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
22 changes: 11 additions & 11 deletions docker/tikv/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ cloudbuild:
enable_parallel: false
machineType: 'E2_HIGHCPU_32'
versions:
- dir: 5/debian11/5.3
from: marketplace.gcr.io/google/debian11:latest
- dir: 6/debian11/6.5
from: marketplace.gcr.io/google/c2d-debian11:latest
packages:
tikv:
version: 5.3.2
version: 6.5.1
pd:
version: 5.3.2
version: 6.5.1
golang:
version: 1.16
version: 1.20
repo: tikv5
tags:
- '5.3.2-debian11'
- '5.3-debian11'
- '5-debian11'
- '5.3.2'
- '5.3'
- '5'
- '6.5.1-debian11'
- '6.5-debian11'
- '6-debian11'
- '6.5.1'
- '6.5'
- '6'
- 'latest'

0 comments on commit 2447183

Please sign in to comment.