lambda + SNS enhancements (#1048)
* updates - support lambda messages from SNS - run lambda in docker container * decode output * populate timeout * simplify * whoops * skeletons of cloudwatchlogs * impl filter log streams * fix logging * PEP fixes * PEP fixes * fix reset * fix reset * add new endpoint * fix region name * add docker * try to fix tests * try to fix travis issue with boto * fix escaping in urls * fix environment variables * fix PEP * more pep * switch back to precise * another fix attempt * fix typo * fix lambda invoke * fix more unittests * work on getting this to work in new scheme * fix py2 * fix error * fix tests when running in server mode * more lambda fixes * try running with latest docker adapted from aiodocker * switch to docker python client * pep fixes * switch to docker volume * fix unittest * fix invoke from sns * fix zip2tar * add hack impl for get_function with zip * try fix * fix for py < 3.6 * add volume refcount * try to fix travis * docker test * fix yaml * try fix * update endpoints * fix * another attempt * try again * fix recursive import * refactor fix * revert changes with better fix * more reverts * wait for service to come up * add back detached mode * sleep and add another exception type * put this back for logging * put back with note * whoops :) * docker in docker! * fix invalid url * hopefully last fix! * fix lambda regions * fix protocol * travis!!!! * just run lambda test for now * use one print * fix escaping * another attempt * yet another * re-enable all tests * fixes * fix for py2 * revert change * fix for py2.7 * fix output ordering * remove this given there's a new unittest that covers it * changes based on review - add skeleton logs test file - switch to docker image that matches test env - fix mock_logs import * add readme entry
This commit is contained in:
parent
ca8ce8705b
commit
9008b85299
21 changed files with 836 additions and 167 deletions
31
wait_for.py
Executable file
31
wait_for.py
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
import time
|
||||
|
||||
try:
|
||||
# py2
|
||||
import urllib2 as urllib
|
||||
from urllib2 import URLError
|
||||
import socket
|
||||
import httplib
|
||||
|
||||
EXCEPTIONS = (URLError, socket.error, httplib.BadStatusLine)
|
||||
except ImportError:
|
||||
# py3
|
||||
import urllib.request as urllib
|
||||
from urllib.error import URLError
|
||||
|
||||
EXCEPTIONS = (URLError, ConnectionResetError)
|
||||
|
||||
|
||||
start_ts = time.time()
|
||||
print("Waiting for service to come up")
|
||||
while True:
|
||||
try:
|
||||
urllib.urlopen('http://localhost:5000/', timeout=1)
|
||||
break
|
||||
except EXCEPTIONS:
|
||||
elapsed_s = time.time() - start_ts
|
||||
if elapsed_s > 30:
|
||||
raise
|
||||
|
||||
print('.')
|
||||
time.sleep(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue