[PR #199] [MERGED] initial service deployment #314

Closed
opened 2026-02-16 01:16:51 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/199
Author: @logan-markewich
Created: 8/22/2024
Status: Merged
Merged: 8/23/2024
Merged by: @logan-markewich

Base: v0.1.0Head: logan/service_deployment


📝 Commits (4)

  • ee3f3eb initial service deployment
  • 1f700b2 add orchestrator config
  • 4578c8d use BaseSettings
  • a9c4e3f refactor to use free functions for deploy

📊 Changes

21 files changed (+496 additions, -725 deletions)

View changed files

📝 llama_agents/__init__.py (+12 -7)
📝 llama_agents/client/sync_client.py (+1 -0)
📝 llama_agents/control_plane/__init__.py (+2 -2)
📝 llama_agents/control_plane/server.py (+30 -0)
llama_agents/deploy/__init__.py (+3 -0)
llama_agents/deploy/deploy.py (+158 -0)
llama_agents/launchers/__init__.py (+0 -4)
llama_agents/launchers/local.py (+0 -232)
llama_agents/launchers/server.py (+0 -157)
📝 llama_agents/message_queues/__init__.py (+23 -1)
📝 llama_agents/message_queues/apache_kafka.py (+20 -1)
📝 llama_agents/message_queues/rabbitmq.py (+25 -0)
📝 llama_agents/message_queues/redis.py (+25 -0)
📝 llama_agents/message_queues/simple.py (+10 -0)
📝 llama_agents/orchestrators/__init__.py (+5 -1)
📝 llama_agents/orchestrators/simple.py (+8 -0)
📝 llama_agents/services/__init__.py (+2 -1)
📝 llama_agents/services/base.py (+9 -0)
📝 llama_agents/services/workflow.py (+17 -3)
📝 poetry.lock (+144 -315)

...and 1 more files

📄 Description

This PR does the following

  • removes the old launchers
  • introduces a new launcher
    • async only
    • debatable if this should have sync entry points
  • introduces config objects for each type of services
    • message queue
    • control plane
    • workflow service
    • orchestrator
    • debatable if this is ok to do
  • adds some missing methods to the control plane

Tested with the following code:

script1.py

from llama_agents import deploy_core, ControlPlaneConfig, SimpleMessageQueueConfig

async def main():
    await deploy_core(
        ControlPlaneConfig(),
        SimpleMessageQueueConfig(),
    )

if __name__ == "__main__":
    import asyncio

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

script2.py

from llama_index.core.workflow import Workflow, StartEvent, StopEvent, step

class MyWorkflow(Workflow):

    @step()
    async def run_step(self, ev: StartEvent) -> StopEvent:
        arg1 = ev.get("arg1")
        if not arg1:
            raise ValueError("arg1 is required.")

        return StopEvent(result=str(arg1) + "_result")


from llama_agents import (
    deploy_workflow, 
    ControlPlaneConfig, 
    SimpleMessageQueueConfig, 
    WorkflowServiceConfig,
)

async def main():
    await deploy_workflow(
        MyWorkflow(),
        WorkflowServiceConfig(host="127.0.0.1", port=8002, service_name="my_workflow"),
        ControlPlaneConfig(),
        SimpleMessageQueueConfig(),
    )

if __name__ == "__main__":
    import asyncio
    
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

(avoiding asyncio.run() makes ctrl+c exit the script a lot more elegantly 😅)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/199 **Author:** [@logan-markewich](https://github.com/logan-markewich) **Created:** 8/22/2024 **Status:** ✅ Merged **Merged:** 8/23/2024 **Merged by:** [@logan-markewich](https://github.com/logan-markewich) **Base:** `v0.1.0` ← **Head:** `logan/service_deployment` --- ### 📝 Commits (4) - [`ee3f3eb`](https://github.com/run-llama/llama_deploy/commit/ee3f3eb7954ae55b65a215f30a70db6e9703fb27) initial service deployment - [`1f700b2`](https://github.com/run-llama/llama_deploy/commit/1f700b2c20d75d360674552b05f3eed63a8c6fa7) add orchestrator config - [`4578c8d`](https://github.com/run-llama/llama_deploy/commit/4578c8d0cfd86a79f76b3a88b264d571032194a9) use BaseSettings - [`a9c4e3f`](https://github.com/run-llama/llama_deploy/commit/a9c4e3f066f8507ffd1c90fde4ac7e6edc7a420e) refactor to use free functions for deploy ### 📊 Changes **21 files changed** (+496 additions, -725 deletions) <details> <summary>View changed files</summary> 📝 `llama_agents/__init__.py` (+12 -7) 📝 `llama_agents/client/sync_client.py` (+1 -0) 📝 `llama_agents/control_plane/__init__.py` (+2 -2) 📝 `llama_agents/control_plane/server.py` (+30 -0) ➕ `llama_agents/deploy/__init__.py` (+3 -0) ➕ `llama_agents/deploy/deploy.py` (+158 -0) ➖ `llama_agents/launchers/__init__.py` (+0 -4) ➖ `llama_agents/launchers/local.py` (+0 -232) ➖ `llama_agents/launchers/server.py` (+0 -157) 📝 `llama_agents/message_queues/__init__.py` (+23 -1) 📝 `llama_agents/message_queues/apache_kafka.py` (+20 -1) 📝 `llama_agents/message_queues/rabbitmq.py` (+25 -0) 📝 `llama_agents/message_queues/redis.py` (+25 -0) 📝 `llama_agents/message_queues/simple.py` (+10 -0) 📝 `llama_agents/orchestrators/__init__.py` (+5 -1) 📝 `llama_agents/orchestrators/simple.py` (+8 -0) 📝 `llama_agents/services/__init__.py` (+2 -1) 📝 `llama_agents/services/base.py` (+9 -0) 📝 `llama_agents/services/workflow.py` (+17 -3) 📝 `poetry.lock` (+144 -315) _...and 1 more files_ </details> ### 📄 Description This PR does the following - removes the old launchers - introduces a new launcher - async only - debatable if this should have sync entry points - introduces config objects for each type of services - message queue - control plane - workflow service - orchestrator - debatable if this is ok to do - adds some missing methods to the control plane ---- Tested with the following code: script1.py ```python from llama_agents import deploy_core, ControlPlaneConfig, SimpleMessageQueueConfig async def main(): await deploy_core( ControlPlaneConfig(), SimpleMessageQueueConfig(), ) if __name__ == "__main__": import asyncio loop = asyncio.get_event_loop() loop.run_until_complete(main()) ``` script2.py ```python from llama_index.core.workflow import Workflow, StartEvent, StopEvent, step class MyWorkflow(Workflow): @step() async def run_step(self, ev: StartEvent) -> StopEvent: arg1 = ev.get("arg1") if not arg1: raise ValueError("arg1 is required.") return StopEvent(result=str(arg1) + "_result") from llama_agents import ( deploy_workflow, ControlPlaneConfig, SimpleMessageQueueConfig, WorkflowServiceConfig, ) async def main(): await deploy_workflow( MyWorkflow(), WorkflowServiceConfig(host="127.0.0.1", port=8002, service_name="my_workflow"), ControlPlaneConfig(), SimpleMessageQueueConfig(), ) if __name__ == "__main__": import asyncio loop = asyncio.get_event_loop() loop.run_until_complete(main()) ``` (avoiding asyncio.run() makes `ctrl+c` exit the script a lot more elegantly 😅) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:51 -05:00
yindo closed this issue 2026-02-16 01:16:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#314