Skip to content

Commit 2bae3e7

Browse files
refactor: changed directory names
1 parent ac8adbc commit 2bae3e7

7 files changed

Lines changed: 43 additions & 28 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
COMPOSE_DIR := local-test
2020
KIND_CLUSTER := fusion-cluster
21-
AMORO_LOG_DIR ?= $(CURDIR)/docker/kind/amoro-logs
21+
FUSION_LOG_DIR ?= $(CURDIR)/docker/kind/fusion-logs
2222
DIST_TAR := $(CURDIR)/dist/target/apache-amoro-0.9-SNAPSHOT-bin.tar.gz
2323
RUNTIME_HOME := $(CURDIR)/dist/target/amoro-0.9-SNAPSHOT
2424
BIN_HOME := $(CURDIR)/dist/src/main/amoro-bin
@@ -119,8 +119,8 @@ stop-deps:
119119

120120
start-fusion-docker:
121121
@echo "Starting Fusion (Kind cluster + all services)..."
122-
@mkdir -p "$(AMORO_LOG_DIR)"
123-
@AMORO_LOG_DIR="$(AMORO_LOG_DIR)" docker compose -f $(COMPOSE_DIR)/docker-compose.yml --profile prod up -d
122+
@mkdir -p "$(FUSION_LOG_DIR)"
123+
@FUSION_LOG_DIR="$(FUSION_LOG_DIR)" docker compose -f $(COMPOSE_DIR)/docker-compose.yml --profile prod up -d
124124
@kind export kubeconfig --name $(KIND_CLUSTER) 2>/dev/null
125125

126126
clean-fusion-docker:

dist/src/main/amoro-bin/bin/load-config.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ else
2929
fi
3030

3131
if [ -z "$AMORO_LOG_DIR" ]; then
32-
export AMORO_LOG_DIR="${AMORO_HOME}/logs"
32+
if [ -n "$LOG_DIR" ]; then
33+
export AMORO_LOG_DIR="$LOG_DIR"
34+
else
35+
export AMORO_LOG_DIR="${AMORO_HOME}/logs"
36+
fi
3337
fi
3438

3539
if [ -z "$AMORO_CONF_DIR" ]; then
36-
export AMORO_CONF_DIR="${AMORO_HOME}/conf"
40+
if [ -n "$FUSION_CONF_DIR" ]; then
41+
export AMORO_CONF_DIR="$FUSION_CONF_DIR"
42+
else
43+
export AMORO_CONF_DIR="${AMORO_HOME}/conf"
44+
fi
3745
fi
3846

3947
if [ -z "$AMORO_LOG_CONF_FILE" ]; then

