-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
added docker compose #154
base: main
Are you sure you want to change the base?
added docker compose #154
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.12-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace it with |
||
|
||
ENV PATH="${PATH}:/root/.local/bin" | ||
|
||
WORKDIR /ai-hedge-fund | ||
|
||
COPY . . | ||
|
||
RUN poetry install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you suggest it should be? adding something like the code snippet below would break the flexibility of running the scripts dynamically via
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can overwrite the ENTRYPOINT by parameter
Or by the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think I took care of most of the initial feedback, thanks for reviewing this! Also thanks for your patience as I am a bit of a docker-compose power user and not too familiar with the nuances of CMD & ENTRYPOINT with |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
services: | ||
ai-hedge-fund: | ||
container_name: ai-hedge-fund | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./:/ai-hedge-fund | ||
env_file: | ||
- .env | ||
stdin_open: true | ||
tty: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May use latest Python version 3.13.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using 3.13, it didn't work unfortunately. The performance of 3.12 is noticeably better than 3.10 though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What error came with Python 3.13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using 3.13 caused this error when running the poetry install step. This error appeared with both the cURL & pip install versions of poetry. Here is the error on the build step:
Step 5/6 : RUN poetry install
---> Running in bdb9face6818
Creating virtualenv ai-hedge-fund-aScRyBoL-py3.13 in /root/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Package operations: 87 installs, 0 updates, 0 removals
PEP517 build of a dependency failed
Backend subprocess exited when trying to invoke build_wheel
Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with numpy (1.26.4)
You can verify this by running pip wheel --no-cache-dir --use-pep517 "numpy (==1.26.4)".
The command '/bin/sh -c poetry install' returned a non-zero code: 1
ERROR: Service 'ai-hedge-fund' failed to build : Build failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that the
build-essential
are missing.May you can try the following Dockerfile:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to install 3.13 with that configuration. But I am not sure if I agree with requiring a ENTRYPOINT & CMD. What if a user wanted to use the backtester or a different set of tickers? Id much rather run a different
docker exec
command than having to edit the DockerfileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take a look into my comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed it when I left that previous comment. I think I get it now. Going to add instructions for both docker run and docker compose in the README in my next commit. Thanks!