Skip to content

Commit

Permalink
[MINOR] doc: Improve English and add warning that web UI only works i…
Browse files Browse the repository at this point in the history
…n Chrome (#1314)

### What changes were proposed in this pull request?

Improve English and add warning that web UI only works in Chrome

### Why are the changes needed?

Clarity and to improve users what browser to use.

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

Built locally.

Co-authored-by: Justin Mclean <justin@classsoftware.com>
  • Loading branch information
github-actions[bot] and justinmclean authored Jan 3, 2024
1 parent 883404b commit c102d66
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/docker-image-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gravitino:0.3.0
- Docker image `datastrato/gravitino:0.3.0`
- Gravitino Server
- Expose ports:
- `8090` Gravitino web UI
- `8090` Gravitino Web UI
- `9001` Iceberg REST service

## Playground Docker image
Expand Down
73 changes: 35 additions & 38 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
This software is licensed under the Apache License version 2.
-->

# Gravitino Web
# Gravitino Web UI

> **⚠️ Important**
>
> Before running commands, you must ensure that you are in the front-end directory `gravitino/web`. If not, run `cd web` first.
---

## Getting Started
## Getting started

### Preparation | Framework & Dependencies
### Preparation | framework & dependencies

- [Node.js](https://nodejs.org)(v20.x+) & [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com/)
- [React](https://react.dev/)
Expand All @@ -24,7 +24,7 @@

> **TIP**
>
> Yarn package manager is recommended
> You should use the Yarn package manager.
>
> **Requirements**
>
Expand All @@ -35,45 +35,49 @@

### Development environment

- Run below command in console:
- Run the below command in the console to install the required dependencies.

```bash
# install dependencies
yarn install
```

- After installing the modules run your project with following command:
- After installing the modules start the development server with following command:

```bash
# start development server
yarn server
```

- Visit <http://localhost:3000> to check it in your browser. You can start editing the page such as `pages/index.js`. The page auto-updates as you edit the file.
- Visit <http://localhost:3000> to view the Gravitino Web UI in your browser. You can start editing the page such as `pages/index.js`. The page auto-updates as you edit the file.

### Development Scripts
:::caution important
The Gravitino Web UI only works in the latest version of the Chrome browser. You may encounter issues in other browsers.
:::

### Development scripts

This command runs ESLint to help you inspect the code. If errors occur, please make modifications based on the provided prompts.

```bash
yarn lint
# This command runs ESLint to help you inspect the code. If errors are printed, please make modifications based on the provided prompts.
```

This command runs Prettier to help you check your code styles. You can manually fix the code when errors are shown, or use `yarn format` to fix the code with Prettier CLI.

```bash
yarn prettier:check
# This command runs Prettier to help you check your code styles. you can manually to fix the code when errors are printed, or use `yarn format` to fix the code with Prettier CLI.
```

This command automatically formats the code.

```bash
yarn format
# This command helps you automatically format the code.

```

## Self-hosting Deployment
## Self-hosting deployment

### Node.js Server
### Node.js server

Next.js can be deployed to any hosting provider that supports Node.js. Make sure your `package.json` has the `build` and `start` scripts:
You can deploy Next.js to any hosting provider that supports Node.js. Make sure your `package.json` has the `build` and `start` scripts:

```json
{
Expand All @@ -85,39 +89,32 @@ Next.js can be deployed to any hosting provider that supports Node.js. Make sure
}
```

`next build` builds the production application in the `.next` folder. After building, `next start` starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages.
`yarn build` builds the production application in the `.next` folder. After building, `yarn start` starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages.

```bash
# build production files
yarn build

# start the nodejs server
yarn start
```

### Static HTML Export
### Static HTML export

Command `next export` allows you to export your app to static HTML, which can be run standalone without the need of a Node.js server.
The command `next export` allows you to export your app to static HTML, which runs standalone without the need for a Node.js server.

`next export` will generate an `dist` directory, which can be served by any static hosting service.
`next export` will generate a `dist` directory, producing content for any static hosting service.

```bash
yarn dist
# then copy the files within the 'dist' directory to the root directory of the static server
```
The command `yarn dist` copies the files within the 'dist' directory to the root directory of the static server.

## Docker

make sure you have installed the recent version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin). ([Docker Desktop](https://www.docker.com/products/docker-desktop/) already includes Docker Engine, Docker CLI and Docker Compose)
Make sure you have installed the most recent version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin). [Docker Desktop](https://www.docker.com/products/docker-desktop/) includes Docker Engine, Docker CLI, and Docker Compose.

> **⚠️ Important**
>
> All commands below are meant to be run in a `macOS` environment. If you are using a different system, you may encounter errors. Please modify the commands according to the system prompts.
> For example, if you are using `Windows`, replace `${PWD}` with `%cd%`, etc.
> All commands in this document run in a `macOS` environment. If you are using a different operating system, you may encounter errors.
Only use Docker to build static `HTML\CSS\JS` files directory
Only use Docker to build the static `HTML\CSS\JS` files directory.

Run below command in console:
Run the following commands in the console:

```bash
# ensure you are in the `web` directory
Expand All @@ -126,14 +123,14 @@ docker run -it -p 3000:3000 -v ${PWD}:/web -w /web --name gravitino-web node:20-
docker run -p 3000:3000 -v ${PWD}:/web --name gravitino-web node:20-slim /bin/bash -c "yarn install && yarn dist"
```

This command will run `yarn install` to install the dependencies specified in the `package.json` file and then run `yarn export` to export a static version of the application.
The exported files will be saved to the `dist` directory inside the container, which is mounted to the `dist` directory in the current directory of the host machine.
This means that the exported files will be accessible on the host machine after the command is executed.
This command runs `yarn install` to install the dependencies specified in the `package.json` file and then runs `yarn export` to export a static version of the application.
The exported files are saved to the `dist` directory inside the container, and mounted in the `dist` directory in the current directory of the host machine.
This means that the exported files are accessible on the host machine after running the command.

If you also want to start a server to view with demo, please change to the following code:
If you also want to start a server to view the demo, please use the following code:

```bash
docker run -it --rm --name gravitino-web-docker -v ${PWD}:/web -p 3000:3000 -w /web node:20-slim /bin/bash -c "yarn install && yarn server"
```

You can access the Gravitino WEB UI by typing <http://localhost:3000> in your browser.
You can access the Gravitino Web UI by typing <http://localhost:3000> in your browser.

0 comments on commit c102d66

Please sign in to comment.