Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions deployment/Dockerfile-aws

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We already have a Dockerfile. Do we need two?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The new file 'deployment/Dockerfile-aws' is a version that works for AWS EKS.

  • It install only what we need (instead of .[all])
  • It starts agent directly
  • It exposes the MCP port

@renan-souza renan-souza Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This can be made default in the existing Dockerfile

  • It starts agent directly, if llm_agent is given in the EXTRAS deps (see below).
  • It exposes the MCP port

So the only conflict that would require further analysis and/or changes would be checking if we really need [all] -- we'd need to check the CI that uses the container and if, we really need [all], parametrizing it with Docker build arguments (ARG)

Something like:

 ARG EXTRAS="all"

 # Use the ARG value in the pip install command. If no build arg EXTRAS is passed, it's going to install optional deps.
 RUN conda run -n flowcept pip install -e .[${EXTRAS}]

Then you can pass specific deps in your build command like this:

    docker build \
      --build-arg EXTRAS="lmdb,telemetry,dev,llm_agent,extras" \
      -t flowcept:latest \
      -f deployment/Dockerfile .

Flowcept has several dependable services and can be started in multiple ways. I think having one Dockerfile per way makes it harder to maintain. Also, that Dockerfile can be reused in multiple other envs, including ORNL's OpenShift cluster not only EKS.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good!

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use the command `make build` to build this image.
# Use conda-forge base image consistently across local/CI.
FROM condaforge/miniforge3:23.11.0-0

WORKDIR /flowcept

COPY pyproject.toml Makefile README.md ./
COPY src ./src
COPY resources ./resources
COPY notebooks ./notebooks
COPY tests ./tests
COPY examples ./examples

# Create env + install flowcept
RUN conda create -n flowcept python=3.11.10 -y && \
conda run -n flowcept pip install -e .[lmdb,telemetry,dev,llm_agent,extras]

# Set env variables properly
ENV FLOWCEPT_SETTINGS_PATH=/flowcept/resources/sample_settings.yaml

# Expose MCP port
EXPOSE 8003

# Start agent directly
CMD ["conda", "run", "--no-capture-output", "-n", "flowcept", "flowcept", "--start-agent"]
Empty file.
6 changes: 3 additions & 3 deletions resources/sample_settings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flowcept_version: 0.10.5 # Version of the Flowcept package. Do not update this manually. The CI updates it. This setting file is compatible with this version.
flowcept_version: 0.10.9 # Version of the Flowcept package. Do not update this manually. The CI updates it. This setting file is compatible with this version.

