Skip to content

Commit

Permalink
🔧 chore(main.tf): add label to a random worker node to ensure data vo…
Browse files Browse the repository at this point in the history
…lume is created

🔧 chore(main.tf): deploy the langflow_stack using docker stack
  • Loading branch information
jacquesmats committed Sep 12, 2023
1 parent 1ca8398 commit 4f6aeef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deploy/scripts/terraform/modules/docker-swarm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,20 @@ resource "aws_instance" "manager" {
echo 'docker swarm join-token worker -q' > get_token.sh
chmod +x get_token.sh
timeout 5m bash -c "while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; ./get_token.sh; } | nc -l 8080; done" &
sleep 10
# Clone the repo and start the stack
git clone https://github.com/logspace-ai/langflow.git
cd /langflow
git checkout celery
cd /langflow/deploy
sudo cp .env.example .env
# Add the label to random worker node to ensure that the data volume is created on the same node
docker node update --label-add app-db-data=true $(docker node ls --format '{{.Hostname}}' --filter role=worker | head -n 1)
env $(cat .env | grep ^[A-Z] | xargs) docker stack deploy --compose-file docker-compose.yml langflow_stack
EOT

Expand Down

0 comments on commit 4f6aeef

Please sign in to comment.