# Monday notes ###### tags: `Daily update` `Meeting notes` ## AWS ECS and how to use it the equivalent of using GCP's containerized OS we can launch an instance [this way](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html) I checked that our vCPU limit is 64, above our req. ## RAID-10 / RAID-0 disk [I think each EBS gp2 disk has max of 1TB, so we need a RAID array.](https://stackoverflow.com/questions/11228318/postgres-distributing-data-across-multiple-disks) ## AWS technical support I contacted Sha'Ron, the in-depth sales rep about architecture designs: > I would love to seek technical advise from the AWS support team and learn more about setting up a proper architecture for our database service. > > Mainly our architecture requirements are: Running an EC2 node r5.8xlarge, 32 vCPU, 256G memory Attaching at least 2TB of gp2 persistent disk. (I am inexperienced but I wish to setup a RAID-0 to use all available disk for the timescaleDB. I am not sure if any additional configuration is needed) Running docker and multiple containers on that node. We are trying to run a modification of this open-source project https://github.com/filecoin-project/sentinel-visor/blob/master/docker-compose.yml and this project https://github.com/filecoin-project/lotus. I’m sure in the sure we may need to scale up and run multiple nodes with ECS, but for now, I think we just need 1 running EC2 node. > > What’s the collection of services that I should use? Personally I think I’m following this https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html. But I’d love to get more details on, for example, setting up RAID for disks, setting up containers. I am inexperienced in AWS and would appreciate your technical support. Since the card on AWS is not switched yet, I will use the GCP for further experiments Learning docker compose on [AWS](https://www.youtube.com/watch?v=nhqcecpi47s) ## GCP [Video tutorial](https://www.youtube.com/watch?v=GoOB8YoRSbA) This tutorial covers a lot of stuff that I don't understand.. * The container registry, what IAM role to add to access it? * the BIGGEST issue: he followed the docker django example, i don't have a timescaledb example. In visor github. HOWEVER, there is a `dockerfile`and `docker-compose.yml` in the Visor project. But, there is no `requirement.txt`, maybe that's ok. * the commands he ran i don't understand, what is `$PWD`? * A: `$PWD` outputs current dir. * What's all the `-v` mapping? I guess I'll copy from it directly. * which ports should my firewall whitelist? * 5432, 6831, 3000, 5778, 16686? Something went wrong. I'll try again soon. ## AWS docker compose YT [trying this out](https://www.youtube.com/watch?v=nhqcecpi47s) ## Sidetracked: detecting Angular memory leaks [Post](https://blog.bitsrc.io/debugging-memory-leaks-in-angular-4bc7b3eab569) # Tueday notes ## Retry GCP with the above tutorial Outcome TBC, temporarily on hold. ## Amazon sale's reponse > Thursday at 10:30am EST to discuss ## Amazon Activate is activated now > Welcome to the Activate Founders program! Your AWS credits have been approved, and as an Activate member, you also get access to exclusive offers, free training, resources, tools, and more. All of your benefits can be accessed via the AWS Activate Console, and are tied to the account that you used to apply. > >1) Track and monitor your AWS credits Your AWS credits have been added to your AWS Account and will automatically start to apply towards the cost of eligible AWS services. No action is required to redeem your credits. To view, track, and monitor your AWS credits including expiration dates, visit the AWS Activate Console. Please allow 3-4 days for your credits to appear. > >2) AWS Developer Support credits As an Activate member, you have been issued $350 USD in AWS Developer Support credits, valid one year. > >Redeem your AWS Developer Support credits Step #1 - first ensure you have a valid credit card associated with your AWS account. Step #2 - Next, choose “Select a Support Plan” on the AWS Developer Support page. This will enroll you into the AWS Developer Support plan. Please note the monthly fee is not covered by your free Developer Support credits. Step #3 - Once you have enrolled, you can start using your AWS Developer Support credits by opening a support case in the AWS Support Center. If your AWS Support credits have expired or been consumed, you will be unable to open a support case for free. Step #4 - You can then monitor and track your credit usage in the AWS Activate Console. > >3) Supporting startups through every step of their journey Discover personalized recommendations on topics spanning AWS services, technical training, building on AWS, startup programs and acquiring customers. We've curated content just for you based on your industry, product type, funding stage, interests in AWS services and tech topics, and your usage of AWS services. Get started today by completing your startup profile for the best Console experience. ## Amazon Experiments: The OG YT uses Elastic Beanstalk? It's not what we wanted. [New Search Results](https://www.youtube.com/results?search_query=aws+docker+database+containers I followed [this one](https://www.youtube.com/watch?v=hawFHY9DOoA) (A) # Wednesday ## Amazon continued Tutorial (A) mentions creating a docker context. After learning about it, i'm sure it's not a good tutorial. It doesn't mention configuring the EC2 instance. Trying this [tutorial](https://www.youtube.com/watch?v=zs3tyVgiBQQ) (B). But this doesn't mention docker compose. Plus it publishes the image to docker. We don't have any accounts registered Trying this [one](https://www.youtube.com/watch?v=FVNBdylX5po) This [old one](https://www.youtube.com/watch?v=nhqcecpi47s) uses Elastic Bean Stalk. Not right. This [tutorial](https://www.youtube.com/watch?v=bT_xXc7cOCQ) (C ) seems to be old-fashioned. This [tutorial](https://www.youtube.com/watch?v=awFLzy0XwXo) (D) also seems to do things manually. He created an EC2 instance, ssh-ed into it and installed docker cli, compose. Then ran docker-compose up. This [tutorial](https://www.youtube.com/watch?v=mbtU-5fXXiw) seems to be useful for me. But I'm not sure why no one watched it. This [High level explanation](https://www.youtube.com/watch?v=AYAh6YDXuho&t=267s) This [tutorial](https://www.youtube.com/watch?v=UU4-TB7vR8s). It immediately dived into Jenkins and have configurations I am not familar with. OK. After watching most of it, I realize it may be the most suitable tutorial to follow. We may want to setup Jenkins in the future, so we might as well do it now. (I want to watch some of his previous videos on Jenkins, configuring a Jenkins agent.) The issue with that video is that I cannot use his Jenkins file to orchestrate the docker integration with ECS because he is using a mac agent. And the keychain procedure is different for mac agents and linux agents. [See this Jenkins file](https://github.com/darinpope/java-web-app/blob/docker-compose/Jenkinsfile-2), the label on agent is `macos`. However, I do believe I can follow the manual way: `docker compose build`, `docker compose push --aws-credential ..` ### VPC In that tutorial, Daren already has a VPC setup. I need to follow a tutorial to set up a VPC. Trying this [tutorial](https://www.youtube.com/watch?v=z4qNETOFF9s) a part of this [set](https://www.youtube.com/playlist?list=PL34sAs7_26wMKAl2wcDXb7ko65V8KDBzG) * A VPC can have many AZs * Within an AZ, you can have many subnets * One VPC can either be a public or private subnet * With a VPC, Network ACL(access control list), Route Table and Internet Gateway is created * With a private subnet, a NAT gateway and NAT instance is also required * NAT is useful: private subnet instances still need to talk to the internet, even though not the other way around. For patching reasons. * Route table: a set of routes. How the instance reach the internet ## AWS support plan Maybe try the Developer plan for 40$ per month? We have $350 free. # Thurday update ## Running ECS directly per Tux's advice ![1](https://i.imgur.com/ikdoaRs.png) ![2](https://i.imgur.com/4QFOsSv.png) I do not understand how to set network mode to `Bridge`. So I still have to watch the VPC tutorials. ## helped git cherry pick files for deployed branches. Use `git checkout <from branch> <paths>...` ## how to choose Bridge network mode I need to specify different host and container port mappings? I think so.