Giter VIP home page Giter VIP logo

troposphere's Introduction

THIS REPOSITORY IS READONLY AND NO LONGER ACTIVE

Troposphere

Installation

Troposphere's backend

Install the required python packages

pip install -r requirements.txt

A separate environment is provided for developers

pip install -r dev_requirements.txt

The *requirements.txt files are generated using pip-tools. See REQUIREMENTS.md for instructions on using pip-tools and upgrading packages in Troposphere.

Development

Quick feedback

The webpack-dev-server will serve new bundles to a browser when files change.

It has the following features:

  • Changes result in a browser refresh (you know they are propagated)
  • The bundle is served from memory not disk
  • Small changes result in small compiles

Currently troposphere uses nginx to serve its assets. This makes it trivial to serve these assets from the dev server.

Update your nginx definition (at /etc/nginx/locations/tropo.conf)

location /assets {
    # This just needs to point to the dev server which runs on 8080
    proxy_pass https://server.example.com:8080;
}

Finally start the dev server:

npm run serve -- --host server.example.com --port 8080 --https  --cert /path/to/cert --key /path/to/key

If you would like to enable CSS hot reloading, prefix the npm command like so:

CSS_IN_JS=true npm run serve ...

By default we extract CSS from the larger bundle into a separate asset that is parsed/loaded before any js, this ensures that the content of our html will be styled the first time it is shown. However, CSS hot reloading only works if the CSS is shipped in the JS. The caveat is that html content is shipped without initial styling.

Note: CSS_IN_JS is completely ignored in a production environment.

Linting

See LINT.md

Coding Style

  • Use an EditorConfig plugin to leverage the project's .editorconfig

Git Hooks

The hooks below give helpful hints about common tasks like migrating, or installing dependencies.

Link the following hook to get these hints after pulling in code. From the root of the project:

ln -fs ../../extras/hooks/post-merge.hook .git/hooks/post-merge

troposphere's People

Contributors

amercer1 avatar amit4111989 avatar cdosborn avatar cjlarose avatar edwins avatar jchansen avatar jmatt avatar julianpistorius avatar lenards avatar mgwall17 avatar mlent avatar npurcella avatar prosif avatar robax avatar simpsonw avatar steve-gregory avatar tharon-c avatar xuhang57 avatar zhxu73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

troposphere's Issues

Feature: Ask for uploading SSH key before launching the instance

@lenards Hey Andy, I have something like this: https://github.com/CCI-MOC/GUI-Frontend/pull/15/files

that adding another view before we actual launch the instance. Do you think it is also a feature that atmosphere would like to have in the troposphere? If does, I can send out this as a PR and for review.

Basic logic is that, after selecting an image and a user click launch, it checks whether the user has an atmosphere project first, and then, check whether the SSH pubkey has uploaded, and finally to the instance launch wizard.

Change theme images

I did what this https://github.com/cyverse/troposphere/tree/master/troposphere/static/theme tells me to do:

  1. Having a new folder called themeImages within /theme/
  2. Changed mini_logo.png (double-checked that the image has changed)
  3. run ./configure

And I have the expected output (all green, successfully configured)

But I cannot any chance the mini_logo and I did a hard refresh/restart web server.

Do I need to run webpack? (I don't think so but I don't know why it is not working)

Thanks!
Lucas

Remove `isVisible` from button component

In a parent-child (or container-containee) relationship, you don't want the containee to decide when to render itself. If you don't want a button to be visible, then the parent doesn't include it. The inversion of control allows for the situation where children ignores the parent. The ButtonBar also has an isVisible flag, which it more or less ignores.

Login SPA bugs?

  1. By default, "DISABLE_PUBLIC_AUTH=False" However, when I click on the login, it pops up the loginScreen

  2. The modal seems to have some dimensions problem?

screen shot 2016-12-09 at 10 26 22

Use caching for the `babel` loader in webpack.config.js

Right now, it does not appear that we are making use of caching with the babel loader in webpack.config.js.

It is possible to define a cacheDirectory, which will be the include path if using loaders: ['babel?cacheDirectory'] syntax.

An example:

      {
        test: /\.jsx?$/,
        // Enable caching for improved performance during development
        // It uses default OS directory by default. If you need something
        // more custom, pass a path to it. I.e., babel?cacheDirectory=<path>
        loaders: ['babel?cacheDirectory'],
        // Parse only app files! Without this it will go through entire project.
        // In addition to being slow, that will most likely result in an error.
        include: PATHS.app
     },

source: SurviveJS

Friction creating projects

If you create a project you must pass a project description. If you pass a description which is whitespace " ". An exception is thrown. We shouldn't require more than a name.

LoginScreen.jsx?5952:28 Uncaught TypeError: Cannot read property 'attemptLogin' of undefined(…)

So it complains about the LoginActions is not defined. I think it probably because in the bootstrapper.jsx under the public_site directory: it needs to have:

import actions
actions.LoginActions = require("actions/LoginActions");

I tried to add this two lines, but it next starts complaining about

SplashScreen.jsx?50a0:22 Uncaught TypeError: Cannot read property 'getAll' of undefined(…)

which is from

SplashScreen_getInitialState	@	SplashScreen.jsx?50a0:22 

And about the instance stores. So I don't know what to do next and I make this as an issue but a PR.

Thanks!

Add `include` properties to all `loaders` in webpack.config.js

