Skip to content

Commit c97b232

Browse files
zliang-minyokofly
andcommitted
Added well known protos to docker image (#6849) (#7149)
Co-authored-by: yun <[email protected]>
1 parent 3aac860 commit c97b232

File tree

14 files changed

+59
-10
lines changed

14 files changed

+59
-10
lines changed

.github/workflows/manual_trigger_build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ jobs:
7070
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
7171
cd $GITHUB_WORKSPACE/docker/server
7272
73+
# prepare files to be copied to the image
74+
mkdir -p resources/protos/google/protobuf
75+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
76+
rm -rf resources/protos/google/protobuf/unittest_*
77+
7378
# build docker image
7479
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:$TAG
7580
@@ -107,6 +112,11 @@ jobs:
107112
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
108113
cd $GITHUB_WORKSPACE/docker/server
109114
115+
# prepare files to be copied to the image
116+
mkdir -p resources/protos/google/protobuf
117+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
118+
rm -rf resources/protos/google/protobuf/unittest_*
119+
110120
# build docker image
111121
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:$TAG
112122

.github/workflows/nightly_test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ jobs:
5555
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
5656
cd $GITHUB_WORKSPACE/docker/server
5757
58+
# prepare files to be copied to the image
59+
mkdir -p resources/protos/google/protobuf
60+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
61+
rm -rf resources/protos/google/protobuf/unittest_*
62+
5863
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:testing-$SANITIZER-$ARCH-$GITHUB_SHA
5964
docker push ghcr.io/timeplus-io/proton:testing-$SANITIZER-$ARCH-$GITHUB_SHA
6065
steps:
@@ -193,6 +198,11 @@ jobs:
193198
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
194199
cd $GITHUB_WORKSPACE/docker/server
195200
201+
# prepare files to be copied to the image
202+
mkdir -p resources/protos/google/protobuf
203+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
204+
rm -rf resources/protos/google/protobuf/unittest_*
205+
196206
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:testing-$ARCH-$GITHUB_SHA
197207
docker push ghcr.io/timeplus-io/proton:testing-$ARCH-$GITHUB_SHA
198208
steps:
@@ -314,6 +324,11 @@ jobs:
314324
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
315325
cd $GITHUB_WORKSPACE/docker/server
316326
327+
# prepare files to be copied to the image
328+
mkdir -p resources/protos/google/protobuf
329+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
330+
rm -rf resources/protos/google/protobuf/unittest_*
331+
317332
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:testing-$SANITIZER-$ARCH-$GITHUB_SHA
318333
docker push ghcr.io/timeplus-io/proton:testing-$SANITIZER-$ARCH-$GITHUB_SHA
319334
steps:

.github/workflows/proton_ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ jobs:
8585
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
8686
cd $GITHUB_WORKSPACE/docker/server
8787
88+
# prepare files to be copied to the image
89+
mkdir -p resources/protos/google/protobuf
90+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
91+
rm -rf resources/protos/google/protobuf/unittest_*
92+
8893
# build docker image
8994
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:testing-$SANITIZER-$ARCH-$GITHUB_SHA
9095

.github/workflows/release_build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
4949
cd $GITHUB_WORKSPACE/docker/server
5050
51+
# prepare files to be copied to the image
52+
mkdir -p resources/protos/google/protobuf
53+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
54+
rm -rf resources/protos/google/protobuf/unittest_*
55+
5156
# build docker image
5257
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:$GITHUB_SHA-amd64
5358
@@ -105,6 +110,11 @@ jobs:
105110
docker run --name static-server -p 8080:80 -v $GITHUB_WORKSPACE/output:/usr/share/nginx/html:ro -d nginx
106111
cd $GITHUB_WORKSPACE/docker/server
107112
113+
# prepare files to be copied to the image
114+
mkdir -p resources/protos/google/protobuf
115+
cp -r $GITHUB_WORKSPACE/contrib/google-protobuf/src/google/protobuf/*.proto ./resources/protos/google/protobuf/
116+
rm -rf resources/protos/google/protobuf/unittest_*
117+
108118
# build docker image
109119
docker build . --network host --build-arg single_binary_location_url=http://localhost:8080/proton -t ghcr.io/timeplus-io/proton:$GITHUB_SHA-arm64v8
110120

docker/server/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ ENV LANGUAGE en_US:en
109109
ENV LC_ALL en_US.UTF-8
110110
ENV TZ UTC
111111

112-
RUN mkdir /docker-entrypoint-initdb.d
112+
RUN mkdir /docker-entrypoint-initdb.d \
113+
&& mkdir -p /var/lib/proton/lib \
114+
&& mkdir -p /usr/share/proton
115+
116+
COPY resources/protos /usr/share/proton/protos/
117+
RUN chown -R timeplus:timeplus /usr/share/proton/
113118

114119
COPY docker_related_config.xml /etc/proton-server/config.d/
115120
COPY entrypoint.sh /entrypoint.sh

programs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,6 @@ if (TARGET ch_contrib::protobuf)
304304
get_property(google_proto_files TARGET ch_contrib::protobuf PROPERTY google_proto_files)
305305
message(WARNING "PROTO FILES ${google_proto_files}")
306306
foreach (proto_file IN LISTS google_proto_files)
307-
install(FILES ${proto_file} DESTINATION ${CMAKE_INSTALL_DATADIR}/timeplusd/protos/google/protobuf)
307+
install(FILES ${proto_file} DESTINATION ${CMAKE_INSTALL_DATADIR}/proton/protos/google/protobuf)
308308
endforeach()
309309
endif ()

programs/client/proton-client.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@
5353

5454
<!-- Directory containing the proto files for the well-known Protobuf types.
5555
-->
56-
<google_protos_path>/usr/share/timeplusd/protos/</google_protos_path>
56+
<google_protos_path>/usr/share/proton/protos/</google_protos_path>
5757
</config>

programs/server/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@
12691269

12701270
<!-- Directory containing the proto files for the well-known Protobuf types.
12711271
-->
1272-
<google_protos_path>/usr/share/timeplusd/protos/</google_protos_path>
1272+
<google_protos_path>/usr/share/proton/protos/</google_protos_path>
12731273

12741274
<!-- Default query masking rules, matching lines would be replaced with something else in the logs
12751275
(both text logs and system.query_log).

programs/server/config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,10 @@ graphite_rollup_example:
878878
# The directory will be created if it doesn't exist.
879879
format_schema_path: /var/lib/proton/format_schemas/
880880

881+
# Directory to look for protobuf files for the well-known types:
882+
# https://protobuf.dev/reference/protobuf/google.protobuf/
883+
google_protos_path: /usr/share/proton/protos/
884+
881885
# Default query masking rules, matching lines would be replaced with something else in the logs
882886
# (both text logs and system.query_log).
883887
# name - name for the rule (optional)

src/Core/Settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ static constexpr UInt64 operator""_GiB(unsigned long long value)
778778
M(Bool, output_format_arrow_low_cardinality_as_dictionary, false, "Enable output LowCardinality type as Dictionary Arrow type", 0) \
779779
\
780780
/** proton: starts. */ \
781-
M(EnumComparingMode, format_capn_proto_enum_comparising_mode, FormatSettings::EnumComparingMode::BY_VALUES, "How to map timeplusd Enum and CapnProto Enum", 0)\
781+
M(EnumComparingMode, format_capn_proto_enum_comparising_mode, FormatSettings::EnumComparingMode::BY_VALUES, "How to map proton Enum and CapnProto Enum", 0)\
782782
\
783783
M(Bool, format_capn_proto_use_autogenerated_schema, true, "Use autogenerated CapnProto schema when format_schema is not set", 0) \
784784
M(Bool, format_protobuf_use_autogenerated_schema, true, "Use autogenerated Protobuf when format_schema is not set", 0) \

0 commit comments

Comments
 (0)