debrouwere / askmanta Goto Github PK
View Code? Open in Web Editor NEWA job runner for Joyent Manta that will package up your dependencies etc. so you can worry about the stuff that matters.
License: MIT License
A job runner for Joyent Manta that will package up your dependencies etc. so you can worry about the stuff that matters.
License: MIT License
If I install askmanta
without first configuring environmental variables, it gives me this error:
Running setup.py (path:/var/folders/4m/zzbwyss11r77z85h92r63lcr0000gn/T/pip-VuyTdS-build/setup.py) egg_info for package from git+https://github.com/stdbrouw/askmanta
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/var/folders/4m/zzbwyss11r77z85h92r63lcr0000gn/T/pip-VuyTdS-build/setup.py", line 3, in <module>
from askmanta import VERSION
File "askmanta/__init__.py", line 5, in <module>
import job, manifest
File "askmanta/job.py", line 5, in <module>
from askmanta.environment import client
File "askmanta/environment.py", line 9, in <module>
if 'localhost' in os.environ['MANTA_URL']:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'MANTA_URL'
This should be somehow covered on initialization of jobs etc or more explicitly stated.
i wrote a connect module but wasn't sure how to integrate it, hence no PR ;).
import os
import logging
import manta
logging.basicConfig()
MANTA_URL = os.getenv('MANTA_URL')
MANTA_USER = os.getenv('MANTA_URL')
MANTA_KEY_ID = os.getenv('MANTA_KEY_ID')
class MantaConnectionError(Exception):
pass
def _check_env():
"""
Make sure environmental variables are present.
"""
if not MANTA_URL:
raise MantaConnectionError(
'You must set MANTA_URL as an environmental variable.'
)
if not MANTA_USER:
raise MantaConnectionError(
'You must set MANTA_USER as an environmental variable.'
)
if 'localhost' not in MANTA_URL:
if not MANTA_KEY_ID:
raise MantaConnectionError(
'For a non-local client, you must set'
'MANTA_KEY_ID as an environmental variable.'
)
def connect():
"""
connect to manta
"""
_check_env()
if 'localhost' in MANTA_URL:
client = manta.MantaClient(MANTA_URL, MANTA_USER, internal=True)
else:
signer = manta.SSHAgentSigner(MANTA_KEY_ID)
client = manta.MantaClient(MANTA_URL, MANTA_USER, MANTA_KEY_ID)
return client
# HACK for now, should figure out how
# to announce errors on init of various classes.
client = connect()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.