AWS Marketplace
Step1
- Go to https://console.aws.com
- Create a new ec2 instance
- In the search box type cirruswave
- Select CirrusWave-Enterprise and click on select
Step2
- Select the vpc, region, storage etc.
- Either use an existing security group or create new security groups with ports 8080, 9090 which are the application microservices you will be creating, ports needed for the system services keymgr, connector and workflow 4003, 4007, and 4004
- Click launch the instance
- If you have a key already created, you can add that here
- Or you can create new key
- Make sure you down load the key and save it securely
- This key is necessary for you to be access the machine using ssh
Step3
Connect to the CirrusWave machine
| ssh -i [path to the pemfile] ubuntu@[ip of the machine] | When the machine is ready, note the ip of the machine, path to the pem file where ssh key is stored |
Step4
Prepare for SampleProject
| cd /tmp | replace '/tmp' with the directory you want your project in |
- Open the ports 9999,4001-4010 for the machine ( Use the security groups to manage the right ports to be enabled for access)
Step5
Create two microservices and test
| cirruswave -g -t newproject | give a name for project if different from default value SampleProject |
| cd SampleProject | replace 'SampleProject' with the name of the your project |
| cirruswave -g -t addnewservice | give a nmae for new service and the port if different from default |
| node newservice_index.js | replace 'newservice' with the service name you chose in the previous step |
| Go to a browser and verify that you can access the url https://[ip of the machine]:9999/test | replace 9999 with the port you choose and also make sure the port is open in the security group |
- You will be able to test the routes that are created. The default routes simply echo the request url parameters and request body
Step6
Create AWS ECR repository
- Go to ECR and create a repository
- Pick a name for your repository and create repository
- Copy the uri for later use in ecr.json
Get contaier regsistry credentials
- install aws cli. Follow the instructions in this url https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
- Go to Identity and Access Management (IAM) service
- create a user in console.aws.amazon.com/iam called AdminProg (programmable user not console)
- Add to Admin group
- Create user
- Go to credentials tab and create access key. Donwload the access and secret keys. (Keep these in a secure place)
- run aws configure
- AWS Access Key ID [None]: accesskey
- AWS Secret Access Key [None]: secretkey
- Default region name [None]: us-west-2
- Default output format [None]: json
- the instructions for doing this are in this url https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
- aws ecr get-login-password
- update the ecr.json as shown below
{
"registryname":"repositoryuri",
"username":"AWS",
"password":"accestoken"
}
Step7
Create S3 account for storage
- Create s3 account
- Create a bucket
- Make sure you get the credentials for the s3 account as this will be used to configure the system services
Step8
Configure CirrusWave system services
| cirruswave -g -t workflow | Configure the Workflow Service |
| cirruswave -g -t keymgr | Configure the Key Manager Service |
| cirruswave -g -t connector -z azblob | Configure the Connector Service as appropriate for your project. If the connections are different for each environment you will get the opportunity to set them up as well |
- Note you can create muktiple connections for different data soures like [ s3, azblob, mssql, pgsql, mysql, snowflake, azcosmosdb, n4jsvc, esservice, rabbitmq, wsoc, jira, sftp, ftp, email]
Step9
Create a default local working environment
- Generate all the scripts necessary to launch your microservices locally
| cirruswave -g -t runallscripts -j appserviceconfig.json | Generate all the scripts necessary to launch containers locally |
| bash launchscripts/runallservices.sh | Run the scripts locally |
- Note - ctrl+c will kill all of them
Step10
Containerize your microservices and test locally
| cirruswave -g -t deploymentscripts -j appserviceconfig.json | Initialize your deployment scripts for the project (this only needs to be done once) |
| bash launchscripts/buildcontainer.sh | Create images, push them to container registry |
| bash launchscripts/runcontainerlocal.sh | pull images from container registry and run them locally |
Step11
Create remote machines for each environment
| mkdir ~/certs | create a directory to store the ssh credentials to access the remote machines |
- follow step1 and step2 to create virutal machines for each environment
- Copy the .pem file for each virtual machine for each environment to ~/certs directory
Step12
Configure deployment environments e.g. typical project might contain dev, test, and prod environments. For each deployment environment, create scripts to build docker images and run docker containers.The following commands setup 'test' deployment environment
| cirruswave -g -t createdeploymentmode -j appserviceconfig.json -m test | creates mode test and sets the mode ready for buildcontainer and runcontainer |
| cirruswave -g -t setmode -j appserviceconfig.json -m test | set current mode to test |
| bash launchscripts/buildcontainer.sh –m test | generate deploymentconfig, build docker images and push them to the container registry |
| bash launchscripts/runcontainerremote.sh –m test | Pull the docker images and deploy the containers to the test environment machine |