From fb408e7d218aeb3a9b2ba392de18598a00c36656 Mon Sep 17 00:00:00 2001 From: sandygao Date: Fri, 25 Sep 2020 17:05:41 +0800 Subject: [PATCH] !293 [I1WMH4] Update installation doc to remove hardcoded version number * Update installation documentation to remove hardcoded version string --- docker/Dockerfile | 2 +- docker/bin/openlk | 16 ++++++++++++++++ docker/build-local.sh | 3 ++- hetu-docs/en/installation/cli.md | 2 +- hetu-docs/en/installation/deployment-auto.md | 2 +- hetu-docs/zh/installation/cli.md | 2 +- hetu-docs/zh/installation/deployment-auto.md | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 docker/bin/openlk diff --git a/docker/Dockerfile b/docker/Dockerfile index 7d800674d..27bd85046 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,7 +36,7 @@ ARG PORT=8080 # Install OpenLooKeng Engine Executable COPY --chown=openlkadmin:openlkadmin hetu-server-${OPENLK_VERSION} /usr/lib/hetu # Install CLI -COPY --chown=openlkadmin:openlkadmin hetu-cli-${OPENLK_VERSION}-executable.jar /usr/bin/openlk +COPY --chown=openlkadmin:openlkadmin openlk /usr/bin/openlk EXPOSE $PORT USER openlkadmin:openlkadmin diff --git a/docker/bin/openlk b/docker/bin/openlk new file mode 100644 index 000000000..2c7ca4284 --- /dev/null +++ b/docker/bin/openlk @@ -0,0 +1,16 @@ +#!/bin/bash + +# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. +# 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. + +java -jar /usr/lib/hetu/hetu-cli-*-executable.jar "$@" diff --git a/docker/build-local.sh b/docker/build-local.sh index 54814654a..082532af7 100755 --- a/docker/build-local.sh +++ b/docker/build-local.sh @@ -73,7 +73,8 @@ tar -C ${WORK_DIR} -xzf ${WORK_DIR}/hetu-server-${HETU_VERSION}.tar.gz rm ${WORK_DIR}/hetu-server-${HETU_VERSION}.tar.gz cp -R bin default ${WORK_DIR}/hetu-server-${HETU_VERSION} -cp ../presto-cli/target/hetu-cli-${HETU_VERSION}-executable.jar ${WORK_DIR} +cp ../presto-cli/target/hetu-cli-${HETU_VERSION}-executable.jar ${WORK_DIR}/hetu-server-${HETU_VERSION} +cp bin/openlk ${WORK_DIR} docker build ${WORK_DIR} -f Dockerfile --build-arg "OPENLK_VERSION=${HETU_VERSION}" --build-arg "BASE_IMAGE=${BASE_IMAGE}" -t "openlookeng:${TAG}" diff --git a/hetu-docs/en/installation/cli.md b/hetu-docs/en/installation/cli.md index 0147863ba..d52dd61e6 100644 --- a/hetu-docs/en/installation/cli.md +++ b/hetu-docs/en/installation/cli.md @@ -3,7 +3,7 @@ The openLooKeng CLI provides a terminal-based interactive shell for running queries. The CLI is a runnable JAR file, so it can be run as `java -jar ./hetu-cli-*.jar`. -Download `hetu-cli-1.0.0-executable.jar`, and run: +Download CLI jar file corresponding to the server's version, e.g. `hetu-cli-1.0.0-executable.jar`, and run: ``` shell java -jar ./hetu-cli-1.0.0-executable.jar --server localhost:8080 --catalog hive --schema default diff --git a/hetu-docs/en/installation/deployment-auto.md b/hetu-docs/en/installation/deployment-auto.md index b226a805c..c2d218cb2 100644 --- a/hetu-docs/en/installation/deployment-auto.md +++ b/hetu-docs/en/installation/deployment-auto.md @@ -186,7 +186,7 @@ If you can't access the download URL from the machine where you want to install 1. Download `https://download.openlookeng.io/auto-install/openlookeng.tar.gz` and extract its content to `/opt`. -1. Create folder `/opt/openlookeng/resource` and save openLooKeng binary files under it: `https://download.openlookeng.io/010/hetu-server-010.tar.gz` and `https://download.openlookeng.io/010/hetu-cli-010-executable.jar`. +1. Create folder `/opt/openlookeng/resource` and save openLooKeng binary files under it: `https://download.openlookeng.io//hetu-server-.tar.gz` and `https://download.openlookeng.io//hetu-cli--executable.jar`, where `` refers to the version being installed, e.g. `1.0.0`. 1. Also save third party dependencies under `/opt/openlookeng/resource`. That is, download all files from either `https://download.openlookeng.io/auto-install/third-resource/x86/` or `https://download.openlookeng.io/auto-install/third-resource/aarch64/`, depending on the machine's architecture. This should include 1 `OpenJDK` file and 2 `sshpass` files. diff --git a/hetu-docs/zh/installation/cli.md b/hetu-docs/zh/installation/cli.md index e3852ce1c..74c129adc 100644 --- a/hetu-docs/zh/installation/cli.md +++ b/hetu-docs/zh/installation/cli.md @@ -3,7 +3,7 @@ openLooKeng CLI提供了一个基于终端的交互shell,用于运行查询。CLI是一个可执行的JAR文件,可以通过`java -jar ./hetu-cli-*.jar`执行。 -下载:`hetu-cli-1.0.0-executable.jar`,运行: +下载于服务器对应版本的 CLI 文件,例如:`hetu-cli-1.0.0-executable.jar`,运行: ``` shell java -jar ./hetu-cli-1.0.0-executable.jar --server localhost:8080 --catalog hive --schema default diff --git a/hetu-docs/zh/installation/deployment-auto.md b/hetu-docs/zh/installation/deployment-auto.md index 04d94524e..5a30a20a5 100644 --- a/hetu-docs/zh/installation/deployment-auto.md +++ b/hetu-docs/zh/installation/deployment-auto.md @@ -176,7 +176,7 @@ bash /opt/openlookeng/bin/uninstall.sh --all 1. 下载 `https://download.openlookeng.io/auto-install/openlookeng.tar.gz` 并将其内容解压到 `/opt` 目录。 -1. 创建目录 `/opt/openlookeng/resource` 并保存 openLooKeng 执行文件 `https://download.openlookeng.io/010/hetu-server-010.tar.gz` 和 `https://download.openlookeng.io/010/hetu-cli-010-executable.jar`。 +1. 创建目录 `/opt/openlookeng/resource` 并保存 openLooKeng 执行文件 `https://download.openlookeng.io//hetu-server-.tar.gz` 和 `https://download.openlookeng.io//hetu-cli--executable.jar`,其中``对应于正在安装的版本,例如`1.0.0`。 1. 同时将第三方依赖保存在 `/opt/openlookeng/resource` 目录下。根据本机的架构,下载 `https://download.openlookeng.io/auto-install/third-resource/x86/` 或 `https://download.openlookeng.io/auto-install/third-resource/aarch64/` 下面的全部文件。这应该包括一个 `OpenJDK` 文件和两个 `sshpass` 文件。