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

Attempts at getting MVP agent running. #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dakotablair
Copy link
Collaborator

Here are the changes we made to attempt to get the agents running.

Added a few missing dependencies and some specific versions of modules.
Finally, install the latest development version of databroker since previous
versions are not compatible with this agent demo.
@dakotablair dakotablair marked this pull request as ready for review August 27, 2024 15:36
@dakotablair
Copy link
Collaborator Author

These updates enable the demo agent to run as a backend for independent frontend development.

Copy link
Owner

@maffettone maffettone left a comment

Choose a reason for hiding this comment

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

In the long run there will be a community supported solution here:
bluesky/bluesky-pods#58

For now this should be good, will clarify on the suggestion next time we chat then merge.

Comment on lines +3 to +14
RUN pip3 install asgi_correlation_id jmespath cachey
RUN pip3 install \
awkward \
json-merge-patch \
jsonpatch \
pydantic \
pydantic-settings \
"PyYAML<=5.3.1" \
sparse \
"tiled==0.1.0b6" \
"typing-extensions>=4.8.0"
RUN pip3 install "databroker @ git+https://github.com/bluesky/databroker.git@5676d95e4b3efb874dddfb436a0f7f6a79301772"
Copy link
Owner

Choose a reason for hiding this comment

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

Sanity check, did we try this with

Suggested change
RUN pip3 install asgi_correlation_id jmespath cachey
RUN pip3 install \
awkward \
json-merge-patch \
jsonpatch \
pydantic \
pydantic-settings \
"PyYAML<=5.3.1" \
sparse \
"tiled==0.1.0b6" \
"typing-extensions>=4.8.0"
RUN pip3 install "databroker @ git+https://github.com/bluesky/databroker.git@5676d95e4b3efb874dddfb436a0f7f6a79301772"
RUN pip3 install tiled[all]
RUN pip3 install --pre --upgrade databroker

I don't know if we avoided all of tiled for the sake of bloat, or if we decided to pin versions because there is something messy involved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had not tried that previously, but I did try to launch the agent with these changes and got the error below. This is similar to the kinds of errors I was getting previously, and yes, solving them is a bit messy.

Is there a reason to be concerned with bloat at this time? We are not running out of resources in any way I can tell. That being said, if we want to slim the image at some point we have a few readily available options to try (reducing layers, etc.).

INFO:     Uvicorn running on http://0.0.0.0:60615 (Press CTRL+C to quit)
[E 2024-08-28 13:43:25,750 bluesky_adaptive.server.worker] Failed to load the agent code.:
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/bluesky_adaptive/server/utils.py", line 293, in load_startup_script
    exec(code, nspace, nspace)
  File "/app/agent.py", line 11, in <module>
    from bluesky_adaptive.agents.base import Agent as BaseAgent
  File "/usr/local/lib/python3.12/site-packages/bluesky_adaptive/agents/base.py", line 15, in <module>
    from bluesky_kafka import Publisher, RemoteDispatcher
  File "/usr/local/lib/python3.12/site-packages/bluesky_kafka/__init__.py", line 9, in <module>
    from bluesky.run_engine import Dispatcher, DocumentNames
  File "/usr/local/lib/python3.12/site-packages/bluesky/__init__.py", line 1, in <module>
    from .utils import Msg  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bluesky/utils/__init__.py", line 33, in <module>
    from bluesky.protocols import (
  File "/usr/local/lib/python3.12/site-packages/bluesky/protocols.py", line 3, in <module>
    from event_model.documents import Datum, StreamDatum, StreamResource
  File "/usr/local/lib/python3.12/site-packages/event_model/__init__.py", line 37, in <module>
    from .documents.datum import Datum
  File "/usr/local/lib/python3.12/site-packages/event_model/documents/__init__.py", line 2, in <module>
    from .datum import Datum
  File "/usr/local/lib/python3.12/site-packages/event_model/documents/datum.py", line 5, in <module>
    from .generate.type_wrapper import Field, add_extra_schema
  File "/usr/local/lib/python3.12/site-packages/event_model/documents/generate/type_wrapper.py", line 15, in <module>
    pydantic_version = pydantic.__version__
                       ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pydantic.v1' has no attribute '__version__'

Error while executing script '/app/agent.py': module 'pydantic.v1' has no attribute '__version__'

Copy link
Owner

Choose a reason for hiding this comment

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

No reason to be too concerned with bloat, but I always like a fast churn and I know tiled can take some time to pip install [all].

This seems like a hairy error that is likely due to the upstream layer we work FROM. I'd say ignore for now since there will be a community supported version to preferentially work from.

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.

2 participants