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

feat: cleanup #389

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
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
19 changes: 0 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,6 @@ asdf install
yarn install
```

## CORS Proxying: Recommended Setup

In the common hosting arrangement, all API requests will be to the same origin
serving the client application, making CORS unnecessary. However, if you would like
to setup your local dev enviornment to target a FlyteAdmin service running on a different
domain you will need to configure your enviornment to support CORS. One example would be
hosting the Admin API on a different domain than the console. Another example is
when fetching execution data from external storage such as S3.

The fastest (recommended) way to setup a CORS solution is to do so within the browser.
If you would like to handle this at the Node level you will need to disable authentication
(see below).

_NOTE:_ Do not configure for both browser and Node solutions.

These instructions require using Google Chrome. You will also need to identify the
URL of your target FlyteAdmin API instance. These instructions will use
`https://different.admin.service.com` as an example.

1. Set `ADMIN_API_URL` and `ADMIN_API_USE_SSL`

```
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN : \
# build
&& make build_prod \
# place the runtime application in /app
&& mv dist corsProxy.js index.js env.js plugins.js /app
&& mv dist index.js env.js plugins.js /app

FROM gcr.io/distroless/nodejs
LABEL org.opencontainers.image.source https://github.com/lyft/flyteconsole
Expand Down
24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ For help with installing dependencies look into
`/api/v1` and `/console` for example). For local development, this is
usually not needed, so the default behavior is to run without a prefix.

* `CORS_PROXY_PREFIX` (default: `/cors_proxy`)

Sets the local endpoint for [CORS request proxying](CONTRIBUTING.md#cors-proxying-recommended-setup).

### Running from docker image as localhost

To run flyteconsole directly from your docker image as localhost you must set a
Expand Down Expand Up @@ -140,26 +136,6 @@ For continious development we are using:

More info on each section could be found at [CONTRIBUTING.md](CONTRIBUTING.md)

### CORS Proxying: Recommended setup

In the common hosting arrangement, all API requests will be to the same origin
serving the client application, making CORS unnecessary. However, if you would like
to setup your local dev enviornment to target a FlyteAdmin service running on a different
domain you will need to configure your enviornment support CORS. One example would be
hosting the Admin API on a different domain than the console. Another example is
when fetching execution data from external storage such as S3.

The fastest (recommended) way to setup a CORS solution is to do so within the browser.
If you would like to handle this at the Node level you will need to disable authentication
(see below)

> Do not configure for both browser and Node solutions.

These instructions require using Google Chrome. You will also need to identify the
URL of your target FlyteAdmin API instance. These instructions will use
`https://different.admin.service.com` as an example.


* Set `ADMIN_API_URL` and `ADMIN_API_USE_SSL`

```bash
Expand Down
49 changes: 0 additions & 49 deletions corsProxy.js

This file was deleted.

2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ const morgan = require('morgan');
const express = require('express');
const env = require('./env');
const { applyMiddleware } = require('./plugins');
const corsProxy = require('./corsProxy.js');

const app = express();

// Enable logging for HTTP access
app.use(morgan('combined'));
app.use(express.json());
app.get(`${env.BASE_URL}/healthz`, (_req, res) => res.status(200).send());
app.use(corsProxy(`${env.BASE_URL}${env.CORS_PROXY_PREFIX}`));

if (typeof applyMiddleware === 'function') {
console.log('Found middleware plugins, applying...');
Expand Down