This is an automated email from the ASF dual-hosted git repository. luzhijing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new b68971c8d51 add all-in-one download and 2.0.0 links (#221) b68971c8d51 is described below commit b68971c8d519a8b7467e0df356473bec152ead9f Author: wangyongfeng <943155...@qq.com> AuthorDate: Sat May 6 22:07:13 2023 +0800 add all-in-one download and 2.0.0 links (#221) Co-authored-by: wangyf0555 <wangyongf...@flywheels.com> --- .github/workflows/cron-deploy-website.yml | 2 + .github/workflows/manual-deploy-website.yml | 2 + src/constant/download.data.ts | 43 ++++- src/pages/download/index.scss | 83 +++++++- src/pages/download/index.tsx | 289 ++++++++++++++++++++-------- 5 files changed, 338 insertions(+), 81 deletions(-) diff --git a/.github/workflows/cron-deploy-website.yml b/.github/workflows/cron-deploy-website.yml index e212b34a3f4..3ae4a6d53e0 100644 --- a/.github/workflows/cron-deploy-website.yml +++ b/.github/workflows/cron-deploy-website.yml @@ -56,6 +56,8 @@ jobs: touch build/.dummy cp .asf-site.yaml ./build/.asf.yaml cp versions.json ./build/ + mkdir -p ./build/download-scripts/ + cp -R doris/dist/download_scripts/* ./build/download-scripts/ ls build export DORIS_COMMIT=`git rev-parse HEAD` diff --git a/.github/workflows/manual-deploy-website.yml b/.github/workflows/manual-deploy-website.yml index fa4406048ff..297e6ec595f 100644 --- a/.github/workflows/manual-deploy-website.yml +++ b/.github/workflows/manual-deploy-website.yml @@ -59,6 +59,8 @@ jobs: touch build/.dummy cp .asf-site.yaml ./build/.asf.yaml cp versions.json ./build/ + mkdir -p ./build/download-scripts/ + cp -R doris/dist/download_scripts/* ./build/download-scripts/ ls build export DORIS_COMMIT=`git rev-parse HEAD` diff --git a/src/constant/download.data.ts b/src/constant/download.data.ts index 5193f26a332..4b0e230e4ba 100644 --- a/src/constant/download.data.ts +++ b/src/constant/download.data.ts @@ -8,6 +8,7 @@ interface item { } export interface DownloadLinkProps { id: string; + sh?: string; items: item[]; } @@ -26,9 +27,41 @@ const CHINA_ALL_RELEASE_MIRROR_LINK = 'https://archive.apache.org/dist/'; export function getAllDownloadLinks(locale: string) { const sources = locale.toLocaleUpperCase() === 'EN' ? APACHE_LINK : CHINA_MIRROR_LINK; + const shSource = locale.toLocaleUpperCase() === 'EN' ? 'apache' : 'tsinghua'; return [ + { + id: '2.0.0-alpha1-intel-avx2-jdk8', + sh: `https://doris.apache.org/download-scripts/2.0.0-alpha1/download_x64_${shSource}.sh`, + items: [ + { + label: 'apache-doris-fe-2.0.0-alpha1-bin-x86_64.tar.xz', + links: { + source: `${sources}doris/2.0/2.0.0-alpha1/apache-doris-fe-2.0.0-alpha1-bin-x86_64.tar.xz`, + signature: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-fe-2.0.0-alpha1-bin-x86_64.tar.xz.asc`, + sha512: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-fe-2.0.0-alpha1-bin-x86_64.tar.xz.sha512`, + }, + }, + { + label: 'apache-doris-be-2.0.0-alpha1-bin-x86_64.tar.xz', + links: { + source: `${sources}doris/2.0/2.0.0-alpha1/apache-doris-be-2.0.0-alpha1-bin-x86_64.tar.xz`, + signature: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-be-2.0.0-alpha1-bin-x86_64.tar.xz.asc`, + sha512: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-be-2.0.0-alpha1-bin-x86_64.tar.xz.sha512`, + }, + }, + { + label: 'apache-doris-dependencies-2.0.0-alpha1-bin-x86_64.tar.xz', + links: { + source: `${sources}doris/2.0/2.0.0-alpha1/apache-doris-dependencies-2.0.0-alpha1-bin-x86_64.tar.xz`, + signature: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-dependencies-2.0.0-alpha1-bin-x86_64.tar.xz.asc`, + sha512: `${APACHE_LINK}doris/2.0/2.0.0-alpha1/apache-doris-dependencies-2.0.0-alpha1-bin-x86_64.tar.xz.sha512`, + }, + }, + ], + }, { id: '1.2.4.1-intel-avx2-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.4.1/download_x64_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.4.1-bin-x86_64.tar.xz', @@ -58,6 +91,7 @@ export function getAllDownloadLinks(locale: string) { }, { id: '1.2.4.1-intel-noavx2-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.4.1/download_x64_noavx2_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.4.1-bin-x86_64.tar.xz', @@ -87,6 +121,7 @@ export function getAllDownloadLinks(locale: string) { }, { id: '1.2.4.1-arm-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.4.1/download_arm_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.4.1-bin-arm.tar.xz', @@ -116,6 +151,7 @@ export function getAllDownloadLinks(locale: string) { }, { id: '1.2.3-intel-avx2-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.3/download_x64_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.3-bin-x86_64.tar.xz', @@ -145,6 +181,7 @@ export function getAllDownloadLinks(locale: string) { }, { id: '1.2.3-intel-noavx2-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.3/download_x64_noavx2_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.3-bin-x86_64.tar.xz', @@ -174,6 +211,7 @@ export function getAllDownloadLinks(locale: string) { }, { id: '1.2.3-arm-jdk8', + sh: `https://doris.apache.org/download-scripts/1.2.3/download_arm_${shSource}.sh`, items: [ { label: 'apache-doris-fe-1.2.3-bin-arm.tar.xz', @@ -436,8 +474,9 @@ export function getAllRelease(locale: string) { } export enum VersionEnum { - Latest = '1.2.4.1', - Prev = '1.1.5', + Latest = '2.0.0-alpha1', + Prev = '1.2.4.1', + Earlier = '1.1.5', } export enum CPUEnum { diff --git a/src/pages/download/index.scss b/src/pages/download/index.scss index 03a20ae9ca0..8657b52c661 100644 --- a/src/pages/download/index.scss +++ b/src/pages/download/index.scss @@ -40,6 +40,10 @@ margin-top: 1rem; } + &.way { + align-items: start; + } + label { font-size: var(--global-font-size-default); font-weight: 600; @@ -101,15 +105,92 @@ } } } + .download-way { + display: none; + &.show { + display: block; + width: 100%; + } + &.all-in-one { + .theme-code-block { + font-size: 1rem; + padding-left: 2rem; + position: relative; + &:before { + content: '$'; + position: absolute; + left: 1rem; + top: 50%; + transform: translateY(-50%); + font-size: 1rem; + } + } + } + } .tips { - margin-left: 11.1875rem; margin-top: 1rem; .title { color: #556986; font-weight: 600; font-size: var(--global-font-size-smaller); } + .notice-text { + font-size: var(--global-font-size-smaller); + font-weight: 600; + color: #556986; + } + .notice-dir { + display: flex; + // margin-bottom: 0.5rem; + .notice-dir-name { + min-width: 10rem; + padding-left: 3.5rem; + &.md { + position: relative; + &:before { + position: absolute; + left: 0.8rem; + content: ''; + width: 0; + height: 100%; + border-left: 1.5px solid #556986; + } + &:after { + position: absolute; + left: 0.8rem; + top: 50%; + content: ''; + width: 2rem; + height: 0; + border-top: 1.5px solid #556986; + } + } + &.end { + position: relative; + &:before { + position: absolute; + left: 0.8rem; + content: ''; + width: 0; + height: 50%; + border-left: 1.5px solid #556986; + } + &:after { + position: absolute; + left: 0.8rem; + top: 50%; + content: ''; + width: 2rem; + height: 0; + border-top: 1.5px solid #556986; + } + } + } + .notice-dir-val { + margin-left: 1rem; + } + } ul { margin: 0; padding: 0; diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index e7980078ed6..df55ce0b861 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -22,12 +22,9 @@ import { const BINARY_VERSION = [ { label: `${VersionEnum.Latest} ( latest )`, value: VersionEnum.Latest }, { label: VersionEnum.Prev, value: VersionEnum.Prev }, + { label: VersionEnum.Earlier, value: VersionEnum.Earlier }, ]; -const CPU = [ - { label: 'X64 ( avx2 )', value: CPUEnum.IntelAvx2 }, - { label: 'X64 ( no avx2 )', value: CPUEnum.IntelNoAvx2 }, - { label: 'ARM64', value: CPUEnum.ARM }, -]; + const JDK = [ { label: 'JDK 8', value: JDKEnum.JDK8 }, { label: 'JDK 11', value: JDKEnum.JDK11 }, @@ -40,9 +37,11 @@ export default function Download(): JSX.Element { } = useDocusaurusContext(); const [version, setVersion] = useState<string>(VersionEnum.Latest); + const [cpus, setCpus] = useState<any[]>([]); const [cpu, setCPU] = useState<string>(CPUEnum.IntelAvx2); const [jdk, setJDK] = useState<string>(JDKEnum.JDK8); const [current, setCurrent] = useState<DownloadLinkProps>(); + const [downloadWay, setDownloadWay] = useState<string>('all-in-one'); const FLINK_CONNECTOR = getAllFlinkConnectorDownloadLinks(currentLocale); const SPARK_CONNECTOR = getAllSparkConnectorDownloadLinks(currentLocale); @@ -64,6 +63,9 @@ export default function Download(): JSX.Element { const text = `${version}-${cpu}-${jdk}`; const linkObj = getAllDownloadLinks(currentLocale).find(item => item.id === text); setCurrent(linkObj); + if (!linkObj.sh) { + setDownloadWay('download'); + } }; function downloadFile(url: string) { @@ -87,11 +89,31 @@ export default function Download(): JSX.Element { : 'https://cdn-tencent.selectdb.com/assets/files/Apache Doris Docs (中文).pdf'; downloadFile(url); }; + + const CPU = [ + { label: 'X64 ( avx2 )', value: CPUEnum.IntelAvx2 }, + { label: 'X64 ( no avx2 )', value: CPUEnum.IntelNoAvx2 }, + { label: 'ARM64', value: CPUEnum.ARM }, + ]; + + const getCpus = version => { + const currentCpus = []; + getAllDownloadLinks(currentLocale).forEach(item => { + if (item.id.includes(version)) { + const matchCpu = CPU.find(cpu => item.id.includes(cpu.value)); + currentCpus.push(matchCpu); + } + }); + return currentCpus; + }; + useEffect(() => { getDownloadLinks(); }, [version, cpu, jdk]); useEffect(() => { + const currentCpus = getCpus(version); + setCpus(currentCpus); setCPU(CPUEnum.IntelAvx2); setJDK(JDKEnum.JDK8); }, [version]); @@ -141,7 +163,7 @@ export default function Download(): JSX.Element { </Translate> </label> <div className="tabs-radio"> - {CPU.map(item => ( + {cpus.map(item => ( <div className={clsx('radio', { checked: cpu === item.value, @@ -176,87 +198,198 @@ export default function Download(): JSX.Element { ))} </div> </div> */} - <div className="download-type"> + {current?.sh && ( + <div className="download-type"> + <label> + <Translate id="download.download.link" description="Download"> + Download + </Translate> + </label> + <div className="tabs-radio"> + <div + onClick={() => setDownloadWay('all-in-one')} + className={clsx('radio', { + checked: downloadWay === 'all-in-one', + })} + > + <span> + {currentLocale === 'zh-CN' + ? 'Download All-in-one (推荐)' + : 'Download All-in-one (Recommended)'} + </span> + </div> + + <div + onClick={() => setDownloadWay('download')} + className={clsx('radio', { + checked: downloadWay === 'download', + })} + > + <Translate id="download.download.link" description="Download"> + Download + </Translate> + </div> + </div> + </div> + )} + + <div className="download-type way"> <label> - <Translate id="download.download.link" description="Download"> - Download - </Translate> + {!current?.sh && ( + <Translate id="download.download.link" description="Download"> + Download + </Translate> + )} </label> - <div className="tabs-radio"> - <div className="radio"> - {current?.items.map(item => ( - <div className="inner" key={item.label}> - <Link to={item?.links.source}>{item?.label}</Link> - <span> ( </span> - <Link to={item?.links.signature}>asc</Link>,{' '} - <Link to={item?.links.sha512}>sha512</Link> - <span> )</span> + <div + className={clsx('download-way all-in-one', { + show: downloadWay === 'all-in-one', + })} + > + <div> + <CodeBlock language="xml" title=""> + {`curl ${current?.sh} | sh`} + </CodeBlock> + </div> + <div className="tips"> + <div className="title"> + <Translate id="Notice">Notice</Translate> + {currentLocale === 'zh-CN' ? ':' : ':'} + </div> + {currentLocale === 'zh-CN' ? ( + <div> + <div className="notice-text"> + 推荐使用下载脚本一键下载所有二进制文件包(仅适用于 Linux 平台)。 + </div> + <div className="notice-text">下载后的目录结构如下:</div> + <div className="notice-text"> + <div>{`apache-doris-<version>-bin/`}</div> + <div className="notice-dir "> + <span className="notice-dir-name md">be</span> + <span className="notice-dir-val">Backend</span> + </div> + <div className="notice-dir"> + <span className="notice-dir-name md">fe</span> + <span className="notice-dir-val">Frontend</span> + </div> + <div className="notice-dir"> + <span className="notice-dir-name end">dependencies</span> + <span className="notice-dir-val">Broker、Audlit Plugin</span> + </div> + </div> + </div> + ) : ( + <div> + <div className="notice-text"> + Download(All-in-one) is recommended(For Linux platform ONLY) to use. It + will download all packages automatically. + </div> + <div className="notice-text">The result will be like:</div> + <div className="notice-text"> + <div>{`apache-doris-<version>-bin/`}</div> + <div className="notice-dir "> + <span className="notice-dir-name md">be</span> + <span className="notice-dir-val">Backend</span> + </div> + <div className="notice-dir"> + <span className="notice-dir-name md">fe</span> + <span className="notice-dir-val">Frontend</span> + </div> + <div className="notice-dir"> + <span className="notice-dir-name end">dependencies</span> + <span className="notice-dir-val">Broker、Audlit Plugin</span> + </div> + </div> </div> - ))} + )} </div> </div> - </div> - <div className="tips"> - <div className="title"> - <Translate id="Notice">Notice</Translate> - {currentLocale === 'zh-CN' ? ':' : ':'} - </div> - <ul> - {version === VersionEnum.Latest ? ( - <> - {currentLocale === 'zh-CN' ? ( + <div + className={clsx('download-way', { + show: downloadWay === 'download', + })} + > + <div className="tabs-radio"> + <div className="radio"> + {current?.items.map(item => ( + <div className="inner" key={item.label}> + <Link to={item?.links.source}>{item?.label}</Link> + <span> ( </span> + <Link to={item?.links.signature}>asc</Link>,{' '} + <Link to={item?.links.sha512}>sha512</Link> + <span> )</span> + </div> + ))} + </div> + </div> + <div className="tips"> + <div className="title"> + <Translate id="Notice">Notice</Translate> + {currentLocale === 'zh-CN' ? ':' : ':'} + </div> + <ul> + {version === VersionEnum.Latest ? ( <> - <li> - 由于 Apache 服务器文件大小限制,1.2 - 版本的二进制程序被分为三个包,其中新增的 apache-doris-dependencies - 包含用于支持 JDBC 外表和 JAVA UDF 的jar包,以及 Broker 和 - AuditLoader。 下载后,需要将其中的 - java-udf-jar-with-dependencies.jar 放到 be/lib 目录下。 - 详细升级注意事项请参考 - <Link to="/docs/dev/releasenotes/release-1.2.4.1"> - 1.2.4.1 Release Note - </Link> - 以及 - <Link to="/docs/dev/install/standard-deployment"> - <Translate id="Installation and deployment"> - Installation and deployment - </Translate> - </Link> - 以及 - <Link to="/docs/dev/admin-manual/cluster-management/upgrade"> - <Translate id="Cluster Upgrade">Cluster Upgrade</Translate> - </Link> - 手册。 - </li> + {currentLocale === 'zh-CN' ? ( + <> + <li> + 由于 Apache 服务器文件大小限制,2.0.0 Alpha1 + 版本的二进制程序被分为三个包,其中新增的 + apache-doris-dependencies 包含用于支持 JDBC 外表和 JAVA UDF + 的jar包,以及 Broker 和 AuditLoader。 下载后,需要将其中的 + java-udf-jar-with-dependencies.jar 放到 be/lib 目录下。 + 详细升级注意事项请参考 + <Link to="/docs/dev/releasenotes/release-2.0.0Alpha1"> + 2.0.0 Alpha1 Release Note + </Link> + 以及 + <Link to="/docs/dev/install/standard-deployment"> + <Translate id="Installation and deployment"> + Installation and deployment + </Translate> + </Link> + 以及 + <Link to="/docs/dev/admin-manual/cluster-management/upgrade"> + <Translate id="Cluster Upgrade"> + Cluster Upgrade + </Translate> + </Link> + 手册。 + </li> + </> + ) : ( + <> + <li> + Due to the file size limitation of the Apache server, the + binary program of version 2.0.0 Alpha1 is divided into three + packages, among which the newly added + apache-doris-dependencies include jar packages for + supporting JDBC appearance and JAVA UDF, as well as Broker + and AuditLoader. After downloading, you need to put the + java-udf-jar-with-dependencies.jar in the be/lib directory. + </li> + </> + )} </> ) : ( - <> - <li> - Due to the file size limitation of the Apache server, the binary - program of version 1.2 is divided into three packages, among which - the newly added apache-doris-dependencies include jar packages for - supporting JDBC appearance and JAVA UDF, as well as Broker and - AuditLoader. After downloading, you need to put the - java-udf-jar-with-dependencies.jar in the be/lib directory. - </li> - </> + '' )} - </> - ) : ( - '' - )} - <li> - <Translate id="download.quick.download.intr.prefix"> - If the CPU does not support the avx2 instruction set, select the no avx2 - version. You can check whether it is supported by - </Translate> - <code>cat /proc/cpuinfo</code> - <Translate id="download.quick.download.intr.suffix"> - . The avx2 instruction will improve the computational efficiency of data - structures such as bloom filter. - </Translate> - </li> - </ul> + {cpus.some(item => item.value === CPUEnum.IntelNoAvx2) && ( + <li> + <Translate id="download.quick.download.intr.prefix"> + If the CPU does not support the avx2 instruction set, select the no + avx2 version. You can check whether it is supported by + </Translate> + <code>cat /proc/cpuinfo</code> + <Translate id="download.quick.download.intr.suffix"> + . The avx2 instruction will improve the computational efficiency of + data structures such as bloom filter. + </Translate> + </li> + )} + </ul> + </div> + </div> </div> </div> </PageColumn> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org