brndnmtthws / thetagang

ThetaGang is an IBKR bot for collecting money
GNU Affero General Public License v3.0
2.01k stars 267 forks source link

New coder, issue getting the bot to run. #169

Closed Ianfinn1994 closed 3 years ago

Ianfinn1994 commented 3 years ago

I am pretty much teaching myself how to code. I am trying to build the bot using wsl ubuntu and have it run on my windows tower all day while i work. I am trying to build the docker file and then pass the two libraries into my copy of the code saved on my desktop, i keep getting this error when building, it seems to have to do with the tws installer for interactive brokers. Do i need a desktop interface, can i install this using wsl? Where am i going wrong?

6 155.5 Downloading SecretStorage-3.3.0-py3-none-any.whl (14 kB)

6 155.5 Collecting ptyprocess>=0.5

6 155.5 Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)

6 155.6 Collecting pyparsing>=2.0.2

6 155.7 Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)

6 155.7 Collecting msgpack>=0.5.2

6 155.8 Downloading msgpack-1.0.2-cp39-cp39-manylinux1_x86_64.whl (294 kB)

6 155.9 Collecting lockfile>=0.9; extra == "filecache"

6 155.9 Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)

6 156.2 Collecting cryptography>=2.0

6 156.2 Downloading cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl (2.6 MB)

6 157.2 Collecting cffi>=1.12

6 157.3 Downloading cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl (405 kB)

6 157.4 Collecting pycparser

6 157.4 Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)

6 157.6 Installing collected packages: pip, crashtest, poetry-core, filelock, appdirs, distlib, six, virtualenv, pylev, pastel, clikit, tomlkit, idna, certifi, chardet, urllib3, requests, webencodings, html5lib, shellingham, jeepney, pycparser, cffi, cryptography, SecretStorage, keyring, ptyprocess, pexpect, requests-toolbelt, pkginfo, cleo, pyparsing, packaging, cachy, msgpack, lockfile, cachecontrol, poetry

6 157.6 Attempting uninstall: pip

6 157.6 Found existing installation: pip 20.1.1

6 157.6 Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr

6 157.6 Can't uninstall 'pip'. No files were found to uninstall.

6 160.2 Successfully installed SecretStorage-3.3.0 appdirs-1.4.4 cachecontrol-0.12.6 cachy-0.3.0 certifi-2020.12.5 cffi-1.14.4 chardet-4.0.0 cleo-0.8.1 clikit-0.6.2 crashtest-0.3.1 cryptography-3.3.1 distlib-0.3.1 filelock-3.0.12 html5lib-1.1 idna-2.10 jeepney-0.6.0 keyring-21.8.0 lockfile-0.12.2 msgpack-1.0.2 packaging-20.8 pastel-0.2.1 pexpect-4.8.0 pip-21.0 pkginfo-1.7.0 poetry-1.1.4 poetry-core-1.0.0 ptyprocess-0.7.0 pycparser-2.20 pylev-1.3.0 pyparsing-2.4.7 requests-2.25.1 requests-toolbelt-0.9.1 shellingham-1.3.2 six-1.15.0 tomlkit-0.7.0 urllib3-1.26.2 virtualenv-20.4.0 webencodings-0.5.1

6 160.3 30ed8944d4df950e8802b0f127f6445cd23fbfd6ecc42b375fe222f6714669fa tws-installer.sh

6 160.3 % Total % Received % Xferd Average Speed Time Time Time Current

6 160.3 Dload Upload Total Spent Left Speed

100 74.0M 100 74.0M 0 0 3566k 0 0:00:21 0:00:21 --:--:-- 3664k

6 181.8 sha256sum: WARNING: 1 computed checksum did NOT match

6 181.8 tws-installer.sh: FAILED


executor failed running [/bin/sh -c apt-get update && apt-get install -qy python3-pip xvfb libxrender1 openjfx unzip curl && pip3 install --upgrade pip poetry && echo '30ed8944d4df950e8802b0f127f6445cd23fbfd6ecc42b375fe222f6714669fa tws-installer.sh' | tee tws-installer.sh.sha256 && curl -qL https://download2.interactivebrokers.com/installers/tws/stable-standalone/tws-stable-standalone-linux-x64.sh -o tws-installer.sh && sha256sum -c tws-installer.sh.sha256 && echo 'c079e0ade7e95069e464859197498f0abb4ce277b2f101d7474df4826dcac837 ibc.zip' | tee ibc.zip.sha256 && curl -qL https://github.com/IbcAlpha/IBC/releases/download/3.8.4-beta.2/IBCLinux-3.8.4-beta.2.zip -o ibc.zip && sha256sum -c ibc.zip.sha256 && yes "" | sh tws-installer.sh && unzip ibc.zip -d /opt/ibc && chmod o+x /opt/ibc/.sh /opt/ibc//.sh && rm tws-installer.sh ibc.zip && apt-get clean && rm -rf /var/lib/apt/lists/]: exit code: 1 The terminal process "/bin/bash '-c', 'docker build --pull --rm -f "Dockerfile" -t thetagangmain:latest "."'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Ianfinn1994 commented 3 years ago

Update. I got the code to open in a Debian container on docker on visual studio. It keeps failing on tws installer.

brndnmtthws commented 3 years ago

IBKR updates the images in-place periodically (which is pretty annoying), and there is no way to verify the hash direct from the source. As far as I know, there is also no way to download previous releases.

I have been manually updating and verifying the image accordingly once everything looks okay. I fetched the latest installer, and the hash (as of time of writing) is currently 09a2d39a1f5727346f43959b6c52b7becd1e4dd42b5ab907dd7d29cd51a023df which I will update.

If you're trying to build the Docker image locally, you'll need this. Alternatively you can just pull the image from Docker hub (docker pull brndnmtthws/thetagang) and run that instead, skipping all this.