Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sidebar] added contact #8

Merged
merged 2 commits into from
Oct 9, 2023
Merged
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
22 changes: 4 additions & 18 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -20,19 +20,12 @@ jobs:
- name: Checkout The Docs Repo
uses: actions/checkout@v3

- name: Checkout Cloud Platform Source
uses: actions/checkout@v3
with:
repository: hpcaitech/Cloud-Platform-Docs-Website
token: ${{ secrets.CLOUD_PLATFORM_GITHUB_TOKEN }}
path: Cloud-Platform-Docs-Website

# Setup Node.js
- uses: actions/setup-node@v2
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: Cloud-Platform-Docs-Website/cloud-platform-documentation/package-lock.json
cache-dependency-path: docusaurus/package-lock.json

# Setup Python 3.8
- uses: actions/setup-python@v2
@@ -42,7 +35,7 @@ jobs:
# Build for international release
- name: 🔨 Build
run: |
PLATFORM_HOSTNAME=platform.colossalai.com bash ./scripts/build.sh Cloud-Platform-Docs-Website
PLATFORM_HOSTNAME=platform.colossalai.com bash ./scripts/build.sh
mv Cloud-Platform-Docs-Website/cloud-platform-documentation/build ./

# Deploy to GitHub Pages for international release
@@ -65,19 +58,12 @@ jobs:
- name: Checkout The Docs Repo
uses: actions/checkout@v3

- name: Checkout Cloud Platform Source
uses: actions/checkout@v3
with:
repository: hpcaitech/Cloud-Platform-Docs-Website
token: ${{ secrets.CLOUD_PLATFORM_GITHUB_TOKEN }}
path: Cloud-Platform-Docs-Website

# Setup Node.js
- uses: actions/setup-node@v2
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: Cloud-Platform-Docs-Website/cloud-platform-documentation/package-lock.json
cache-dependency-path: docusaurus/package-lock.json

# Setup Python 3.8
- uses: actions/setup-python@v2
@@ -87,7 +73,7 @@ jobs:
# Build for international release
- name: 🔨 Build
run: |
PLATFORM_HOSTNAME=platform.luchentech.com bash ./scripts/build.sh Cloud-Platform-Docs-Website
PLATFORM_HOSTNAME=platform.luchentech.com bash ./scripts/build.sh
mv ./Cloud-Platform-Docs-Website/cloud-platform-documentation/build ./

# scp to cloud server for China release
11 changes: 2 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -14,21 +14,14 @@ jobs:
- name: 📚 Checkout
uses: actions/checkout@v2

- name: Checkout Cloud Platform Docs Website
uses: actions/checkout@v3
with:
repository: hpcaitech/Cloud-Platform-Docs-Website
token: ${{ secrets.CLOUD_PLATFORM_GITHUB_TOKEN }}
path: Cloud-Platform-Docs-Website

# Setup Node.js
- uses: actions/setup-node@v2
with:
node-version: "16"
cache: "yarn"
cache-dependency-path: Cloud-Platform-Docs-Website/cloud-platform-documentation/package-lock.json
cache-dependency-path: docusaurus/package-lock.json

# Build
- name: 🔨 Build
run: |
bash ./scripts/build.sh Cloud-Platform-Docs-Website
bash ./scripts/build.sh
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ You will be able to preview the website at `http://localhost:3000/` by default.
In case you are modifying the frontend website source code and wanna preview the latest changes, you can run the following command to start the development server.

```bash
bash ./scripts/preview.sh <branch>
bash ./scripts/preview.sh
```