project:
debug: true # Toggle debug mode. This will add a property `debug: true` to all saved data, making it easier to retrieve/delete them later.
Expand Down Expand Up @@ -93,8 +93,8 @@ agent:
enabled: false
mcp_host: localhost
mcp_port: 8000
allowed_hosts:
- "0.1.2.3:*"
mcp_allowed_hosts: ["localhost:*", "127.0.0.1:*"] # Default is ["localhost:*", "127.0.0.1:*"]
mcp_allowed_origins: ["http://localhost:*", "http://127.0.0.1:*"] # Default is ["http://localhost:*", "http://127.0.0.1:*"]
llm_server_url: '?'
api_key: '?'
model: '?'
Expand Down
8 changes: 7 additions & 1 deletion src/flowcept/agents/flowcept_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ def main():
"""
agent = FlowceptAgent().start()
# Wake up tool call
print(run_tool(check_liveness, host=AGENT_HOST, port=AGENT_PORT)[0])
# Flowcept liveness check was calling: http://0.0.0.0:8003/mcp
# This caused error:
# httpx.HTTPStatusError: Client error '421 Misdirected Request' for url 'http://0.0.0.0:8003/mcp'
# The server binds to AGENT_HOST, but wildcard bind addresses (0.0.0.0, ::) are not routable
# as a client destination, so fall back to localhost; otherwise honor the configured host.
liveness_host = "localhost" if AGENT_HOST in ("0.0.0.0", "::", "") else AGENT_HOST
print(run_tool(check_liveness, host=liveness_host, port=AGENT_PORT)[0])
agent.wait()


Expand Down
7 changes: 4 additions & 3 deletions src/flowcept/agents/flowcept_ctx_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from flowcept.commons.flowcept_dataclasses.task_object import TaskObject
from flowcept.commons.flowcept_logger import FlowceptLogger
from flowcept.commons.vocabulary import Status
from flowcept.configs import AGENT
from flowcept.configs import AGENT, MCP_ALLOWED_ORIGINS, MCP_ALLOWED_HOSTS
from mcp.server.fastmcp import FastMCP

import json
Expand Down Expand Up @@ -286,12 +286,13 @@ def monitor_chunk(self):
ctx_manager = FlowceptAgentContextManager()

agent_transport_security = None
if "allowed_hosts" in AGENT:
if "mcp_allowed_hosts" in AGENT:
from mcp.server.transport_security import TransportSecuritySettings

agent_transport_security = TransportSecuritySettings(
enable_dns_rebinding_protection=True,
allowed_hosts=AGENT.get("allowed_hosts"),
allowed_hosts=MCP_ALLOWED_HOSTS,
allowed_origins=MCP_ALLOWED_ORIGINS,
)

mcp_flowcept = FastMCP(
Expand Down
15 changes: 15 additions & 0 deletions src/flowcept/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import socket
import getpass
import json

from flowcept.version import __version__

Expand Down Expand Up @@ -45,6 +46,16 @@ def _get_env_bool(name: str, default=False) -> bool:
return str(_get_env(name, str(default))).strip().lower() in _TRUE_VALUES


def _get_env_list(name: str, default: list[str]) -> list[str]:
raw = os.getenv(name)
if not raw:
return default
try:
return json.loads(raw)
except json.JSONDecodeError:
raise ValueError(f"{name} must be valid JSON array")


if USE_DEFAULT:
settings = DEFAULT_SETTINGS.copy()
SETTINGS_PATH = "FLOWCEPT_DEFAULT_SETTINGS"
Expand Down Expand Up @@ -272,6 +283,10 @@ def _get_env_bool(name: str, default=False) -> bool:
AGENT_AUDIO = _get_env_bool("AGENT_AUDIO", settings["agent"].get("audio_enabled", "false"))
AGENT_HOST = _get_env("AGENT_HOST", settings["agent"].get("mcp_host", "localhost"))
AGENT_PORT = int(_get_env("AGENT_PORT", settings["agent"].get("mcp_port", "8000")))
MCP_ALLOWED_HOSTS = _get_env_list("MCP_ALLOWED_HOSTS", AGENT.get("mcp_allowed_hosts", ["localhost:*", "127.0.0.1:*"]))
MCP_ALLOWED_ORIGINS = _get_env_list(
"MCP_ALLOWED_ORIGINS", AGENT.get("mcp_allowed_origins", ["http://localhost:*", "http://127.0.0.1:*"])
)

####################
# Enabled ADAPTERS #
Expand Down
2 changes: 1 addition & 1 deletion src/flowcept/version.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@danielrosendo Read this warning :) Please don't manually change version.py

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I did not change version is 'resources/sample_settings.yaml'. Made only this change:

  • allowed_hosts:
    • "0.1.2.3:*"
  • mcp_allowed_hosts: ["localhost:", "127.0.0.1:"] # Default is ["localhost:", "127.0.0.1:"]
  • mcp_allowed_origins: ["http://localhost:", "http://127.0.0.1:"] # Default is ["http://localhost:", "http://127.0.0.1:"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you change the file version.py? It looks changed in this PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, I did not touch version.py

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# See .github/workflows/version_bumper.py

# ✋⚠️⛔❗❗❗ STOP! DANGER!!ONEONEELEVEN! Did you carefully read the warning above?! :)
__version__ = "0.10.5"
__version__ = "0.10.9"
Loading