docker/amoro/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,21 @@ RUN AMORO_VERSION=`cat pom.xml | grep 'amoro-parent' -C 3 | grep -Eo '<version>.
3737
&& tar -xzvf /usr/local/apache-amoro-${AMORO_VERSION}-bin.tar.gz -C /usr/local \
3838
&& rm /usr/local/amoro-${AMORO_VERSION}/plugin/optimizer/flink -rf \
3939
&& rm /usr/local/amoro-${AMORO_VERSION}/plugin/optimizer/spark -rf \
40-
&& mv /usr/local/amoro-${AMORO_VERSION} /usr/local/amoro \
40+
&& mv /usr/local/amoro-${AMORO_VERSION} /usr/local/fusion \
4141
&& rm -rf /workspace/amoro
4242

4343

4444
FROM eclipse-temurin:17-jdk-jammy
4545

4646
ARG MAVEN_MIRROR=https://repo.maven.apache.org/maven2
4747

48-
ENV AMORO_HOME /usr/local/amoro
49-
ENV AMORO_CONF_DIR ${AMORO_HOME}/conf
50-
ENV LOG_LEVEL info
48+
ENV AMORO_HOME=/usr/local/fusion
49+
ENV LOG_LEVEL=info
5150
EXPOSE 1630 1260 1261
5251

5352
COPY ./docker/amoro/entrypoint.sh /
5453
RUN chmod +x /entrypoint.sh
55-
COPY --from=builder "/usr/local/amoro" "/usr/local/amoro"
54+
COPY --from=builder "/usr/local/fusion" "/usr/local/fusion"
5655

5756
WORKDIR ${AMORO_HOME}
5857

docker/amoro/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ if [ -n "$LOG_LEVEL" ]; then
2727
export CONSOLE_LOG_LEVEL=$LOG_LEVEL
2828
fi
2929

30+
if [ -n "$FUSION_CONF_DIR" ]; then
31+
export AMORO_CONF_DIR="$FUSION_CONF_DIR"
32+
elif [ -z "$AMORO_CONF_DIR" ]; then
33+
export AMORO_CONF_DIR="${AMORO_HOME}/conf"
34+
fi
35+
3036
configure_jvm_options() {
3137
JVM_PROPERTIES_FILE="${AMORO_CONF_DIR}/jvm.properties"
3238
for option in $(printenv | perl -sne 'print "$1 " if m/^JVM_(.+?)=.*/' ); do

local-test/config.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@ containers:
183183
spark-conf.spark.kubernetes.executor.secretKeyRef.AWS_SECRET_ACCESS_KEY: "fusion-s3-credentials:secret-access-key"
184184
# Mount shared log volume so driver/executor pods write logs to the same path
185185
# that LogController reads from (via the Kind node hostPath extraMount).
186-
spark-conf.spark.kubernetes.driver.volumes.hostPath.amoro-logs.mount.path: "/mnt/amoro-logs"
187-
spark-conf.spark.kubernetes.driver.volumes.hostPath.amoro-logs.mount.readOnly: "false"
188-
spark-conf.spark.kubernetes.driver.volumes.hostPath.amoro-logs.options.path: "/mnt/amoro-logs"
189-
spark-conf.spark.kubernetes.executor.volumes.hostPath.amoro-logs.mount.path: "/mnt/amoro-logs"
190-
spark-conf.spark.kubernetes.executor.volumes.hostPath.amoro-logs.mount.readOnly: "false"
191-
spark-conf.spark.kubernetes.executor.volumes.hostPath.amoro-logs.options.path: "/mnt/amoro-logs"
186+
spark-conf.spark.kubernetes.driver.volumes.hostPath.fusion-logs.mount.path: "/mnt/fusion-logs"
187+
spark-conf.spark.kubernetes.driver.volumes.hostPath.fusion-logs.mount.readOnly: "false"
188+
spark-conf.spark.kubernetes.driver.volumes.hostPath.fusion-logs.options.path: "/mnt/fusion-logs"
189+
spark-conf.spark.kubernetes.executor.volumes.hostPath.fusion-logs.mount.path: "/mnt/fusion-logs"
190+
spark-conf.spark.kubernetes.executor.volumes.hostPath.fusion-logs.mount.readOnly: "false"
191+
spark-conf.spark.kubernetes.executor.volumes.hostPath.fusion-logs.options.path: "/mnt/fusion-logs"
192+
spark-conf.spark.kubernetes.driverEnv.LOG_DIR: "/mnt/fusion-logs"
193+
spark-conf.spark.kubernetes.executorEnv.LOG_DIR: "/mnt/fusion-logs"
192194
# Force Log4j2 to use the routing config (belt-and-suspenders with the Dockerfile COPY)
193195
spark-conf.spark.driver.extraJavaOptions: "-Dlog4j2.configurationFile=file:///opt/spark/conf/log4j2.xml"
194196
spark-conf.spark.executor.extraJavaOptions: "-Dlog4j2.configurationFile=file:///opt/spark/conf/log4j2.xml"

local-test/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ services:
4242
KUBECONFIG: /root/.kube/config
4343
AWS_ACCESS_KEY_ID: admin
4444
AWS_SECRET_ACCESS_KEY: password
45-
LOG_DIR: /mnt/amoro-logs/compaction
45+
LOG_DIR: /mnt/fusion-logs
4646
volumes:
47-
- ./config.yaml:/usr/local/amoro/conf/config.yaml:ro
47+
- ./config.yaml:/usr/local/fusion/conf/config.yaml:ro
4848
- kind-kubeconfig:/root/.kube:ro
4949
- spark-home:/opt/spark:ro
50-
- ${AMORO_LOG_DIR:-/opt/amoro-logs}:/mnt/amoro-logs
50+
- ${FUSION_LOG_DIR:-/opt/fusion-logs}:/mnt/fusion-logs
5151
command: ["/entrypoint.sh", "ams"]
5252
tty: true
5353
stdin_open: true
@@ -246,7 +246,7 @@ services:
246246
networks:
247247
iceberg-net:
248248
environment:
249-
AMORO_LOG_DIR: ${AMORO_LOG_DIR:-/opt/amoro-logs}
249+
FUSION_LOG_DIR: ${FUSION_LOG_DIR:-/opt/fusion-logs}
250250
volumes:
251251
- /var/run/docker.sock:/var/run/docker.sock
252252
- kind-kubeconfig:/output
@@ -258,11 +258,11 @@ services:
258258
- |
259259
set -e
260260
261-
LOG_DIR="$${AMORO_LOG_DIR:-/opt/amoro-logs}"
261+
LOG_DIR="$${FUSION_LOG_DIR:-/opt/fusion-logs}"
262262
echo "==> Log directory: $$LOG_DIR"
263263
264264
echo "==> Generating kind cluster config..."
265-
sed "s|AMORO_LOG_PLACEHOLDER|$$LOG_DIR|g" /kind-config.yaml > /tmp/kind-config-gen.yaml
265+
sed "s|FUSION_LOG_PLACEHOLDER|$$LOG_DIR|g" /kind-config.yaml > /tmp/kind-config-gen.yaml
266266
267267
echo "==> Installing kind..."
268268
apk add --no-cache curl >/dev/null 2>&1

local-test/kind-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ nodes:
2727
- role: control-plane
2828
image: kindest/node:v1.28.0
2929
extraMounts:
30-
- hostPath: AMORO_LOG_PLACEHOLDER
31-
containerPath: /mnt/amoro-logs
30+
- hostPath: FUSION_LOG_PLACEHOLDER
31+
containerPath: /mnt/fusion-logs
3232
kubeadmConfigPatches:
3333
- |
3434
kind: InitConfiguration
@@ -46,8 +46,8 @@ nodes:
4646
- role: worker
4747
image: kindest/node:v1.28.0
4848
extraMounts:
49-
- hostPath: AMORO_LOG_PLACEHOLDER
50-
containerPath: /mnt/amoro-logs
49+
- hostPath: FUSION_LOG_PLACEHOLDER
50+
containerPath: /mnt/fusion-logs
5151
kubeadmConfigPatches:
5252
- |
5353
kind: JoinConfiguration
@@ -57,8 +57,8 @@ nodes:
5757
- role: worker
5858
image: kindest/node:v1.28.0
5959
extraMounts:
60-
- hostPath: AMORO_LOG_PLACEHOLDER
61-
containerPath: /mnt/amoro-logs
60+
- hostPath: FUSION_LOG_PLACEHOLDER
61+
containerPath: /mnt/fusion-logs
6262
kubeadmConfigPatches:
6363
- |
6464
kind: JoinConfiguration

0 commit comments

Comments
 (0)