**Please note that the `<branch>` refers to the branch of the [Cloud-Platform-Docs-Website](https://github.com/hpcaitech/Cloud-Platform-Docs-Website) repository, not this repository.**
@@ -133,11 +133,11 @@ bash ./scripts/preview.sh <branch>
If you can preview your documentation locally, you can proceed to try to build your documentation. **Please note that preview does not guarantee that your documentation can be built successfully.**

```bash
bash ./scripts/build.sh <frontend-codebase-dir>
bash ./scripts/build.sh

# If you have run preview, your repository will be stored in .cache
# otherwise, you need to set your own path
bash ./scripts/build.sh .cache/Cloud-Platform-Docs-Website
bash ./scripts/build.sh
```

### 📦 Deployment
3 changes: 3 additions & 0 deletions docs/docs/contact/hpc-ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Talk to a HPC-AI Tech expert

Talk to a HPC-AI Tech expert. Click the link: [https://www.hpc-ai.tech/contact](https://www.hpc-ai.tech/contact).
Binary file added docs/docs/contact/images/WeChat.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/docs/contact/slack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Join our Slack workspace

Join the Colossal-AI workspace on Slack to contact us. [Click here](https://join.slack.com/t/colossalaiworkspace/shared_invite/zt-2404o93sy-Y3~br1qkIeEcMOVSfJ8YYg).

Have joined? [Click here](https://colossalaiworkspace.slack.com/team/U02NCSGFD52).
3 changes: 3 additions & 0 deletions docs/docs/contact/wechat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add our WeChat account

![WeChat](./images/WeChat.jpeg)
21 changes: 10 additions & 11 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -29,25 +29,24 @@ const sidebars = {
{
type: "category",
label: "训练任务",
items: [
"training/jobs",
"training/job_info",
],
items: ["training/jobs", "training/job_info"],
},
{
type: "category",
label: "推理API",
items: [
"inference/inference",
],
items: ["inference/inference"],
},
{
type: "category",
label: "命令行工具",
items: [
"cli/cli",
],
}
items: ["cli/cli"],
},
],
contactSidebar: [
`contact/${
process.env.PLATFORM_HOSTNAME?.includes("luchentech") ? "wechat" : "slack"
}`,
"contact/hpc-ai",
],
};

26 changes: 26 additions & 0 deletions docusaurus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*


#
docs/
blog/
sidebars.js
41 changes: 41 additions & 0 deletions docusaurus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docusaurus/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
173 changes: 173 additions & 0 deletions docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "ColossalAI Platform Documentation",
tagline: "ColossalAI Platform Documentation",
favicon: "img/favicon.ico",

// Set the production url of your site here
url: "https://docs.platform.colossalai.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "HPC-AI Technology Inc.", // Usually your GitHub org/user name.
projectName: "ColossalAI Platform", // Usually your repo name.

onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",

customFields: {
// Put your custom environment here
platformHostname: process.env.PLATFORM_HOSTNAME,
},

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
plugins: [
function (context, options) {
return {
name: "postcss-tailwindcss-loader",
configurePostCss(postcssOptions) {
postcssOptions.plugins.push(
require("postcss-import"),
require("tailwindcss"),
require("autoprefixer")
);
return postcssOptions;
},
};
},
],

presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: "light",
disableSwitch: true,
respectPrefersColorScheme: false,
},
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
navbar: {
title: "ColossalAI Platform",
logo: {
alt: "ColossalAI Platform",
src: "https://26563514.fs1.hubspotusercontent-eu1.net/hubfs/26563514/logos/colossal-ai_emblem.svg",
},
items: [
{
type: "docSidebar",
sidebarId: "contactSidebar",
position: "right",
label: "Contact Us",
},
{
type: "docSidebar",
sidebarId: "tutorialSidebar",
position: "right",
label: "Documentation",
},
{ to: "/blog", label: "Blog", position: "right" },
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/docs/intro",
},
{
label: "Blog",
to: "/blog",
},
],
},
{
title: "Company",
items: [
{
label: "About Us",
href: "https://www.hpc-ai.tech/",
},
{
label: "Customers",
href: "https://www.hpc-ai.tech/customers",
},
{
label: "Contact Us",
to: `/docs/contact/${
process.env.PLATFORM_HOSTNAME?.includes("luchentech")
? "wechat"
: "slack"
}`,
},
],
},
{
title: "Open-Source",
items: [
{
label: "Colossal-AI",
href: "https://colossalai.org/",
},
{
label: "ColossalAI Platform CLI",
href: "https://github.com/hpcaitech/ColossalAI-Platform-CLI",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} HPC-AI Technology, Inc.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
21,661 changes: 21,661 additions & 0 deletions docusaurus/package-lock.json

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "cloud-platform-documentation",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@headlessui/react": "^1.7.16",
"@heroicons/react": "^2.0.18",
"@mdx-js/react": "^1.6.22",
"autoprefixer": "^10.4.14",
"clsx": "^1.2.1",
"postcss": "^8.4.27",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"tailwindcss": "^3.3.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=16.14"
}
}
97 changes: 97 additions & 0 deletions docusaurus/src/components/Landing/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React from "react";

