Skip to content

Commit

Permalink
Merge pull request openwallet-foundation#22 from baens/multiple-agents
Browse files Browse the repository at this point in the history
Add better ngrok waiting and multiple agents
  • Loading branch information
dbluhm authored Oct 15, 2019
2 parents 0b66f1c + 139eca8 commit 09d5713
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
8 changes: 2 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
version: '3'
version: "3"
services:
ngrok:
container_name: ngrok
image: wernight/ngrok
command: ngrok http agent:3000

command: ngrok http agent:3000 --log stdout
agent:
build: .
depends_on:
- ngrok
16 changes: 16 additions & 0 deletions docker-compose_multiple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3"
services:
ngrok-1:
image: wernight/ngrok
command: ngrok http agent-1:3000 --log stdout
agent-1:
build: .
environment:
NGROK_NAME: ngrok-1
ngrok-2:
image: wernight/ngrok
command: ngrok http agent-2:3000 --log stdout
agent-2:
build: .
environment:
NGROK_NAME: ngrok-2
21 changes: 20 additions & 1 deletion medici-startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
ENDPOINT=$(curl --silent ngrok:4040/api/tunnels | ./jq -r '.tunnels[0].public_url')
#!/bin/bash

NGROK_NAME=${NGROK_NAME:-ngrok}

echo "ngrok end point [$NGROK_NAME]"

ENDPOINT=null
while [ $ENDPOINT = "null" ]
do
echo "Fetching end point from ngrok service"
ENDPOINT=$(curl --silent $NGROK_NAME:4040/api/tunnels | ./jq -r '.tunnels[0].public_url')

if [ $ENDPOINT = "null" ]; then
echo "ngrok not ready, sleeping 5 seconds...."
sleep 5
fi

done

echo "fetched end point [$ENDPOINT]"

aca-py start \
-it http 0.0.0.0 3000 \
Expand Down

0 comments on commit 09d5713

Please sign in to comment.