From SurviveJS:

If include isn't set, Webpack will traverse all files within the base directory. This can hurt performance! It is a good idea to set up include always. There's also exclude option that may come in handy. Prefer include, however.

Add include to loaders for the source-appropriate locations to improve webpack bundling execution.

Support Markdown?

Just an idea, maybe support markdown so that syntax on the troposphere would look prettier?

For example:

please edit /root/.ssh/authorized_keys inside the instance...

to become

please edit /root/.ssh/authorized_keys inside the instance...

Just an idea :)

New Feature: 'All instances' view on dashboard

Problem: I would like to be able to see all my running instances in one view, across all projects.

Maybe in a sortable grid? Sort by size, name, machine (image) name, provider, allocation source, status, activity, date started, date ended, ip address... holy shit... That list grew long pretty quickly. That would be cool. Scientists love tables (Excel). Ooh. You could filter by columns as well. And be able to copy & paste it as CSV... Stop me!

Background:

  • I was helping Tyson - who has many projects.
  • Most of the instances were suspended.
  • I was trying to find a running instance - any running instance.
  • I was forced to click through all the projects to find one.
  • It seems like a tease to show me the number of active and suspended instances on the dashboard, but no way to get to them.
  • In the end I found a running instance at the bottom of the truncated log of 'Instance History' at the bottom of the page.

Use only a single select menu

There should not be SelectMenu2 and SelectMenu, this commit (89efcfc) resurrected the original select menu during a hotfix.

The old select menu allowed you to pass a selector function, which would be used to identify the selected element. The new select menu required that you passed it the selected element in addition to the list elements, with the caveat that the selected must be in the list (or it doesn't even make sense to be selected).

The new approach has issues, because the selected element doesn't exist as the same object in the passed list.

Cannot logout from Login SPA

In #506, we introduced a login form hosted within Troposphere instead of "deferring" to a authentication service provider (like a compatible OAuth service: CAS, etc).

It has been reported that you cannot logout.

Logout should be a removal of the auth-cookie and a (potential) redirection.

Quick feedback error

I followed this https://github.com/cyverse/troposphere#quick-feedback
and I still cannot start the dev server:

(troposphere_giji-v29-changes) root@giji-test:/opt/dev/troposphere# npm run serve -- --host 128.31.25.251 --port 8080 --https  --cert /etc/ssl/certs/128.31.25.251.fullchain.crt --key /etc/ssl/private/128.31.25.251.key

> [email protected] serve /opt/dev/troposphere
> webpack-dev-server --hot --env development --content-base troposphere/assets "--host" "128.31.25.251" "--port" "8080" "--https" "--cert" "/etc/ssl/certs/128.31.25.251.fullchain.crt" "--key" "/etc/ssl/private/128.31.25.251.key"

  build [==                  ] 10%events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRNOTAVAIL 128.31.25.251:8080
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1334:19)
    at listenInCluster (net.js:1392:12)
    at doListen (net.js:1501:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `webpack-dev-server --hot --env development --content-base troposphere/assets "--host" "128.31.25.251" "--port" "8080" "--https" "--cert" "/etc/ssl/certs/128.31.25.251.fullchain.crt" "--key" "/etc/ssl/private/128.31.25.251.key"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-02-22T18_09_27_659Z-debug.log

I checked the log but there is no meaningful msg to me there. Any help/idea would be much appreciated.

My /etc/nginx/locations/tropo.conf:

(troposphere_giji-v29-changes) root@giji-test:/opt/dev/troposphere# cat /etc/nginx/locations/tropo.conf
# NOTE: This file was automatically generated by troposphere/configure
# to make changes to this file, update your variables.ini
# and re-run troposphere/configure

location /assets {
    # Production Mode: By default,
    # Troposphere serves static files by saving
    # necessary staticfiles and webpack output to:
    #     `/opt/dev/troposphere/troposphere/assets`
    # alias /opt/dev/troposphere/troposphere/assets;

    # Developer mode: For easy development on the GUI
    # Webpack-dev-server can also be used to host assets
    # and refresh the clients page as content is updated
    # To enable webpack-dev-server:
    # - Ensure that the output of webpack-dev-server includes the line:
    #       `Project is running at https://128.31.25.251:8080/`
    # - uncomment the 'proxy_pass' line below.
    # - comment out the 'alias' line above

    proxy_pass https://128.31.25.251:8080;

}

location ~^/(application|maintenance|login|globus_login|oauth2.0/callbackAuthorize|logout|forbidden|version|cf2|tropo-admin|tropo-api|web_shell|web_desktop|allocations|guacamole) {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    uwsgi_pass unix:///tmp/troposphere.sock;
}

location ~^/cas/(oauth2.0|service) {
    uwsgi_pass unix:///tmp/troposphere.sock;
}

Explore using Node.js `querystring` in webpack loader configuration

The current loader definitions in webpack.config.js use a perfectly valid but not overall easy to read style with query string arguments.

   { test: /\.woff$/ , loader: "url?limit=10000&mimetype=application/font-woff" },
   { test: /\.woff2$/, loader: "url?limit=10000&mimetype=application/font-woff2" },

source: webpack.config.js

An example of another approach might be to define the url loader as:

  { 
    test: /\.woff$/ , 
    loader: "url",
    query: {
      limit: 10000,
      mimetype: "application/font-woff"
    }
  }

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.