import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

export default function Example() {

const {
siteConfig: {customFields},
} = useDocusaurusContext();

return (
<div className="relative isolate overflow-hidden bg-white">
<svg
className="absolute inset-0 -z-10 h-full w-full stroke-gray-200 [mask-image:radial-gradient(100%_100%_at_top_right,white,transparent)]"
aria-hidden="true"
>
<defs>
<pattern
id="0787a7c5-978c-4f66-83c7-11c213f99cb7"
width={200}
height={200}
x="50%"
y={-1}
patternUnits="userSpaceOnUse"
>
<path d="M.5 200V.5H200" fill="none" />
</pattern>
</defs>
<rect
width="100%"
height="100%"
strokeWidth={0}
fill="url(#0787a7c5-978c-4f66-83c7-11c213f99cb7)"
/>
</svg>
<div className="mx-auto max-w-7xl px-6 pb-24 pt-10 sm:pb-32 lg:flex lg:px-8 lg:py-40">
<div className="mx-auto max-w-2xl lg:mx-0 lg:max-w-xl lg:flex-shrink-0 lg:pt-8">
{/* Update note */}
{/* <div className="mt-24 sm:mt-32 lg:mt-16">
<a href="#" className="inline-flex space-x-6">
<span className="rounded-full bg-indigo-600/10 px-3 py-1 text-sm font-semibold leading-6 text-indigo-600 ring-1 ring-inset ring-indigo-600/10">
What's new
</span>
<span className="inline-flex items-center space-x-2 text-sm font-medium leading-6 text-gray-600">
<span>Just shipped v1.0</span>
<ChevronRightIcon
className="h-5 w-5 text-gray-400"
aria-hidden="true"
/>
</span>
</a>
</div> */}

<h1 className="mt-10 text-4xl font-bold tracking-tight text-gray-900 sm:text-6xl">
Accelerate{" "}
<img className="h-11" src="img/lightning.png" alt="Your Company" />{" "}
Development for AI
</h1>

<p className="mt-6 text-lg leading-8 text-gray-600">
Your fully managed AI platform to train, deploy, and scale AI with
ease.
</p>
<div className="mt-10 flex items-center gap-x-6">
<a
href="/docs/intro"
className="rounded-md bg-blue-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:text-white hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
>
Documentation
</a>
<a
href={`https://${customFields.platformHostname}`}
className="text-sm font-semibold leading-6 text-gray-900"
>
Try out platform <span aria-hidden="true"></span>
</a>
</div>
</div>

{/* Image */}
<div className="mx-auto mt-16 flex max-w-2xl sm:mt-24 lg:ml-10 lg:mr-0 lg:mt-0 lg:max-w-none lg:flex-none xl:ml-32">
<div className="max-w-3xl flex-none sm:max-w-5xl lg:max-w-none">
<div className="-m-2 rounded-xl bg-gray-900/5 p-2 ring-1 ring-inset ring-gray-900/10 lg:-m-4 lg:rounded-2xl lg:p-4">
<img
src="img/platform.png"
alt="App screenshot"
width={2432}
height={1442}
className="h-2/3 w-[76rem] rounded-md shadow-2xl ring-1 ring-gray-900/10"
/>
</div>
</div>
</div>
</div>
</div>
);
}
34 changes: 34 additions & 0 deletions docusaurus/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

