From 46da1e6b46090e7c4f1c023b2ae62e2da4b4ae38 Mon Sep 17 00:00:00 2001 From: aboutphilippe Date: Mon, 6 Jan 2025 14:10:37 -0800 Subject: [PATCH 1/4] quickstart with endpoints --- get_started/README.md | 87 ------------------- get_started/src/client.py | 4 - get_started/src/workflows/workflow.py | 15 ---- pdf_pydantic/pyproject.toml | 2 +- pdf_pydantic/src/workflows/files.py | 4 +- {get_started => quickstart}/.env.Example | 0 {get_started => quickstart}/.gitignore | 0 quickstart/README.md | 67 ++++++++++++++ {get_started => quickstart}/pyproject.toml | 10 +-- .../schedule_calendar.py | 3 +- .../schedule_interval.py | 3 +- .../schedule_workflow.py | 5 +- {get_started => quickstart}/src/__init__.py | 0 quickstart/src/client.py | 18 ++++ .../src/functions/__init__.py | 0 .../src/functions/function.py | 8 +- quickstart/src/quickstart.egg-info/PKG-INFO | 65 ++++++++++++++ .../src/quickstart.egg-info/SOURCES.txt | 15 ++++ .../quickstart.egg-info/dependency_links.txt | 1 + .../src/quickstart.egg-info/entry_points.txt | 6 ++ .../src/quickstart.egg-info/requires.txt | 3 + .../src/quickstart.egg-info/top_level.txt | 5 ++ {get_started => quickstart}/src/services.py | 6 +- .../src/workflows/__init__.py | 0 quickstart/src/workflows/workflow.py | 19 ++++ 25 files changed, 224 insertions(+), 122 deletions(-) delete mode 100644 get_started/README.md delete mode 100644 get_started/src/client.py delete mode 100644 get_started/src/workflows/workflow.py rename {get_started => quickstart}/.env.Example (100%) rename {get_started => quickstart}/.gitignore (100%) create mode 100644 quickstart/README.md rename {get_started => quickstart}/pyproject.toml (73%) rename {get_started => quickstart}/schedule_calendar.py (86%) rename {get_started => quickstart}/schedule_interval.py (85%) rename {get_started => quickstart}/schedule_workflow.py (77%) rename {get_started => quickstart}/src/__init__.py (100%) create mode 100644 quickstart/src/client.py rename {get_started => quickstart}/src/functions/__init__.py (100%) rename {get_started => quickstart}/src/functions/function.py (58%) create mode 100644 quickstart/src/quickstart.egg-info/PKG-INFO create mode 100644 quickstart/src/quickstart.egg-info/SOURCES.txt create mode 100644 quickstart/src/quickstart.egg-info/dependency_links.txt create mode 100644 quickstart/src/quickstart.egg-info/entry_points.txt create mode 100644 quickstart/src/quickstart.egg-info/requires.txt create mode 100644 quickstart/src/quickstart.egg-info/top_level.txt rename {get_started => quickstart}/src/services.py (81%) rename {get_started => quickstart}/src/workflows/__init__.py (100%) create mode 100644 quickstart/src/workflows/workflow.py diff --git a/get_started/README.md b/get_started/README.md deleted file mode 100644 index f1b50083..00000000 --- a/get_started/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# Restack AI SDK - Get Started Example - -This repository contains a simple example project to help you get started with the Restack AI SDK. It demonstrates how to set up a basic workflow and functions using the SDK. - -## Prerequisites - -- Python 3.8 or higher -- Poetry (for dependency management) -- Docker (for running the Restack services) - -## Usage - -1. Run Restack local engine with Docker: - - ```bash - docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main - ``` - -2. Open the web UI to see the workflows: - - ```bash - http://localhost:5233 - ``` - -3. Clone this repository: - - ```bash - git clone https://github.com/restackio/examples-python - cd examples-python/examples/get-started - ``` - -4. Install dependencies using Poetry: - - ```bash - poetry env use 3.12 - ``` - - ```bash - poetry shell - ``` - - ```bash - poetry install - ``` - - ```bash - poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.) - ``` - -5. Run the services: - - ```bash - poetry run dev - ``` - - This will start the Restack service with the defined workflows and functions. - -6. In a new terminal, schedule the workflow: - - ```bash - poetry shell - ``` - - ```bash - poetry run schedule - ``` - - This will schedule the `GreetingWorkflow` and print the result. - -7. Optionally, schedule the workflow to run on a specific calendar or interval: - - ```bash - poetry run calendar - ``` - - ```bash - poetry run interval - ``` - -## Project Structure - -- `src/`: Main source code directory - - `client.py`: Initializes the Restack client - - `functions/`: Contains function definitions - - `workflows/`: Contains workflow definitions - - `services.py`: Sets up and runs the Restack services -- `schedule_workflow.py`: Example script to schedule and run a workflow diff --git a/get_started/src/client.py b/get_started/src/client.py deleted file mode 100644 index 52430d36..00000000 --- a/get_started/src/client.py +++ /dev/null @@ -1,4 +0,0 @@ -import os -from restack_ai import Restack - -client = Restack() diff --git a/get_started/src/workflows/workflow.py b/get_started/src/workflows/workflow.py deleted file mode 100644 index 57de6216..00000000 --- a/get_started/src/workflows/workflow.py +++ /dev/null @@ -1,15 +0,0 @@ -from datetime import timedelta -from restack_ai.workflow import workflow, import_functions, log -with import_functions(): - from src.functions.function import welcome - -@workflow.defn() -class GreetingWorkflow: - @workflow.run - async def run(self): - log.info("GreetingWorkflow started") - result = await workflow.step(welcome, input="world", start_to_close_timeout=timedelta(seconds=120)) - log.info("GreetingWorkflow completed", result=result) - return result - - diff --git a/pdf_pydantic/pyproject.toml b/pdf_pydantic/pyproject.toml index 81b98a99..d7c6cb06 100644 --- a/pdf_pydantic/pyproject.toml +++ b/pdf_pydantic/pyproject.toml @@ -19,7 +19,7 @@ numpy = "^2.2.0" pillow = "^11.0.0" pydantic = "^2.10.3" python-doctr = {extras = ["torch"], version = "^0.10.0"} -restack-ai = "0.0.48" +restack-ai = "0.0.49" [build-system] requires = ["poetry-core"] diff --git a/pdf_pydantic/src/workflows/files.py b/pdf_pydantic/src/workflows/files.py index 3ed3a3f6..3e62850b 100644 --- a/pdf_pydantic/src/workflows/files.py +++ b/pdf_pydantic/src/workflows/files.py @@ -1,12 +1,12 @@ from restack_ai.workflow import workflow, log, workflow_info from typing import List -from pydantic import BaseModel +from pydantic import BaseModel, Field import asyncio from .pdf import PdfWorkflow, PdfWorkflowInput class FilesWorkflowInput(BaseModel): - files: List[PdfWorkflowInput] + files: List[PdfWorkflowInput] = Field(None, file=True, description="Upload file") @workflow.defn() class FilesWorkflow: diff --git a/get_started/.env.Example b/quickstart/.env.Example similarity index 100% rename from get_started/.env.Example rename to quickstart/.env.Example diff --git a/get_started/.gitignore b/quickstart/.gitignore similarity index 100% rename from get_started/.gitignore rename to quickstart/.gitignore diff --git a/quickstart/README.md b/quickstart/README.md new file mode 100644 index 00000000..af7baeb2 --- /dev/null +++ b/quickstart/README.md @@ -0,0 +1,67 @@ +# Restack AI - Quickstart + +This repository contains a quickstart for Restack. +It demonstrates how to set up a basic workflow and functions. + +## Prerequisites + +- Docker (for running Restack) +- Python 3.10 or higher + +## Start Restack + +To start the Restack, use the following Docker command: + +```bash +docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` + +## Install dependencies and start services + +```bash +poetry env use 3.10 +``` + +```bash +poetry shell +``` + +```bash +poetry install +``` + +```bash +poetry env info # Optional: copy the interpreter path to use in your IDE (e.g. Cursor, VSCode, etc.) +``` + +```bash +poetry run dev +``` + +## Run workflows + +### from UI + +You can run workflows from the UI by clicking the "Run" button. + +![Run workflows from UI](./screenshot-quickstart.png) + +### from API + +You can run workflows from the API by using the generated endpoint: + +`POST http://localhost:6233/api/workflows/GreetingWorkflow` + +### from any client + +You can run workflows with any client connected to Restack, for example: + +```bash +poetry run schedule +``` + +executes `schedule_workflow.py` which will connect to Restack and execute the `GreetingWorkflow` workflow. + +## Deploy on Restack Cloud + +To deploy the application on Restack, you can create an account at [https://console.restack.io](https://console.restack.io) diff --git a/get_started/pyproject.toml b/quickstart/pyproject.toml similarity index 73% rename from get_started/pyproject.toml rename to quickstart/pyproject.toml index 4cfcb3d2..e16c9b98 100644 --- a/get_started/pyproject.toml +++ b/quickstart/pyproject.toml @@ -1,8 +1,8 @@ # Project metadata [tool.poetry] -name = "get_started" +name = "quickstart" version = "0.0.1" -description = "A simple example to get started with the restack-ai SDK" +description = "A quickstart for Restack" authors = [ "Restack Team ", ] @@ -11,13 +11,11 @@ packages = [{include = "src"}] [tool.poetry.dependencies] python = ">=3.10,<4.0" -restack-ai = "^0.0.48" watchfiles = "^1.0.0" - -[tool.poetry.dev-dependencies] -pytest = "6.2" # Optional: Add if you want to include tests in your example +pydantic = "^2.10.4" # Build system configuration +restack-ai = "^0.0.51" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/get_started/schedule_calendar.py b/quickstart/schedule_calendar.py similarity index 86% rename from get_started/schedule_calendar.py rename to quickstart/schedule_calendar.py index 9d52b575..61bffa83 100644 --- a/get_started/schedule_calendar.py +++ b/quickstart/schedule_calendar.py @@ -2,7 +2,7 @@ import time from restack_ai import Restack from restack_ai.restack import ScheduleSpec, ScheduleCalendarSpec, ScheduleRange - +from src.workflows.workflow import GreetingWorkflowInput async def main(): client = Restack() @@ -11,6 +11,7 @@ async def main(): await client.schedule_workflow( workflow_name="GreetingWorkflow", workflow_id=workflow_id, + input=GreetingWorkflowInput(name="Bob"), schedule=ScheduleSpec( calendars=[ScheduleCalendarSpec( day_of_week=[ScheduleRange(start=1)], diff --git a/get_started/schedule_interval.py b/quickstart/schedule_interval.py similarity index 85% rename from get_started/schedule_interval.py rename to quickstart/schedule_interval.py index 50d21e56..9830f876 100644 --- a/get_started/schedule_interval.py +++ b/quickstart/schedule_interval.py @@ -3,7 +3,7 @@ from restack_ai import Restack from restack_ai.restack import ScheduleSpec, ScheduleIntervalSpec from datetime import timedelta - +from src.workflows.workflow import GreetingWorkflowInput async def main(): client = Restack() @@ -12,6 +12,7 @@ async def main(): await client.schedule_workflow( workflow_name="GreetingWorkflow", workflow_id=workflow_id, + input=GreetingWorkflowInput(name="Bob"), schedule=ScheduleSpec( intervals=[ScheduleIntervalSpec( every=timedelta(minutes=10) diff --git a/get_started/schedule_workflow.py b/quickstart/schedule_workflow.py similarity index 77% rename from get_started/schedule_workflow.py rename to quickstart/schedule_workflow.py index e808eec2..36829152 100644 --- a/get_started/schedule_workflow.py +++ b/quickstart/schedule_workflow.py @@ -1,7 +1,7 @@ import asyncio import time from restack_ai import Restack - +from src.workflows.workflow import GreetingWorkflowInput async def main(): client = Restack() @@ -9,7 +9,8 @@ async def main(): workflow_id = f"{int(time.time() * 1000)}-GreetingWorkflow" run_id = await client.schedule_workflow( workflow_name="GreetingWorkflow", - workflow_id=workflow_id + workflow_id=workflow_id, + input=GreetingWorkflowInput(name="Bob") ) await client.get_workflow_result( diff --git a/get_started/src/__init__.py b/quickstart/src/__init__.py similarity index 100% rename from get_started/src/__init__.py rename to quickstart/src/__init__.py diff --git a/quickstart/src/client.py b/quickstart/src/client.py new file mode 100644 index 00000000..6fbc2318 --- /dev/null +++ b/quickstart/src/client.py @@ -0,0 +1,18 @@ +import os +from restack_ai import Restack +from restack_ai.restack import CloudConnectionOptions +from dotenv import load_dotenv +# Load environment variables from a .env file +load_dotenv() + + +engine_id = os.getenv("RESTACK_ENGINE_ID") +address = os.getenv("RESTACK_ENGINE_ADDRESS") +api_key = os.getenv("RESTACK_ENGINE_API_KEY") + +connection_options = CloudConnectionOptions( + engine_id=engine_id, + address=address, + api_key=api_key, +) +client = Restack(connection_options) \ No newline at end of file diff --git a/get_started/src/functions/__init__.py b/quickstart/src/functions/__init__.py similarity index 100% rename from get_started/src/functions/__init__.py rename to quickstart/src/functions/__init__.py diff --git a/get_started/src/functions/function.py b/quickstart/src/functions/function.py similarity index 58% rename from get_started/src/functions/function.py rename to quickstart/src/functions/function.py index 355c0cdd..520a78dd 100644 --- a/get_started/src/functions/function.py +++ b/quickstart/src/functions/function.py @@ -1,10 +1,14 @@ from restack_ai.function import function, log +from pydantic import BaseModel + +class WelcomeInput(BaseModel): + name: str @function.defn() -async def welcome(input: str) -> str: +async def welcome(input: WelcomeInput) -> str: try: log.info("welcome function started", input=input) - return f"Hello, {input}!" + return f"Hello, {input.name}!" except Exception as e: log.error("welcome function failed", error=e) raise e diff --git a/quickstart/src/quickstart.egg-info/PKG-INFO b/quickstart/src/quickstart.egg-info/PKG-INFO new file mode 100644 index 00000000..27375a2a --- /dev/null +++ b/quickstart/src/quickstart.egg-info/PKG-INFO @@ -0,0 +1,65 @@ +Metadata-Version: 2.1 +Name: quickstart +Version: 0.0.1 +Summary: Quickstart for Restack AI +Requires-Python: >=3.10 +Description-Content-Type: text/markdown +Requires-Dist: pydantic>=2.10.4 +Requires-Dist: restack-ai>=0.0.51 +Requires-Dist: watchfiles>=1.0.3 + +# Restack AI - Quickstart + +This repository contains a quickstart for Restack. +It demonstrates how to set up a basic workflow and functions. + +## Prerequisites + +- Docker (for running Restack) +- Python 3.10 or higher + +## Start Restack + +To start the Restack, use the following Docker command: + +```bash +docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` + +## Install dependencies and start services + +```bash +pip install -r requirements.txt +``` + +```bash +python -m src.services +``` + +## Run workflows + +### from UI + +You can run workflows from the UI by clicking the "Run" button. + +![Run workflows from UI](./screenshot-quickstart.png) + +### from API + +You can run workflows from the API by using the generated endpoint: + +`POST http://localhost:6233/api/workflows/greetingWorkflow` + +### from any client + +You can run workflows with any client connected to Restack, for example: + +```bash +python -m schedule_workflow +``` + +executes `schedule_workflow.py` which will connect to Restack and execute the `greetingWorkflow` workflow. + +## Deploy on Restack Cloud + +To deploy the application on Restack, you can create an account at [https://console.restack.io](https://console.restack.io) diff --git a/quickstart/src/quickstart.egg-info/SOURCES.txt b/quickstart/src/quickstart.egg-info/SOURCES.txt new file mode 100644 index 00000000..3febb5b5 --- /dev/null +++ b/quickstart/src/quickstart.egg-info/SOURCES.txt @@ -0,0 +1,15 @@ +README.md +pyproject.toml +src/__init__.py +src/client.py +src/services.py +src/functions/__init__.py +src/functions/function.py +src/quickstart.egg-info/PKG-INFO +src/quickstart.egg-info/SOURCES.txt +src/quickstart.egg-info/dependency_links.txt +src/quickstart.egg-info/entry_points.txt +src/quickstart.egg-info/requires.txt +src/quickstart.egg-info/top_level.txt +src/workflows/__init__.py +src/workflows/workflow.py \ No newline at end of file diff --git a/quickstart/src/quickstart.egg-info/dependency_links.txt b/quickstart/src/quickstart.egg-info/dependency_links.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/quickstart/src/quickstart.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/quickstart/src/quickstart.egg-info/entry_points.txt b/quickstart/src/quickstart.egg-info/entry_points.txt new file mode 100644 index 00000000..fecd0161 --- /dev/null +++ b/quickstart/src/quickstart.egg-info/entry_points.txt @@ -0,0 +1,6 @@ +[console_scripts] +calendar = schedule_calendar:run_schedule_calendar +dev = src.services:watch_services +interval = schedule_interval:run_schedule_interval +schedule = schedule_workflow:run_schedule_workflow +services = src.services:run_services diff --git a/quickstart/src/quickstart.egg-info/requires.txt b/quickstart/src/quickstart.egg-info/requires.txt new file mode 100644 index 00000000..27102c26 --- /dev/null +++ b/quickstart/src/quickstart.egg-info/requires.txt @@ -0,0 +1,3 @@ +pydantic>=2.10.4 +restack-ai>=0.0.51 +watchfiles>=1.0.3 diff --git a/quickstart/src/quickstart.egg-info/top_level.txt b/quickstart/src/quickstart.egg-info/top_level.txt new file mode 100644 index 00000000..0070d143 --- /dev/null +++ b/quickstart/src/quickstart.egg-info/top_level.txt @@ -0,0 +1,5 @@ +__init__ +client +functions +services +workflows diff --git a/get_started/src/services.py b/quickstart/src/services.py similarity index 81% rename from get_started/src/services.py rename to quickstart/src/services.py index e96cc92b..dcf6b497 100644 --- a/get_started/src/services.py +++ b/quickstart/src/services.py @@ -3,12 +3,16 @@ from src.functions.function import welcome from src.client import client from src.workflows.workflow import GreetingWorkflow +from restack_ai.restack import ServiceOptions from watchfiles import run_process async def main(): await client.start_service( workflows=[GreetingWorkflow], - functions=[welcome] + functions=[welcome], + options=ServiceOptions( + endpoints=True + ) ) def run_services(): diff --git a/get_started/src/workflows/__init__.py b/quickstart/src/workflows/__init__.py similarity index 100% rename from get_started/src/workflows/__init__.py rename to quickstart/src/workflows/__init__.py diff --git a/quickstart/src/workflows/workflow.py b/quickstart/src/workflows/workflow.py new file mode 100644 index 00000000..a42b9684 --- /dev/null +++ b/quickstart/src/workflows/workflow.py @@ -0,0 +1,19 @@ +from datetime import timedelta +from pydantic import BaseModel, Field +from restack_ai.workflow import workflow, import_functions, log +with import_functions(): + from src.functions.function import welcome, WelcomeInput + +class GreetingWorkflowInput(BaseModel): + name: str = Field(default='Bob') + +@workflow.defn() +class GreetingWorkflow: + @workflow.run + async def run(self, input: GreetingWorkflowInput): + log.info("GreetingWorkflow started") + result = await workflow.step(welcome, input=WelcomeInput(name=input.name), start_to_close_timeout=timedelta(seconds=120)) + log.info("GreetingWorkflow completed", result=result) + return result + + From 28dd8bce99192cdcd5340a7da84a0abca1f9d68b Mon Sep 17 00:00:00 2001 From: aboutphilippe Date: Mon, 6 Jan 2025 14:12:33 -0800 Subject: [PATCH 2/4] endpoints is default --- quickstart/pyproject.toml | 2 +- quickstart/src/services.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/quickstart/pyproject.toml b/quickstart/pyproject.toml index e16c9b98..f19911b1 100644 --- a/quickstart/pyproject.toml +++ b/quickstart/pyproject.toml @@ -15,7 +15,7 @@ watchfiles = "^1.0.0" pydantic = "^2.10.4" # Build system configuration -restack-ai = "^0.0.51" +restack-ai = "^0.0.52" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/quickstart/src/services.py b/quickstart/src/services.py index dcf6b497..e96cc92b 100644 --- a/quickstart/src/services.py +++ b/quickstart/src/services.py @@ -3,16 +3,12 @@ from src.functions.function import welcome from src.client import client from src.workflows.workflow import GreetingWorkflow -from restack_ai.restack import ServiceOptions from watchfiles import run_process async def main(): await client.start_service( workflows=[GreetingWorkflow], - functions=[welcome], - options=ServiceOptions( - endpoints=True - ) + functions=[welcome] ) def run_services(): From 747c9a936939a97fab7a419a33b89e08cfc78635 Mon Sep 17 00:00:00 2001 From: aboutphilippe Date: Mon, 6 Jan 2025 14:16:52 -0800 Subject: [PATCH 3/4] undo --- pdf_pydantic/pyproject.toml | 2 +- pdf_pydantic/src/workflows/files.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdf_pydantic/pyproject.toml b/pdf_pydantic/pyproject.toml index d7c6cb06..81b98a99 100644 --- a/pdf_pydantic/pyproject.toml +++ b/pdf_pydantic/pyproject.toml @@ -19,7 +19,7 @@ numpy = "^2.2.0" pillow = "^11.0.0" pydantic = "^2.10.3" python-doctr = {extras = ["torch"], version = "^0.10.0"} -restack-ai = "0.0.49" +restack-ai = "0.0.48" [build-system] requires = ["poetry-core"] diff --git a/pdf_pydantic/src/workflows/files.py b/pdf_pydantic/src/workflows/files.py index 3e62850b..3ed3a3f6 100644 --- a/pdf_pydantic/src/workflows/files.py +++ b/pdf_pydantic/src/workflows/files.py @@ -1,12 +1,12 @@ from restack_ai.workflow import workflow, log, workflow_info from typing import List -from pydantic import BaseModel, Field +from pydantic import BaseModel import asyncio from .pdf import PdfWorkflow, PdfWorkflowInput class FilesWorkflowInput(BaseModel): - files: List[PdfWorkflowInput] = Field(None, file=True, description="Upload file") + files: List[PdfWorkflowInput] @workflow.defn() class FilesWorkflow: From 5d9f36d9ce75ef4427259e6beaa9c7553480be91 Mon Sep 17 00:00:00 2001 From: aboutphilippe Date: Mon, 6 Jan 2025 14:17:26 -0800 Subject: [PATCH 4/4] remove egg info --- quickstart/src/quickstart.egg-info/PKG-INFO | 65 ------------------- .../src/quickstart.egg-info/SOURCES.txt | 15 ----- .../quickstart.egg-info/dependency_links.txt | 1 - .../src/quickstart.egg-info/entry_points.txt | 6 -- .../src/quickstart.egg-info/requires.txt | 3 - .../src/quickstart.egg-info/top_level.txt | 5 -- 6 files changed, 95 deletions(-) delete mode 100644 quickstart/src/quickstart.egg-info/PKG-INFO delete mode 100644 quickstart/src/quickstart.egg-info/SOURCES.txt delete mode 100644 quickstart/src/quickstart.egg-info/dependency_links.txt delete mode 100644 quickstart/src/quickstart.egg-info/entry_points.txt delete mode 100644 quickstart/src/quickstart.egg-info/requires.txt delete mode 100644 quickstart/src/quickstart.egg-info/top_level.txt diff --git a/quickstart/src/quickstart.egg-info/PKG-INFO b/quickstart/src/quickstart.egg-info/PKG-INFO deleted file mode 100644 index 27375a2a..00000000 --- a/quickstart/src/quickstart.egg-info/PKG-INFO +++ /dev/null @@ -1,65 +0,0 @@ -Metadata-Version: 2.1 -Name: quickstart -Version: 0.0.1 -Summary: Quickstart for Restack AI -Requires-Python: >=3.10 -Description-Content-Type: text/markdown -Requires-Dist: pydantic>=2.10.4 -Requires-Dist: restack-ai>=0.0.51 -Requires-Dist: watchfiles>=1.0.3 - -# Restack AI - Quickstart - -This repository contains a quickstart for Restack. -It demonstrates how to set up a basic workflow and functions. - -## Prerequisites - -- Docker (for running Restack) -- Python 3.10 or higher - -## Start Restack - -To start the Restack, use the following Docker command: - -```bash -docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main -``` - -## Install dependencies and start services - -```bash -pip install -r requirements.txt -``` - -```bash -python -m src.services -``` - -## Run workflows - -### from UI - -You can run workflows from the UI by clicking the "Run" button. - -![Run workflows from UI](./screenshot-quickstart.png) - -### from API - -You can run workflows from the API by using the generated endpoint: - -`POST http://localhost:6233/api/workflows/greetingWorkflow` - -### from any client - -You can run workflows with any client connected to Restack, for example: - -```bash -python -m schedule_workflow -``` - -executes `schedule_workflow.py` which will connect to Restack and execute the `greetingWorkflow` workflow. - -## Deploy on Restack Cloud - -To deploy the application on Restack, you can create an account at [https://console.restack.io](https://console.restack.io) diff --git a/quickstart/src/quickstart.egg-info/SOURCES.txt b/quickstart/src/quickstart.egg-info/SOURCES.txt deleted file mode 100644 index 3febb5b5..00000000 --- a/quickstart/src/quickstart.egg-info/SOURCES.txt +++ /dev/null @@ -1,15 +0,0 @@ -README.md -pyproject.toml -src/__init__.py -src/client.py -src/services.py -src/functions/__init__.py -src/functions/function.py -src/quickstart.egg-info/PKG-INFO -src/quickstart.egg-info/SOURCES.txt -src/quickstart.egg-info/dependency_links.txt -src/quickstart.egg-info/entry_points.txt -src/quickstart.egg-info/requires.txt -src/quickstart.egg-info/top_level.txt -src/workflows/__init__.py -src/workflows/workflow.py \ No newline at end of file diff --git a/quickstart/src/quickstart.egg-info/dependency_links.txt b/quickstart/src/quickstart.egg-info/dependency_links.txt deleted file mode 100644 index 8b137891..00000000 --- a/quickstart/src/quickstart.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/quickstart/src/quickstart.egg-info/entry_points.txt b/quickstart/src/quickstart.egg-info/entry_points.txt deleted file mode 100644 index fecd0161..00000000 --- a/quickstart/src/quickstart.egg-info/entry_points.txt +++ /dev/null @@ -1,6 +0,0 @@ -[console_scripts] -calendar = schedule_calendar:run_schedule_calendar -dev = src.services:watch_services -interval = schedule_interval:run_schedule_interval -schedule = schedule_workflow:run_schedule_workflow -services = src.services:run_services diff --git a/quickstart/src/quickstart.egg-info/requires.txt b/quickstart/src/quickstart.egg-info/requires.txt deleted file mode 100644 index 27102c26..00000000 --- a/quickstart/src/quickstart.egg-info/requires.txt +++ /dev/null @@ -1,3 +0,0 @@ -pydantic>=2.10.4 -restack-ai>=0.0.51 -watchfiles>=1.0.3 diff --git a/quickstart/src/quickstart.egg-info/top_level.txt b/quickstart/src/quickstart.egg-info/top_level.txt deleted file mode 100644 index 0070d143..00000000 --- a/quickstart/src/quickstart.egg-info/top_level.txt +++ /dev/null @@ -1,5 +0,0 @@ -__init__ -client -functions -services -workflows