Skip to content

Commit

Permalink
[KYUUBI #5987] Always export KYUUBI_HOME in load-kyuubi-env.sh
Browse files Browse the repository at this point in the history
# 🔍 Description
## Issue References 🔗

This is a follow-up of #5987, after applying #5987, I found a regression, the Kyuubi Server Java process can not see KYUUBI_HOME env if we don't declare KYUUBI_HOME as an env var explicitly, this breaks the main resources jar discovery of the engine, and eventually fails the engine bootstrap.

## Describe Your Solution 🔧

Restore `export KYUUBI_HOME` logic in `load-kyuubi-env.sh`

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

Build and start Kyuubi Server.
```
export SPARK_HOME=/Users/chengpan/app/spark-3.5.0-bin-hadoop3
build/dist --spark-provided --flink-provided --hive-provided
dist/bin/kyuubi run
```

Open session to launch a Spark engine
```
dist/bin/beeline -u 'jdbc:hive2://0.0.0.0:10009/default'
```

#### Behavior Without This Pull Request ⚰️

A wrong `kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar` location was found.
```
/Users/chengpan/app/spark-3.5.0-bin-hadoop3/bin/spark-submit \
        ...
        --proxy-user chengpan /Users/chengpan/Projects/apache-kyuubi/dist/jars/externals/kyuubi-spark-sql-engine/target/kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar
```

#### Behavior With This Pull Request 🎉

The correct `kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar` location was found.
```
/Users/chengpan/app/spark-3.5.0-bin-hadoop3/bin/spark-submit \
        ...
        --proxy-user chengpan /Users/chengpan/Projects/apache-kyuubi/dist/externals/engines/spark/kyuubi-spark-sql-engine_2.12-1.9.0-SNAPSHOT.jar
```

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6004 from pan3793/5987-followup.

Closes #5987

a4e40b6 [Cheng Pan] [KYUUBI #5987] Always export KYUUBI_HOME in load-kyuubi-env.sh

Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
pan3793 committed Jan 22, 2024
1 parent de4410d commit ac388d1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/load-kyuubi-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
# limitations under the License.
#


if [ -z "${KYUUBI_HOME}" ]; then
export KYUUBI_HOME="$(cd "$(dirname "$0")"/.. || exit; pwd)"
fi
export KYUUBI_HOME="${KYUUBI_HOME:-"$(cd "$(dirname "$0")"/.. || exit; pwd)"}"
export KYUUBI_CONF_DIR="${KYUUBI_CONF_DIR:-"${KYUUBI_HOME}"/conf}"

silent=0
Expand Down

0 comments on commit ac388d1

Please sign in to comment.