Skip to content

Commit

Permalink
update docker deploy steps
Browse files Browse the repository at this point in the history
  • Loading branch information
akihikokuroda committed Jan 31, 2025
1 parent 37816b0 commit 1130df5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
7 changes: 4 additions & 3 deletions bee-hive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ python run_workflow workflow.yaml

* Build bee-hive container image: `./bee-hive.sh build` in bee-hive/bee-hive directory

* Deploy bee-hive: `./bee-hive.sh deploy BEE_API=http://xxx.xxx.xxx.xxx:4000 BEE_API_KEY=sk-proj-testkey`
* The required environment variables can be provided at the end of command argunets (e.g. `BEE_API=http://192.168.86.45:4000`).

* Prepare agent and workflow definition yaml files in the current directory (e.g. agent.yaml, workflow.yaml)

* Run workflow: `./bee-hive.sh run $PWD agents.yaml workflow.yaml BEE_API=http://xxx.xxx.xxx.xxx:4000 BEE_API_KEY=sk-proj-testkey`
* The required environment variables can be provided at the end of command argunets (e.g. `BEE_API=http://192.168.86.45:4000`).

* Run workflow: `./bee-hive.sh run agents.yaml workflow.yaml
24 changes: 14 additions & 10 deletions bee-hive/bee-hive.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#!/bin/sh

cmd=${CONTAINER_CMD:-docker}
if [ "$1" != "build" ] && [ "$1" != "run" ]; then
echo "Invalid argument. Must be 'build' or 'run'."
target=${TARGET_IP:-127.0.0.1:5000}
if [ "$1" != "build" ] && [ "$1" != "deploy" ] && [ "$1" != "run" ]; then
echo "Invalid argument. Must be 'build', 'deploy' or 'run'."
exit 1
fi

if [ "$1" == "build" ]; then
echo "Building..."
$cmd build -t bee-hive .
elif [ "$1" == "run" ]; then
echo "Running..."
path=$2
agents=$3
workflow=$4
elif [ "$1" == "deploy" ]; then
echo "Deploying..."
env=""
while [ "$5" != "" ]; do
env=$env" -e "$5" "
while [ "$2" != "" ]; do
env=$env" -e "$2" "
shift
done
$cmd run $env --mount type=bind,src=$path,target=/data bee-hive /data/$agents /data/$workflow
$cmd run -d $env -p $target:5000 bee-hive
elif [ "$1" == "run" ]; then
echo "Running..."
agents=$2
workflow=$3
curl -X POST -L http://$target/ -F "agents=@$agents" -F "workflow=@$workflow"
fi


Expand Down

0 comments on commit 1130df5

Please sign in to comment.