finally managed to compile aws functions + talib

This commit is contained in:
EC2 Default User 2018-05-19 21:31:01 +00:00
parent ebb627d6ef
commit 4bb944c432
8 changed files with 32 additions and 48 deletions

View File

@ -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})
}

View File

@ -56,6 +56,7 @@ class TestStrategy(IStrategy):
"public": False
}
print(json.dumps(request))
submit({
"body": json.dumps(request)

Binary file not shown.

4
lib/libta_lib.la Normal file → Executable file
View File

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

View File

@ -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'

Binary file not shown.

View File

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

View File

@ -73,8 +73,6 @@ custom:
- pytest-mock
- pytest-cov
- pymongo
pipCmdExtraArgs:
- "--no-binary :all:"
package:
exclude:
- test/**