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

refactor(React / Ember): React as the default UI #2252

Merged
merged 9 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
3 changes: 0 additions & 3 deletions .github/workflows/docker-frontend-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,3 @@ jobs:
file: ./docker/datahub-frontend/Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
push: ${{ needs.setup.outputs.publish == 'true' }}
build-args: |
SERVER_PORT=9002
ENABLE_REACT=true
3 changes: 3 additions & 0 deletions .github/workflows/docker-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ jobs:
file: ./docker/datahub-frontend/Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
push: ${{ needs.setup.outputs.publish == 'true' }}
build-args: |
SERVER_PORT=9001
ENABLE_EMBER=true
9 changes: 3 additions & 6 deletions datahub-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ However, if you only want to build `DataHub Frontend` specifically:
./gradlew :datahub-frontend:build
```

### Building React App
To build datahub-frontend to serve the React app, build with the additional "enableReact" property:
### Building Ember App
To build datahub-frontend to serve the legacy Ember app, build with the additional "enableEmber" property:

```
./gradlew :datahub-frontend:build -PenableReact=true
./gradlew :datahub-frontend:build -PenableEmber=true
```

## Dependencies
Expand Down Expand Up @@ -58,9 +58,6 @@ the application directly from command line after a successful [build](#build):
cd datahub-frontend/run && ./run-local-frontend
```

### Serving React App
If you are running the React app locally via `yarn start`, it will be forwarding graphql requests to port `9002`. In order to use `./run-local-frontend` with the React app, change the PORT value in [./run/frontend.env](./run/frontend.env) to `9002` and restart `./run-local-frontend`

## Checking out DataHub UI
After starting your application in one of the two ways mentioned above, you can connect to it by typing below
into your favorite web browser:
Expand Down
6 changes: 3 additions & 3 deletions datahub-frontend/play.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ configurations {
}

