Skip to content

Commit

Permalink
extension: support audit log (#42099)
Browse files Browse the repository at this point in the history
close #42188
  • Loading branch information
CbcWestwolf authored Apr 14, 2023
1 parent a5970ef commit d01a6fd
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/licenserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ header:
- "docs/"
- "br/"
- ".gitignore"
- ".gitmodules"
- ".dockerignore"
- ".gitattributes"
- ".cilinter.yaml"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "extension/enterprise"]
path = extension/enterprise
url = git@github.com:pingcap-inc/enterprise-extensions.git
39 changes: 39 additions & 0 deletions Dockerfile.enterprise
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2023 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Builder image
FROM rockylinux:9 as builder

ENV GOLANG_VERSION 1.19.3
ENV ARCH amd64
ENV GOLANG_DOWNLOAD_URL https://dl.google.com/go/go$GOLANG_VERSION.linux-$ARCH.tar.gz
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
RUN yum update -y && yum groupinstall 'Development Tools' -y \
&& curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz

COPY . /tidb
ARG GOPROXY
RUN export GOPROXY=${GOPROXY} && cd /tidb && make enterprise-server-build

FROM rockylinux:9-minimal

COPY --from=builder /tidb/bin/tidb-server /tidb-server

WORKDIR /
EXPOSE 4000
ENTRYPOINT ["/tidb-server"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ else
CGO_ENABLED=1 $(GOBUILD) -gcflags="all=-N -l" $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' ./tidb-server
endif

enterprise-prepare:
git submodule init && git submodule update && cd extension/enterprise/generate && $(GO) generate -run genfile main.go

enterprise-clear:
cd extension/enterprise/generate && $(GO) generate -run clear main.go

enterprise-docker: enterprise-prepare
docker build -t "$(DOCKERPREFIX)tidb:latest" --build-arg 'GOPROXY=$(shell go env GOPROXY),' -f Dockerfile.enterprise .

enterprise-server-build:
ifeq ($(TARGET), "")
CGO_ENABLED=1 $(GOBUILD) -tags enterprise $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server tidb-server/main.go
else
CGO_ENABLED=1 $(GOBUILD) -tags enterprise $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' tidb-server/main.go
endif

enterprise-server: enterprise-prepare enterprise-server-build

server_check:
ifeq ($(TARGET), "")
$(GOBUILD) $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o bin/tidb-server ./tidb-server
Expand Down
1 change: 1 addition & 0 deletions extension/enterprise
Submodule enterprise added at 216228

0 comments on commit d01a6fd

Please sign in to comment.