hackingthemarkets / tradekit

a collection of open source server components and Python libraries for financial data projects and automated trading
Apache License 2.0
649 stars 252 forks source link

TimescaleDB doesn't launch? #4

Open goodpunk6 opened 3 years ago

goodpunk6 commented 3 years ago

The process gets to this point and stops. What's up? I noticed the web server is running. The demo video link has an error page that's looking for json stuff.

timescale    | 2021-02-17 23:20:27.759 UTC [1] LOG:  starting PostgreSQL 12.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, 64-bit
timescale    | 2021-02-17 23:20:27.759 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
timescale    | 2021-02-17 23:20:27.759 UTC [1] LOG:  listening on IPv6 address "::", port 5432
timescale    | 2021-02-17 23:20:27.760 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
timescale    | 2021-02-17 23:20:27.791 UTC [85] LOG:  database system was shut down at 2021-02-17 23:20:27 UTC
timescale    | 2021-02-17 23:20:27.795 UTC [1] LOG:  database system is ready to accept connections
timescale    | 2021-02-17 23:20:27.797 UTC [91] LOG:  TimescaleDB background worker launcher connected to shared catalogs

Also,

root@c3eeb72ae0b2:/app# python3
Python 3.8.7 (default, Feb  9 2021, 08:08:20)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/talib/__init__.py", line 52, in <module>
    from ._ta_lib import (
  File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
>>> import talib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/talib/__init__.py", line 52, in <module>
    from ._ta_lib import (
  File "talib/_ta_lib.pyx", line 1, in init talib._ta_lib
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
>>> import pandas
>>> import numpy
>>> exit()
root@c3eeb72ae0b2:/app# exit

And it installed an older version, you have 2.0 in your video -

tradekit-# \dx
                                      List of installed extensions
    Name     | Version |   Schema   |                            Description
-------------+---------+------------+-------------------------------------------------------------------
 plpgsql     | 1.0     | pg_catalog | PL/pgSQL procedural language
 timescaledb | 1.7.5   | public     | Enables scalable inserts and complex queries for time-series data
(2 rows)

tradekit-#
waldren commented 3 years ago

ta-lib issue:

I read some posts (some in Japanese) that state they had to use Python 3.8 buster. I tried Python 3.8.8-buster in the docker file, but no luck. I also added: && \ echo "include /usr/local/lib" >> /etc/ld.so.conf && \ ldconfig after make install when building ta-lib. As this was also suggested. Neither worked.

Other posts talk about downgrading numpy to 1.16, I tried that just to see and that did not work either.

waldren commented 3 years ago

found this: https://github.com/mrjbq7/ta-lib/issues/378

Upgrading numpy to 1.20.0 works though now tensorflow is not supported (required 1.19.2 of numpy)

fathalla78 commented 3 years ago

I am getting this error when running: "tradekit-main fathalla$ docker exec -it timescaledb bash"

Error: No such container: timescaledb

waldren commented 3 years ago

@fathalla78 Is the container running?

You can list running containers with:

docker ps

If you do not see it in the list, then it is not running and therefore you cannot connect.

You can then list all containers with:

docker ps -al

If it is not listed there, then the container did not get created.

fathalla78 commented 3 years ago

thanks for helping me doc.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9b0f6d24a1e8 tradekit-main_web "uvicorn web.main:ap…" 6 hours ago Up 6 hours 0.0.0.0:8000->80/tcp tradekit-main_web_1

--Ive executed "docker-compose up" from tradekit folder shouldn't be created? how to create this container ? what I am missing here?

@fathalla78 Is the container running?

You can list running containers with:

docker ps

If you do not see it in the list, then it is not running and therefore you cannot connect.

You can then list all containers with:

docker ps -al

If it is not listed there, then the container did not get created.

waldren commented 3 years ago

I think the name of your timescaledb container is 'timescale'

try

docker exec -it timescale bash

fathalla78 commented 3 years ago

I think the name of your timescaledb container is 'timescale'

try

docker exec -it timescale bash

Thanks Doc it worked thank you very much 😍

waldren commented 3 years ago

Great. Yes, though I have not. Here is the documentation from docker: https://docs.docker.com/engine/reference/commandline/rename/

Would want to also change the container name in docker-compose.yml file.