Coder Social home page Coder Social logo

ckiosidis / flyteconsole Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flyteorg/flyteconsole

0.0 0.0 0.0 8.18 MB

The user interface for Flyte

Home Page: https://github.com/lyft/flyte

License: Apache License 2.0

JavaScript 1.48% TypeScript 97.82% HTML 0.03% Dockerfile 0.06% Makefile 0.11% Shell 0.50%

flyteconsole's Introduction

Flyte Console

Current Release Build Status License CodeCoverage

This is the web UI for the Flyte platform.

Running flyteconsole

Install Dependencies

Running flyteconsole locally requires NodeJS and yarn. Once these are installed, all of the dependencies can be installed by running yarn in the project directory.

Quickstart

  1. Follow Start a Local flyte backend, like
docker run --rm --privileged -p 30081:30081 -p 30082:30082 -p 30084:30084 cr.flyte.org/flyteorg/flyte-sandbox
  1. Now Export these 2 env variables

    export ADMIN_API_URL=http://localhost:30081
    export DISABLE_AUTH=1

    Note

    You can persist these environment variables in a .env file at the root of the repository. This will persist the settings across multiple terminal sessions

  2. Start the server (uses localhost:3000)

    yarn start
  3. Explore your local copy: http://localhost:3000

Environment variables

Before we can run the server, we need to set up an environment variable or two. Environment variables can be set either in the current shell or persisted in .env file stored under the root of the repository.

ADMIN_API_URL (default: window.location.origin)

The Flyte console displays information fetched from the Flyte Admin API. This environment variable specifies the host prefix used in constructing API requests.

Note: this is only the host portion of the API endpoint, consisting of the protocol, domain, and port (if not using the standard 80/443).

This value will be combined with a suffix (such as /api/v1) to construct the final URL used in an API request.

Default Behavior

In most cases, flyteconsole will be hosted in the same cluster as the Admin API, meaning that the domain used to access the console is the same value used to access the API. For this reason, if no value is set for ADMIN_API_URL, the default behavior is to use the value of window.location.origin.

BASE_URL (default: undefined)

This allows running the console at a prefix on the target host. This is necessary when hosting the API and console on the same domain (with prefixes of /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.

Run the server

To start the local development server, run yarn start. This will spin up a Webpack development server, compile all of the code into bundles, and start the NodeJS server on the default port (3000). All requests to the NodeJS server will be stalled until the bundles have finished. The application will be accessible at http://localhost:3000 (if using the default port).

Development

Storybook

This project has support for Storybook. Component stories live next to the components they test, in a __stories__ directory, with the filename pattern {Component}.stories.tsx.

You can run storybook with yarn run storybook, and view the stories at http://localhost:9001.

Protobuf and the Network tab

Communication with the Flyte Admin API is done using Protobuf as the request/response format. Protobuf is a binary format, which means looking at responses in the Network tab won't be very helpful. To make debugging easier, each network request is logged to the console with it's URL followed by the decoded Protobuf payload. You must have debug output enabled (on by default in development) to see these messages.

Debug Output

This application makes use of the debug libary to provide namespaced debug output in the browser console. In development, all debug output is enabled. For other environments, the debug output must be enabled manually. You can do this by setting a flag in localStorage using the console: localStorage.debug = 'flyte:*'. Each module in the application sets its own namespace. So if you'd like to only view output for a single module, you can specify that one specifically (ex. localStorage.debug = 'flyte:adminEntity' to only see decoded Flyte Admin API requests).

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)

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

    export ADMIN_API_URL=https://different.admin.service.com
    export ADMIN_API_USE_SSL="https"

    Note

    Hint Add these to your local profile (eg, ./profile) to prevent having to do this step each time

  2. Generate SSL certificate

    Run the following command from your flyteconsole directory

    make generate_ssl
  3. Add new record to hosts file

    sudo vim /etc/hosts

    Add the following record

    127.0.0.1 localhost.different.admin.service.com
  4. Install Chrome plugin: Allow CORS: Access-Control-Allow-Origin

    Note

    Activate plugin (toggle to "on")

  5. Start flyteconsole

    yarn start

    Your new localhost is localhost.different.admin.service.com

Note

Hint

Ensure you don't have ADMIN_API_URL or DISABLE_AUTH set (eg, in your /.profile.)

flyteconsole's People

Contributors

schottra avatar service-github-lyft-semantic-release avatar flyte-bot avatar dependabot[bot] avatar csirius avatar pianist038801 avatar enghabu avatar jsonporter avatar yindia avatar honnix avatar kumare3 avatar kanterov avatar samhita-alla avatar aviaviavi avatar professional0321 avatar wild-endeavor avatar snyk-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.