Skip to content

Commit

Permalink
Updated the instructions on how to configure UHS
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoric committed Jan 3, 2025
1 parent 23116bf commit 53a569c
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Unicorn History Server Components provides a remote components that are consumed by the [YuniKorn Web](https://github.com/G-Research/yunikorn-web/)

## Development environment setup

### Dependencies

- [Node.js](https://nodejs.org/en/)
Expand All @@ -14,7 +15,26 @@ For managing node packages you can use `npm`, `yarn` or `pnpm`. Run `npm install

### Development Server

Run `npm start` for a dev server. Remote components will be served from this path `http://localhost:3100/remoteEntry.js`. The application will automatically reload if you change any of the source files.
#### Setting up the environment

To establish a connection between the web UI and UHS, you need to configure the `src/assets/config/envconfig.json` file with the following values:

```json
{
"localUhsComponentsWebAddress": "http://localhost:3100",
"externalLogsURL": "https://logs.example.com?token=abc123&applicationId=",
"yunikornApiURL": "http://localhost:30001",
"uhsApiURL": "http://localhost:8989"
}
```

#### Running the development server

Follow these steps to run the development server:

1. Follow the instructions in the UHS to run the server.
2. Run `pnpm start` for a dev server. Remote components will be served from this path `http://localhost:3100/remoteEntry.js`. The application will automatically reload if you change any of the source files.
3. Follow the instructions in the [YuniKorn Web](https://github.com/G-Research/yunikorn-web/) repository to set up the development environment. This is required to run the web UI.

### JSON Server

Expand All @@ -23,13 +43,14 @@ To run a mock server for local development, follow these steps:
**Start the JSON Server**:

- **Using Makefile**: you can start the server by running:

```sh
make mock-server
```

- **Using npm**: If you are in the `./web` directory, you can run the JSON Server directly with npm by using:
- **Using pnpm**: If you are in the `./web` directory, you can run the JSON Server directly with pnpm by using:
```sh
npm run start:json-server
pnpm run start:json-server
```

This will start the JSON Server and serve mock data. You can access it at `http://localhost:3000`.
Expand All @@ -42,12 +63,14 @@ Some endpoints that can be tested with ID's are:

### Build

Run `make web-build` from the project root or `npm run build`. Build output is set to `/assets` folder in project root as it will be served from the UHS server.
Run `make web-build` from the project root or `pnpm run build`. Build output is set to `/assets` folder in project root as it will be served from the UHS server.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## Code scaffolding

Run `ng generate component component-name` to generate a new component.

You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

0 comments on commit 53a569c

Please sign in to comment.