Giter VIP home page Giter VIP logo

clay's People

Contributors

ascandella avatar atombrella avatar bluestann avatar charlax avatar datoug avatar dnathe4th avatar eklitzke avatar jeremygrosser avatar jordanb avatar kmnovak avatar roguelazer avatar sweenzor avatar westover avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clay's Issues

Service should fail to start if config cannot be loaded

I just renamed the config on one of our projects from .json to .yaml. I expected supervisior to fail to start the service once I updated the supervisor ini, but the service was running. I think we should change it so that if a config fails to load, clay throws an exception.

Add localenv fabric utils

Hey @synack,

How would you feel with having this function in a fabric_utils module in clay?

https://github.com/uber/cleopatra/blob/master/cleopatra/lib/fabric_utils.py#L13

(something more abstract obviously - just look at the general idea)

ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
DEFAULT_ENVIRONMENT = "local"
DEFAULT_CONFIG_FILENAME = "config/{environment}.yaml"
ENV_VAR_PREFIX = "export CLAY_CONFIG={root_path}/{config_filename}"


def localenv(*args, **kwargs):
    """Execute cmd in local environment."""

    # Remove empty keys
    kwargs = {k: v for k, v in kwargs.items() if v}

    template_vars = {
        "root_path": ROOT_PATH,
        "environment": kwargs.pop("environment", DEFAULT_ENVIRONMENT),
        "config_filename": kwargs.pop("config_filename", DEFAULT_CONFIG_FILENAME)
    }

    # By default, the config filename includes the role name,
    # that's why we need to format it.
    template_vars["config_filename"] = kwargs.pop(
        "config_filename",
        DEFAULT_CONFIG_FILENAME).format(**template_vars)
    env_prefix = ENV_VAR_PREFIX.format(**template_vars)

    with prefix(env_prefix):
        return local(*args, **kwargs)

Moving Clay app to production - ImportError: No module named wsgi

Hi,

First, I want to say thanks for open sourcing Clay and @synack for helping me out earlier. Thought I'd try submitting a question here.

I'm trying to move my local Clay app to production, specifically to Heroku.

When I run this,
gunicorn clay.wsgi:application

I get this error:
2014-03-17 19:11:54 [30703] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
ImportError: No module named wsgi
Traceback (most recent call last):
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/lamr/uber-clay/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
ImportError: No module named wsgi

I'm guessing it's because I dont have a clay.wsgi file.

I found this for flask
http://flask.pocoo.org/docs/deploying/mod_wsgi/#creating-a-wsgi-file

but creating a clay.wsgi with this inside
"from clay import app as application"
didn't change the error code.

Does anyone have experience moving Clay to production?
Thanks for your help!

data driven clay test?

How do I do data driven test in clay?

I tried using pytest's parameterize but doesn't seem to work with clay.

secret_key being weird

So in the infraportal configuration, you have SECRET_KEY set inside flask.config, but I think server.py will overwrite that with None.

https://github.com/uber/infraportal/blob/4baf729702fb4c05be487cfc5e25874b5c740ff0/infraportal-prod.conf#L8
https://github.com/uber/clay/blob/master/clay/server.py#L35

I think the way infraportal does it is best as it mirrors "standard" flask apps better. I think you could just delete line 35 or at least change it to not do anything if the secret key is already set.

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.