Skip to content

Commit

Permalink
Merge pull request ClickHouse#67 from zhicwu/develop
Browse files Browse the repository at this point in the history
Re-write JDBC bridge
  • Loading branch information
alexey-milovidov authored Nov 20, 2020
2 parents e0001f8 + 97a920d commit 15f6251
Show file tree
Hide file tree
Showing 133 changed files with 15,403 additions and 2,241 deletions.
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.idea/*
/target/
*.iml

.classpath
.factorypath
.project
dependency-reduced-pom.xml
.settings/
.vscode/
demo/
target/
84 changes: 84 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#
# Copyright (C) 2019-2020, Zhichun Wu
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

# docker build --squash --build-arg revision=2.0.0 -t yandex/clickhouse-jdbc-bridge .
ARG revision=2.0.0-SNAPSHOT

#
# Stage 1/2: Build
#
FROM maven:3-openjdk-8 as builder

ARG revision

COPY LICENSE NOTICE pom.xml /app/
COPY docker /app/docker/
COPY misc /app/misc/
COPY src /app/src/

WORKDIR /app

RUN mvn -Drevision=${revision} package


#
# Stage 2/2: Pack
#
FROM adoptopenjdk/openjdk8-openj9:jre8u265-b01_openj9-0.21.0-ubuntu

ARG revision

# Maintainer
LABEL maintainer="[email protected]"

# Environment variables
ENV JDBC_BRIDGE_HOME=/app JDBC_BRIDGE_VERSION=${revision}

# Labels
LABEL app_name="ClickHouse JDBC Bridge" app_version="$JDBC_BRIDGE_VERSION"

# Update system and install additional packages for troubleshooting
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated apache2-utils \
apt-transport-https curl htop iftop iptraf iputils-ping jq lsof net-tools tzdata wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /app/LICENSE /app/NOTICE \
/app/target/clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION.jar $JDBC_BRIDGE_HOME/
COPY --chown=root:root docker/ $JDBC_BRIDGE_HOME

RUN chmod +x $JDBC_BRIDGE_HOME/*.sh \
&& mkdir -p $JDBC_BRIDGE_HOME/logs /usr/local/lib/java \
&& ln -s $JDBC_BRIDGE_HOME/logs /var/log/clickhouse-jdbc-bridge \
&& ln -s $JDBC_BRIDGE_HOME/clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION.jar \
/usr/local/lib/java/clickhouse-jdbc-bridge.jar \
&& ln -s $JDBC_BRIDGE_HOME /etc/clickhouse-jdbc-bridge

WORKDIR $JDBC_BRIDGE_HOME

EXPOSE 9019

VOLUME ["${JDBC_BRIDGE_HOME}/drivers", "${JDBC_BRIDGE_HOME}/extensions", "${JDBC_BRIDGE_HOME}/logs", "${JDBC_BRIDGE_HOME}/scripts"]

CMD "./docker-entrypoint.sh"

HEALTHCHECK --start-period=5m --interval=30s --timeout=5s \
CMD curl --connect-timeout 3 --no-keepalive -f http://localhost:9019/ping || exit 1
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Copyright 2018-2020 Alex Krasheninnikov

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -188,7 +187,7 @@ Copyright 2018-2020 Alex Krasheninnikov
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2020 Alex Krasheninnikov
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
62 changes: 62 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
clickhouse-jdbc-bridge
Copyright 2019-2020, Zhichun Wu.

This project includes software developed by Zhichun Wu.
https://github.com/zhicwu

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.

This project includes:
Apache Log4j under The Apache Software License, Version 2.0
Caffeine cache under Apache License, Version 2.0
Checker Qual under The MIT License
ClickHouse JDBC Bridge under Apache License, Version 2.0
dnsjava under BSD-2-Clause
error-prone annotations under Apache 2.0
HdrHistogram under Public Domain, per Creative Commons CC0 or BSD-2-Clause
HikariCP under The Apache Software License, Version 2.0
Jackson-annotations under The Apache Software License, Version 2.0
Jackson-core under The Apache Software License, Version 2.0
jackson-databind under The Apache Software License, Version 2.0
jcommander under Apache 2.0
LatencyUtils under Public Domain, per Creative Commons CC0
micrometer-core under The Apache Software License, Version 2.0
micrometer-registry-prometheus under The Apache Software License, Version 2.0
Netty/Buffer under Apache License, Version 2.0
Netty/Codec under Apache License, Version 2.0
Netty/Codec/DNS under Apache License, Version 2.0
Netty/Codec/HTTP under Apache License, Version 2.0
Netty/Codec/HTTP2 under Apache License, Version 2.0
Netty/Codec/Socks under Apache License, Version 2.0
Netty/Common under Apache License, Version 2.0
Netty/Handler under Apache License, Version 2.0
Netty/Handler/Proxy under Apache License, Version 2.0
Netty/Resolver under Apache License, Version 2.0
Netty/Resolver/DNS under Apache License, Version 2.0
Netty/Transport under Apache License, Version 2.0
Prometheus Java Simpleclient under The Apache Software License, Version 2.0
Prometheus Java Simpleclient Common under The Apache Software License, Version 2.0
SLF4J API Module under MIT License
SLF4J LOG4J-12 Binding under MIT License
SQLite JDBC under The Apache Software License, Version 2.0
testng under Apache 2.0
Vert.x Bridge Common under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
Vert.x Core under The Apache Software License, Version 2.0 or Eclipse Public License - v 2.0
Vert.x metrics implementation for Micrometer.io under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
vertx-auth-common under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
vertx-config under Apache License, Version 2.0
vertx-web under The Apache Software License, Version 2.0 or Eclipse Public License - v 2.0
vertx-web-client under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0
vertx-web-common under The Apache Software License, Version 2.0 or Eclipse Public License - v 1.0

Loading

0 comments on commit 15f6251

Please sign in to comment.