[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/start cmd #6518

Merged
merged 15 commits into from
Aug 22, 2023
Merged

Feat/start cmd #6518

merged 15 commits into from
Aug 22, 2023

Conversation

fengtality
Copy link
Sponsor Contributor

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

  • Adds start command for users running from source
  • Changes Dockerfile

Tips for QA testing:

  • Pull start-cmd Docker image which uses this build

@fengtality fengtality requested a review from rapcmia August 8, 2023 23:40
@rapcmia
Copy link
Contributor
rapcmia commented Aug 9, 2023

PR update:


However if a user or a development update caused issue that could not let the client start, the error and traceback we need is hidden due to the 2>/dev/null.

  • For source build: We can use command bin/hummingbot.py to start the client so we see the error ✅

  • For docker build ❌

    Screen.Recording.2023-08-09.at.10.58.06.AM.mov
    • If the container is not running after successfully created on bash_scripts or docker compose, the common advise we do is to run docker logs container_name to look for possible error. However on this PR and recording above due to the added 2>/dev/null it is now hidden.

Steps to reproduce:

  1. For source build, try to add extra characters on any file codebase
  2. For docker build, after. successfully created and opened the container:
    • Close it again and delete conf folder
    • Start the docker container again and observe behavior (should not be displayed on docker ps)
    • Run docker logs container_name

Note: This is PR is good to be approve however would need some inputs regarding the possible behavior above, thank you 🙇🏼

@rapcmia
Copy link
Contributor
rapcmia commented Aug 14, 2023

PR update:

  • Test commit 5ca0eb2d66ff7
  • Ran for couple of minutes and no instance of error parsing.. on UI ✅

Source build

  • Run ./start
  • Modify any file inside the codebase and run ./start again, does not start
    • Check bin/hummingbot.py return error on terminal
    • Check ./logs/error.log file displays the same error on terminal

Docker build

  • Build docker image ✅
  • Run docker create script, container created successfully
  • Deleted conf folder or cert folder and observe when docker start
    • Docker still running on background when the expected behavior should stop ❌
      image
      • Run docker logs container_name loads the password field at the same time does not show any error
      • Not possible to enter password when this happened
      • Check ./logs/error.log folder, error.log file does not contain any error message

Steps to reproduce:

  • Build docker image for this PR
  • Run docker compose or hummingbot-create.sh script for new container
  • Delete conf or certs folder and start the container again
  • Run docker start container_name and observe:
    • Check ./logs/error.log and there are no error indication
    • Check docker ps, container still active status. Run docker logs container_name and shows password field and nothing else

@fengtality
Copy link
Sponsor Contributor Author

@rapcmia I added a commit that should append errors to errors.log instead of overriding them. Does that fix the Docker issue?

@nikspz
Copy link
Contributor
nikspz commented Aug 21, 2023

Note: Crosschecked both development and PR6518 on source, both don’t have Error parsing 'content-type' after hour after Client started

PR6518 source:
6518

  • Test performed

    • Source build

      • Run ./start, terminal logs returns:
      AsyncClient - chain session cookie loaded from disk:
      trading_pair_fetcher - An error occurred when fetching trading pairs for injective_v2.Please check the logs (See log file for stack trace dump)
      • Created error.log file which is empty However messages recorded at logs_hummingbot.log
      2023-08-21 09:57:20,087 - 657898 - pyinjective.async_client.AsyncClient - INFO - chain session cookie loaded from disk: 
      2023-08-21 09:57:20,098 - 657898 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for injective_v2.Please check the logs
      Traceback (most recent call last):
        File "/home/nikita/start6518/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
          self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
        File "/home/nikita/start6518/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
          connector = connector_setting.non_trading_connector_instance_with_default_configuration()
        File "/home/nikita/start6518/hummingbot/client/settings.py", line 334, in non_trading_connector_instance_with_default_configuration
          connector = connector_class(**kwargs)
        File "/home/nikita/start6518/hummingbot/connector/exchange/injective_v2/injective_v2_exchange.py", line 60, in __init__
          self._data_source = connector_configuration.create_data_source()
        File "/home/nikita/start6518/hummingbot/connector/exchange/injective_v2/injective_v2_utils.py", line 319, in create_data_source
          return self.account_type.create_data_source(
        File "/home/nikita/start6518/hummingbot/connector/exchange/injective_v2/injective_v2_utils.py", line 205, in create_data_source
          return InjectiveGranteeDataSource(
        File "/home/nikita/start6518/hummingbot/connector/exchange/injective_v2/data_sources/injective_grantee_data_source.py", line 58, in __init__
          self._private_key = PrivateKey.from_hex(private_key)
        File "/home/nikita/miniconda3/envs/hummingbot/lib/python3.10/site-packages/pyinjective/wallet.py", line 75, in from_hex
          self.signing_key = SigningKey.from_string(bytes.fromhex(priv), curve=SECP256k1, hashfunc=hashlib.sha256)
        File "/home/nikita/miniconda3/envs/hummingbot/lib/python3.10/site-packages/ecdsa/keys.py", line 916, in from_string
          return cls.from_secret_exponent(secexp, curve, hashfunc)
        File "/home/nikita/miniconda3/envs/hummingbot/lib/python3.10/site-packages/ecdsa/keys.py", line 857, in from_secret_exponent
          raise MalformedPointError(
      ecdsa.errors.MalformedPointError: Invalid value for secexp, expected integer between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494337
      • Removed files from /hummingbot/data_feed and start with ./start

        • Review error.log recorded Error parsing 'content-type' metadata: invalid value
          Traceback (most recent call last):
          File "/home/nikita/start6518/bin/hummingbot.py", line 11, in
          ....
          ModuleNotFoundError: No module named 'hummingbot.data_feed.data_feed_base'
      • Run bin/humminbot.py: same error/warning message error occurred when fetching trading pairs for injective_v2 on terminal

        • error.log file not created, however this messages recorded at logs_hummingbot.log
      2023-08-21 09:47:17,927 - 657805 - pyinjective.async_client.AsyncClient - INFO - chain session cookie loaded from disk: 
      2023-08-21 09:47:17,931 - 657805 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for injective_v2.Please check the logs
      Traceback (most recent call last):
        File "/home/nikita/start6518/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
          self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
             ..........................
      ecdsa.errors.MalformedPointError: Invalid value for secexp, expected integer between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494337
  • Docker build:

    • Manually created docker image successfully
    • Run docker hummingbot-create script, container created successfully
    • Started instance, review logs folder:
      • empty error.log file created
      • logs recorded at logs_hummingbot.log
      • Deleted conf folder and restart docker start sta && docker attach sta
        • review instance started successfully and conf folder recreated

CMD conda activate hummingbot && ./bin/hummingbot_quickstart.py 2>> ./logs/errors.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fengtality I reverted the changes because in the last commit you changed ./bin/hummingbot.py for ./bin/hummingbot_quickstart.py

Copy link
Contributor
@cardosofede cardosofede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cardosofede
Copy link
Contributor

@fengtality @nikspz @rapcmia I did some changes because the Dockerfile was using hummingbot.py instead of hummingbot_quickstart.py and that won't allow the autostart of strategies.
Also I removed the touch because if the file does not exist the bash command will create it.
QA testing before merging tomorrow:

  • Run it from source
  • Build docker image and run it in a clean folder

After that we are ready to merge

@rapcmia rapcmia merged commit ed41001 into development Aug 22, 2023
2 checks passed
@rapcmia rapcmia deleted the feat/start-cmd branch August 22, 2023 05:04
@rapcmia
Copy link
Contributor
rapcmia commented Aug 22, 2023

Merged to development and part of release version 1.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants