Skip to content
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
33 changes: 31 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,31 @@ build_and_deploy: builddocker deploy
# https://docs.docker.com/engine/reference/commandline/docker/
# https://docs.docker.com/compose/reference/
deploy:
@echo "================================"
@echo "Make deploy"
echo XTCPPATH=${XTCPPATH}
XTCPPATH=${XTCPPATH} \
docker compose \
--file build/containers/redpanda/docker-compose.yml \
up -d --remove-orphans

down:
@echo "================================"
@echo "Make down"
XTCPPATH=${XTCPPATH} \
docker compose \
--file build/containers/redpanda/docker-compose.yml \
down

#--env-file docker-compose-enviroment-variables \

builddocker: builddocker_xtcp builddocker_clickhouse

builddocker_xtcp:
@echo "================================"
@echo "Make builddocker_xtcp"
docker build \
--build-arg XTCPPATH=${XTCPPATH} \
--build-arg PWD=${PWD} \
--build-arg COMMIT=${COMMIT} \
--build-arg DATE=${DATE} \
--build-arg VERSION=${VERSION} \
Expand All @@ -49,9 +60,10 @@ builddocker_xtcp:
${XTCPPATH}

builddocker_clickhouse:
@echo "================================"
@echo "Make builddocker_clickhouse"
docker build \
--build-arg XTCPPATH=${XTCPPATH} \
--build-arg PWD=${PWD} \
--build-arg VERSION=${VERSION} \
--file build/containers/clickhouse/Containerfile \
--tag xtcp_clickhouse:${VERSION} --tag xtcp_clickhouse:latest \
Expand Down Expand Up @@ -83,4 +95,21 @@ test:
bench:
go test -bench=. ./pkg/xtcpnl/

followxtcp:
docker logs xtcp-xtcp2-1 --follow

ch:
docker exec -it xtcp-clickhouse-1 bash

ch_prom:
curl --silent http://localhost:9363/metrics | grep -v "#" | grep -i kafka

clear_docker_volumes:
docker volume rm redpanda-quickstart-one-broker_redpanda-0 || true
docker volume rm redpanda_redpanda-0 || true
docker volume rm xtcp_nsq_data || true
docker volume rm xtcp_redpanda-0 || true

docker volume ls

# end
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# xtcp2
# xtcp2

Please run:
- "make" to build the docker containers and then start the set of containers
- "deploy" to start the containers if you've already built them

See also: "cat Makefile"
23 changes: 18 additions & 5 deletions build/containers/clickhouse/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
# https://github.com/ClickHouse/ClickHouse/blob/master/docker/server/entrypoint.sh

ARG XTCPPATH
ARG PWD
ARG VERSION

# https://hub.docker.com/r/clickhouse/clickhouse-server/tags
FROM clickhouse/clickhouse-server:24.8.4.13-alpine

ARG XTCPPATH
ARG PWD
ARG VERSION

RUN echo XTCPPATH:${XTCPPATH} VERSION:${VERSION}
Expand All @@ -28,15 +26,30 @@ RUN echo XTCPPATH:${XTCPPATH} VERSION:${VERSION}
RUN apk add busybox-extras

COPY --chmod=544 \
${XTCPPATH}/build/containers/clickhouse/docker_related_config.xml \
./build/containers/clickhouse/config.xml \
/etc/clickhouse-server/config.xml

COPY --chmod=544 \
./build/containers/clickhouse/docker_related_config.xml \
/etc/clickhouse-server/config.d/docker_related_config.xml

COPY --chmod=544 \
${XTCPPATH}/pkg/xtcppb/flatxtcppb.proto \
./pkg/xtcppb/flatxtcppb.proto \
/var/lib/clickhouse/format_schemas/flatxtcppb.proto

COPY --chmod=544 \
${XTCPPATH}/VERSION \
./VERSION \
/VERSION

# http
EXPOSE 8123
# native
EXPOSE 9000
# mysql
EXPOSE 9004
# postgres
EXPOSE 9005
# prometheus
EXPOSE 9363

# end
Loading