High level, the idea is:
- Create manager and worker boxes, with terrafrom.
- Provision docker swarm, registry, stackstorm, and do wiring, with ansible.
- Create auto-scaling group for worker nodes
-
Install Ansible and Terraform on a local machine.
-
Have AWS key pairs and access keys in place.
-
Put actual variables in
terraform/terraform.tfvars
(see.example
). -
Create AWS Route53 hosted zone, e.g.
example.net
. Put it in terraform/variables.tf -
Review other variables in
terraform/variables.tf
, create nessessary resources, and put their IDs as variables. -
Configure SSL on local machine for fun and profit:
Host *.example.net StrictHostKeyChecking no UserKnownHostsFile=/dev/null User root LogLevel ERROR
-
From local machine, run Terraform.
cd terraform terraform apply -var 'instance_type_manager=t2.medium' -var 'instance_type_worker=t2.medium' -var 'n_workers=2'
This will do quite a few things:
- Creates boxes with
data
andshare
storage mounted under/mnt
. - Create DNS records for
st2.example.net
,node1.example.net
, etc. - Run ansible to provision Docker, Swarm, and Stackstorm exactly like on Vagrant. At this point we have an enviromnent identical to local dev.
- Create an auto-scaling group, using a snapshot of
node1.example.net
worker an AMI, so that all is already provisioned for fast hot-create. When auto-scaling group scales out, worker nodes automatically join the Swarm.
- Creates boxes with
-
Run
wordcount
example.cd /faas/functions/wordcount ./docker-build.sh
Ensure that it goes to the right repository (
pregistry:5000
)Run the action:
st2 run -a pipeline.wordcount \ input_file=/share/loremipsum.txt \ result_filename=loremipsum.res \ parallels=4 delay=30
-
Run
fgenesb
example.Add proprietary softberry components:
cp -r /mnt/data/softberry/* /faas/functions/softberry
Build docker images:
cd /faas/functions/softberry/ ./docker_build.sh
Run the
findgenesb
worklfow:st2 run -a pipeline.findgenesb input_file=/share/test.seq \ min_len=150 result_filename=result.result parallels=4