diff --git a/freqtrade/aws/strategy.py b/freqtrade/aws/strategy.py index 1f7b470dd..f08beb3c1 100644 --- a/freqtrade/aws/strategy.py +++ b/freqtrade/aws/strategy.py @@ -1,12 +1,13 @@ import os import ctypes -for d, dirs, files in os.walk('lib'): - for f in files: - if f.endswith('.a'): - continue - ctypes.cdll.LoadLibrary(os.path.join(d, f)) - +#for d, dirs, files in os.walk('lib'): +# for f in files: +# if f.endswith('.a') or f.endswith('.la'): +# continue +# print("loading: {}".format(f)) +# ctypes.cdll.LoadLibrary(os.path.join(d, f)) +# @@ -17,6 +18,11 @@ from jsonschema import validate from freqtrade.aws.schemas import __SUBMIT_STRATEGY_SCHEMA__ from base64 import urlsafe_b64decode +__HTTP_HEADERS__ = { + 'Access-Control-Allow-Origin' : '*', + 'Access-Control-Allow-Credentials' : True +} + def names(event, context): """ returns the names of all registered strategies, but public and private @@ -58,14 +64,27 @@ def submit(event, context): # get data data = json.loads(event['body']) + print("received data") + print(data) + # validate against schema - validate(data, __SUBMIT_STRATEGY_SCHEMA__) + result = validate(data, __SUBMIT_STRATEGY_SCHEMA__) + + print("data are validated"); + print(result) strategy = urlsafe_b64decode(data['content']).decode('utf-8') + print("loaded strategy") + print(strategy) # try to load the strategy StrategyResolver().compile(data['name'], strategy) + print("compiled strategy") # save to DB - pass + return { + "statusCode": 200, + "headers": __HTTP_HEADERS__, + "body": json.dumps({"success":True}) + } diff --git a/freqtrade/tests/aws/test_strategy_lambda.py b/freqtrade/tests/aws/test_strategy_lambda.py index a8cea33d9..9d5880ba1 100644 --- a/freqtrade/tests/aws/test_strategy_lambda.py +++ b/freqtrade/tests/aws/test_strategy_lambda.py @@ -56,6 +56,7 @@ class TestStrategy(IStrategy): "public": False } + print(json.dumps(request)) submit({ "body": json.dumps(request) diff --git a/lib/libta_lib.a b/lib/libta_lib.a index a8452dbb3..5adbbfdfb 100644 Binary files a/lib/libta_lib.a and b/lib/libta_lib.a differ diff --git a/lib/libta_lib.la b/lib/libta_lib.la old mode 100644 new mode 100755 index 5f310f80d..a02606b41 --- a/lib/libta_lib.la +++ b/lib/libta_lib.la @@ -14,7 +14,7 @@ library_names='libta_lib.so.0.0.0 libta_lib.so.0 libta_lib.so' old_library='libta_lib.a' # Libraries that this one depends upon. -dependency_libs=' -lpthread -ldl ' +dependency_libs=' -lpthread -ldl' # Version information for libta_lib. current=0 @@ -22,7 +22,7 @@ age=0 revision=0 # Is this an already installed library? -installed=no +installed=yes # Should we warn about portability when linking against -modules? shouldnotlink=no diff --git a/lib/libta_lib.lai b/lib/libta_lib.lai deleted file mode 100644 index a02606b41..000000000 --- a/lib/libta_lib.lai +++ /dev/null @@ -1,35 +0,0 @@ -# libta_lib.la - a libtool library file -# Generated by ltmain.sh - GNU libtool 1.5.22 Debian 1.5.22-4 (1.1220.2.365 2005/12/18 22:14:06) -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='libta_lib.so.0' - -# Names of this library. -library_names='libta_lib.so.0.0.0 libta_lib.so.0 libta_lib.so' - -# The name of the static archive. -old_library='libta_lib.a' - -# Libraries that this one depends upon. -dependency_libs=' -lpthread -ldl' - -# Version information for libta_lib. -current=0 -age=0 -revision=0 - -# Is this an already installed library? -installed=yes - -# Should we warn about portability when linking against -modules? -shouldnotlink=no - -# Files to dlopen/dlpreopen -dlopen='' -dlpreopen='' - -# Directory that this library needs to be installed in: -libdir='/usr/local/lib' diff --git a/lib/libta_lib.so.0.0.0 b/lib/libta_lib.so.0.0.0 index b1f227ea3..fffce0226 100755 Binary files a/lib/libta_lib.so.0.0.0 and b/lib/libta_lib.so.0.0.0 differ diff --git a/requirements.txt b/requirements.txt index e5596d3dd..1554b19fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,8 @@ pytest-mock==1.10.0 pytest-cov==2.5.1 hyperopt==0.1 # do not upgrade networkx before this is fixed https://github.com/hyperopt/hyperopt/issues/325 -networkx==1.11 +#networkx==1.11 +git+git://github.com/berlinguyinca/networkx@v1.11 tabulate==0.8.2 coinmarketcap==4.2.1 simplejson diff --git a/serverless.yml b/serverless.yml index 11018b3ab..da9571041 100644 --- a/serverless.yml +++ b/serverless.yml @@ -73,8 +73,6 @@ custom: - pytest-mock - pytest-cov - pymongo - pipCmdExtraArgs: - - "--no-binary :all:" package: exclude: - test/**