@tailwind base;
@tailwind components;
@tailwind utilities;

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #3b82f6;
--ifm-color-primary-dark: #2563eb;
--ifm-color-primary-darker: #1d4ed8;
--ifm-color-primary-darkest: #1e40af;
--ifm-color-primary-light: #60a5fa;
--ifm-color-primary-lighter: #93c5fd;
--ifm-color-primary-lightest: #bfdbfe;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme="dark"] {
--ifm-color-primary: #3b82f6;
--ifm-color-primary-dark: #2563eb;
--ifm-color-primary-darker: #1d4ed8;
--ifm-color-primary-darkest: #1e40af;
--ifm-color-primary-light: #60a5fa;
--ifm-color-primary-lighter: #93c5fd;
--ifm-color-primary-lightest: #bfdbfe;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
20 changes: 20 additions & 0 deletions docusaurus/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import Landing from "@site/src/components/Landing";

export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`${siteConfig.title}`}
description="ColossalAI Platform Documentation"
>
<main>
<div className="min-w-screen min-h-screen">
<Landing />
</div>
</main>
</Layout>
);
}
23 changes: 23 additions & 0 deletions docusaurus/src/pages/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/

.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
}

@media screen and (max-width: 996px) {
.heroBanner {
padding: 2rem;
}
}

.buttons {
display: flex;
align-items: center;
justify-content: center;
}
7 changes: 7 additions & 0 deletions docusaurus/src/pages/markdown-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Markdown page example
---

# Markdown page example

You don't need React to write simple standalone pages.
Empty file added docusaurus/static/.nojekyll
Empty file.
Binary file added docusaurus/static/img/favicon.ico
Binary file not shown.
Binary file added docusaurus/static/img/lightning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/static/img/platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docusaurus/static/img/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docusaurus/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
corePlugins: {
preflight: false, // disable Tailwind's reset
},
content: ["./src/**/*.{js,jsx,ts,tsx}", "../docs/**/*.mdx"], // my markdown stuff is in ../docs, not /src
darkMode: ["class", '[data-theme="dark"]'], // hooks into docusaurus' dark mode settigns
theme: {
extend: {},
},
plugins: [],
};
7,847 changes: 7,847 additions & 0 deletions docusaurus/yarn.lock

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -2,23 +2,12 @@
# set -x # for debug
set -euo pipefail # fail early

# ======================
# Get the arguments
# ======================
WEB_REPO_DIR=${1}
WEB_REPO_DIR=$(realpath $WEB_REPO_DIR)

# ======================
# Set up the variables
# ======================
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR="$SCRIPT_DIR/.."
CACHE_DIR="$ROOT_DIR/.cache"

# ======================
# Set up the website
# ======================
DOCUSAURUS_DIR="$WEB_REPO_DIR/cloud-platform-documentation"
DOCUSAURUS_DIR="$ROOT_DIR/docusaurus"

# install the dependency
cd $DOCUSAURUS_DIR
30 changes: 1 addition & 29 deletions scripts/preview.sh
Original file line number Diff line number Diff line change
@@ -2,45 +2,17 @@
# set -x # for debug
set -euo pipefail # fail early

# ======================
# Get the arguments
# ======================
BRANCH=${1:-main}

# ======================
# Set up the variables
# ======================
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR="$SCRIPT_DIR/.."
CACHE_DIR="$ROOT_DIR/.cache"

# ======================
# Set up the website
# ======================
WEB_REPO="git@github.com:hpcaitech/Cloud-Platform-Docs-Website.git"
REPO_DIR="$CACHE_DIR/Cloud-Platform-Docs-Website"
DOCUSAURUS_DIR="$REPO_DIR/cloud-platform-documentation"

mkdir -p $CACHE_DIR
cd $CACHE_DIR

if [ ! -d "$WEB_REPO" ] ; then
git clone "$WEB_REPO"
echo "[INFO] Cloning the website code to ${CACHE_DIR} via ${WEB_REPO}"
else
echo "[INFO] Using existing website code in ${CACHE_DIR}"
fi

# check out to the branch
cd $REPO_DIR
git fetch origin
git checkout $BRANCH
DOCUSAURUS_DIR="$ROOT_DIR/docusaurus"

# install the dependency
cd $DOCUSAURUS_DIR
yarn install


# ======================
# Set up the docs
# ======================