dependencies {
if (project.hasProperty('enableReact') && project.getProperty('enableReact').toBoolean()) {
assets project(path: ':datahub-web-react', configuration: 'assets')
} else {
if (project.hasProperty('enableEmber') && project.getProperty('enableEmber').toBoolean()) {
assets project(path: ':datahub-web', configuration: 'assets')
} else {
assets project(path: ':datahub-web-react', configuration: 'assets')
}

play project(":datahub-dao")
Expand Down
2 changes: 1 addition & 1 deletion datahub-frontend/run/frontend.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Server Port
PORT=9001
PORT=9002

# Secret Key
DATAHUB_SECRET="YouKnowNothing"
Expand Down
19 changes: 10 additions & 9 deletions datahub-web-react/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# DataHub React App

## About
This module contains a React version of the DataHub UI, which is currently under incubation. Notice that this
is a completely separate frontend experience from Ember and will remain so as it evolves.
This module contains a React version of the DataHub UI. This is now the production version of the DataHub client experience.
Notice that this is a completely separate frontend experience from the legacy Ember app and will remain so as it evolves.

Feel free to take a look around, deploy, and make contributions.
Feel free to take a look around, deploy, and contribute.

For details about the motivation please see [this RFC](../docs/rfc/active/2055-react-app/README.md).

## Functional Goals
The initial milestone for the app is to achieve functional parity with the existing Ember app. This means supporting
The initial milestone for the app was to achieve functional parity with the existing Ember app. This meant supporting

- Dataset Profiles, Search, Browse Experience
- User Profiles, Search
- LDAP Authentication Flow

This has since been achieved. The new set of functional goals are reflected in the latest version of the [DataHub Roadmap](../docs/roadmap.md).

## Design Goals
In building out a new client experience, we intend to build on learnings from the Ember app and incorporate feedback gathered
In building out the client experience, we intend to leverage learnings from the Ember app and incorporate feedback gathered
from organizations operating DataHub. Two themes have emerged to serve as guideposts:

1. **Configurability**: The client experience should be configurable, such that deploying organizations can tailor certain
Expand All @@ -33,7 +35,7 @@ from organizations operating DataHub. Two themes have emerged to serve as guidep

Navigate to the `docker` directory and run the following to spin up the react app:
```
./quickstart-react.sh
./quickstart.sh
```
at `http://localhost:9002`.

Expand Down Expand Up @@ -71,14 +73,13 @@ you to terminate and re-run `yarn start` to see updated styles.

### Package Organization

The organization is yet subject to change as the app incubates. As of today (2/11/2021), the `src` dir of the app is
broken down into the following modules
The `src` dir of the app is broken down into the following modules

**conf** - Stores global configuration flags that can be referenced across the app. For example, the number of
search results shown per page, or the placeholder text in the search bar box. It serves as a location where levels
for functional configurability should reside.

**components** - Contains all important components of the app. It has a few sub-modules:
**app** - Contains all important components of the app. It has a few sub-modules:

- `auth`: Components used to render the user authentication experience.
- `browse`: Shared components used to render the 'browse-by-path' experience. The experience is akin to navigating a filesystem hierarchy.
Expand Down
14 changes: 10 additions & 4 deletions datahub-web/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
DataHub Web Client
DataHub Ember Client (Legacy)
==============================================================================

>**Notice**: As of March 2021, the React application will be the default frontend experience supported by the community.
> Going forward, major feature development will occur on the React application. Eventually, support for Ember will be
> deprecated altogether (tentatively mid-2021).
>
> Please migrate to the React app, which resides under the `datahub-web-react` directory.

## About
This repository is for the portal web-client and related packages for DataHub, LinkedIn's premier data search and
This repository is for the legacy web-client and related packages for DataHub, LinkedIn's premier data search and
discovery tool. It is written as an Ember application in a mono-repository. For more information about our code
architecture choices and logic, please visit the `documentation` folder [here](documentation/MAIN.md).

Expand Down Expand Up @@ -59,8 +65,8 @@ ember g datahub-addon

### Quick Start

First, follow the instructions on the DataHub Quickstart Guide, which will run an instance of the backend for DataHub
and also serve the static docker image from `http://localhost:9001`. This is the best way to see the current latest
First, follow the instructions on the DataHub Quickstart Guide for Ember (`quickstart-ember.sh`), which will
run an instance of the backend for DataHub and also serve the static docker image from `http://localhost:9001`. This is the best way to see the current latest
frontend/UI in action as well. However, if you want to make changes and see them live without having to rebuild a
docker image, you can, from this `datahub-web` folder run the following:

Expand Down
34 changes: 17 additions & 17 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can easily download and run all these images and their dependencies with our
DataHub Docker Images:

* [linkedin/datahub-gms](https://cloud.docker.com/repository/docker/linkedin/datahub-gms/)
* [linkedin/datahub-frontend](https://cloud.docker.com/repository/docker/linkedin/datahub-frontend/)
* [linkedin/datahub-frontend-react](https://cloud.docker.com/repository/docker/linkedin/datahub-frontend-react/)
* [linkedin/datahub-mae-consumer](https://cloud.docker.com/repository/docker/linkedin/datahub-mae-consumer/)
* [linkedin/datahub-mce-consumer](https://cloud.docker.com/repository/docker/linkedin/datahub-mce-consumer/)

Expand Down Expand Up @@ -61,31 +61,31 @@ COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -p datahub build
This is because we're relying on builtkit for multistage builds. It does not hurt also set `DATAHUB_VERSION` to
something unique.

## React
To serve the incubating React UI, follow the instructions below.
## Ember
To serve the legacy Ember UI, follow the instructions below.

> **Before continuing**: If you've already run a deploy script, don't forget to clear containers using `docker container prune`

### Serving React Only
### Serving Ember Only

#### All Containers

Use the `quickstart-react.sh` script to launch all containers in DataHub, including a frontend server that returns a React UI
Use the `quickstart-ember.sh` script to launch all containers in DataHub, including a frontend server that serves the Ember UI
```
./quickstart-react.sh
./quickstart-ember.sh
```

#### The Bare Minimum
Run the following command to launch only the React server and its required dependencies
Run the following command to launch only the Ember server and its required dependencies

```
docker-compose -f docker-compose.react.yml -f docker-compose.yml -f docker-compose.override.yml up datahub-frontend-react
docker-compose -f docker-compose.ember.yml -f docker-compose.yml -f docker-compose.override.yml up datahub-frontend-ember
```

Once complete, navigate to `localhost:9002/` in your browser to see the React app.
Once complete, navigate to `localhost:9001` in your browser to see the legacy Ember app.

### Serving React + Ember
If you'd like to serve the React and Ember UIs side-by-side, you can deploy the `datahub-frontend-react` container manually.
If you'd like to serve the React and Ember UIs side-by-side, you can deploy the `datahub-frontend-ember` service manually.

#### All Containers

Expand All @@ -94,22 +94,22 @@ To deploy all DataHub containers, run the quickstart script:
./quickstart.sh
```

Next, deploy the container that serves the React UI:
Next, deploy the container that serves the Ember UI:

```
docker-compose -f docker-compose.react.yml -f docker-compose.yml -f docker-compose.override.yml up --no-deps datahub-frontend-react
docker-compose -f docker-compose.ember.yml -f docker-compose.yml -f docker-compose.override.yml up --no-deps datahub-frontend-ember
```

#### The Bare Minimum
First, start the Ember frontend server & its required dependencies:
First, start the React frontend server & its required dependencies:

```
docker-compose up datahub-frontend
docker-compose up datahub-frontend-react
```

Then, start the React frontend server & its required dependencies:
Then, start the Ember frontend server & its required dependencies:
```
docker-compose -f docker-compose.react.yml -f docker-compose.yml -f docker-compose.override.yml up datahub-frontend-react
docker-compose -f docker-compose.ember.yml -f docker-compose.yml -f docker-compose.override.yml up datahub-frontend-ember
```

Navigate to `localhost:9001/` to view the Ember app & `localhost:9002/` to view the React app.
Navigate to `localhost:9002/` to view the React app & `localhost:9001/` to view the legacy Ember app.
6 changes: 3 additions & 3 deletions docker/datahub-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM openjdk:8 as builder

ARG ENABLE_REACT="false"
ARG ENABLE_EMBER="false"

RUN apt-get update && apt-get install -y wget \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
Expand All @@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y wget \
ENV CI=true

COPY . datahub-src
RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableReact=${ENABLE_REACT} \
RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} \
&& cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip \
&& cd .. && rm -rf datahub-src && unzip datahub-frontend.zip

Expand All @@ -21,7 +21,7 @@ COPY --from=builder /datahub-frontend /datahub-frontend/
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend
USER datahub

ARG SERVER_PORT=9001
ARG SERVER_PORT=9002
RUN echo $SERVER_PORT

EXPOSE $SERVER_PORT
Expand Down
6 changes: 6 additions & 0 deletions docker/datahub-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ responsibility of this service for the DataHub.

After starting your Docker container, you can connect to it by typing below into your favorite web browser:

If using React app:
```
http://localhost:9002
```

If using legacy Ember app:
```
http://localhost:9001
```
Expand Down
19 changes: 19 additions & 0 deletions docker/docker-compose.ember.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Introduces datahub-frontend-ember service to serve the Ember UI on localhost:9001/
---
version: '3.8'
services:
datahub-frontend-ember:
build:
context: ../
dockerfile: docker/datahub-frontend/Dockerfile
args:
SERVER_PORT: 9001
ENABLE_EMBER: "true"
image: linkedin/datahub-frontend:${DATAHUB_VERSION:-latest}
env_file: datahub-frontend/env/docker.env
hostname: datahub-frontend
container_name: datahub-frontend
ports:
- "9001:9001"
depends_on:
- datahub-gms
19 changes: 0 additions & 19 deletions docker/docker-compose.react.yml

This file was deleted.

10 changes: 5 additions & 5 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ services:
- mysql
- neo4j

datahub-frontend:
datahub-frontend-react:
build:
context: ../
dockerfile: docker/datahub-frontend/Dockerfile
image: linkedin/datahub-frontend:${DATAHUB_VERSION:-latest}
image: linkedin/datahub-frontend-react:${DATAHUB_VERSION:-latest}
env_file: datahub-frontend/env/docker.env
hostname: datahub-frontend
container_name: datahub-frontend
hostname: datahub-frontend-react
container_name: datahub-frontend-react
ports:
- "9001:9001"
- "9002:9002"
depends_on:
- datahub-gms

Expand Down
8 changes: 4 additions & 4 deletions docker/quickstart-react.sh → docker/quickstart-ember.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# Quickstarts a React-serving variant of DataHub by pulling all images from dockerhub and then running the containers locally.
# Quickstarts a Ember-serving variant of DataHub by pulling all images from dockerhub and then running the containers locally.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR && docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.react.yml pull && docker-compose -p datahub \
cd $DIR && docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.ember.yml pull && docker-compose -p datahub \
-f docker-compose.yml \
-f docker-compose.override.yml \
-f docker-compose.react.yml \
-f docker-compose.ember.yml \
up \
--scale datahub-frontend=0
--scale datahub-frontend-react=0
2 changes: 1 addition & 1 deletion docker/quickstart.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Quickstarts DataHub by pullinng all images from dockerhub and then running the containers locally. No images are
# Quickstarts DataHub by pulling all images from dockerhub and then running the containers locally. No images are
# built locally. Note: by default this pulls the latest version; you can change this to a specific version by setting
# the DATAHUB_VERSION environment variable.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
6 changes: 3 additions & 3 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can list all Docker containers in your local by running `docker container ls
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
979830a342ce linkedin/datahub-mce-consumer:latest "bash -c 'while ping…" 10 hours ago Up 10 hours datahub-mce-consumer
3abfc72e205d linkedin/datahub-frontend:latest "datahub-frontend/bi…" 10 hours ago Up 10 hours 0.0.0.0:9001->9001/tcp datahub-frontend
3abfc72e205d linkedin/datahub-frontend-react:latest "datahub-frontend…" 10 hours ago Up 10 hours 0.0.0.0:9002->9002/tcp datahub-frontend
50b2308a8efd linkedin/datahub-mae-consumer:latest "bash -c 'while ping…" 10 hours ago Up 10 hours datahub-mae-consumer
4d6b03d77113 linkedin/datahub-gms:latest "bash -c 'dockerize …" 10 hours ago Up 10 hours 0.0.0.0:8080->8080/tcp datahub-gms
c267c287a235 landoop/schema-registry-ui:latest "/run.sh" 10 hours ago Up 10 hours 0.0.0.0:8000->8000/tcp schema-registry-ui
Expand All @@ -24,9 +24,9 @@ Also you can check individual Docker container logs by running `docker logs <<co
2020-02-06 09:20:54.870:INFO:oejs.Server:main: Started @18807ms
```

For `datahub-frontend`, you should see a log similar to this at the end of the initialization:
For `datahub-frontend-react`, you should see a log similar to this at the end of the initialization:
```
09:20:22 [main] INFO play.core.server.AkkaHttpServer - Listening for HTTP on /0.0.0.0:9001
09:20:22 [main] INFO play.core.server.AkkaHttpServer - Listening for HTTP on /0.0.0.0:9002
```

## My elasticsearch or broker container exited with error or was stuck forever
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DataHub can be right for you if you want an open source unbundled solution (fron
Currently LinkedIn engineers. However, we’re receiving more and more PRs from individuals working at various companies.

## How big is the community?
We had couple of meetings/discussions with external parties who are interested in DataHub, for example:
External parties who deploy / are actively evaluating DataHub:
- [City of New York, DoITT](https://www1.nyc.gov/site/doitt/index.page)
- [Experian](https://www.experian.com/)
- [Geotab](https://www.geotab.com/)
Expand Down
Loading