devops

2015-08-25T21:40:02.000006Z

I'd like to get an uberjar deployed to an EC2 instance and switched over with minimal/zero downtime. I am hoping to enjoy something that feels as automated as possible and not writing java -jar uberjar.jar every time--like how capistrano or flightplan works in other languages/environments. I have nginx running in front of the jar and I'm thinking of how to juggle different ports and use proxy_port to get it done but that's also messy.

2015-08-25T21:40:43.000007Z

Naturally it would shut down the old one once the new one is up. And on reboot restart the right jar.

2015-08-25T21:41:07.000008Z

Do I just need to start writing bash scripts or daemon scripts to make that sort of behavior?

markmandel 2015-08-25T21:41:09.000009Z

@tom - 3 questions (1) How are you deploying now? Do you use any particular tools? (2) How many machines do you have? (3) Do you have a load balancer?

2015-08-25T21:42:34.000010Z

@markmandel: 1) Publish over SSH with jenkins to get the jar sent over, then log in to do the java -jar command, switch port and restart nginx (or moving thing off the ELB depending on the service I'm deploying). 2) It varies, 6-10. 3) Si

markmandel 2015-08-25T21:43:10.000011Z

1) Sounds like a great job for ansible

markmandel 2015-08-25T21:43:36.000012Z

2) Why not just take the machines out of the load balancer, deploy, and then put it back in - no downtime

markmandel 2015-08-25T21:43:48.000013Z

If you have that many machines

2015-08-25T21:46:06.000014Z

1) Just use ansible to restart nginx and start/stop the jars? that actually would probably work very well. 2) True, I'm just lazy I guess and spoiled from other dynamic and interpreted languages where you change a file and it's done haha, I guess it won't kill me to just move things around the load balancer each deployment.

markmandel 2015-08-25T21:47:16.000015Z

It just feels like a more complicated problem otherwise

markmandel 2015-08-25T21:47:32.000016Z

and you could use ansible to do the rolling deploy

markmandel 2015-08-25T21:47:56.000017Z

the only other thought I had - deploy them out to each machine, but have it run on a different port

markmandel 2015-08-25T21:48:05.000018Z

then configure the load balancer to switch to the new port in one go

markmandel 2015-08-25T21:48:44.000019Z

but that could go wrong a lot faster than a rolling deploy - you can health check as you go, and if it fails, stop and rollback

markmandel 2015-08-25T21:48:51.000020Z

and still no downtime

2015-08-25T21:49:38.000021Z

sure

markmandel 2015-08-25T21:49:38.000022Z

either that - or run on a service that manages all this stuff for you 😉

2015-08-25T21:50:21.000023Z

Move off aws? I'm not that powerful lol thanks for the insight!

markmandel 2015-08-25T21:50:31.000024Z

Heh no worries

markmandel 2015-08-25T21:51:04.000025Z

It may be worth eventually exploring the docker world - just because this type of thing becomes commoditized

lowl4tency 2015-08-25T21:51:51.000026Z

I recommend to take a look on CodeDeploy

2015-08-25T21:51:56.000027Z

I'll look into it. I used to use vagrant+puppet a long time ago but haven't had much of a chance to look into docker. Dockers runs on top of a Vagrant machine?

2015-08-25T21:52:21.000029Z

@lowl4tency: just google CodeDeploy?

lowl4tency 2015-08-25T21:52:25.000030Z

I deploy my jars from CircleCI via CodeDeploy

lowl4tency 2015-08-25T21:52:33.000031Z

tom: AWS CodeDeploy

2015-08-25T21:52:35.000032Z

well shit it's aws

2015-08-25T21:52:36.000033Z

lol

2015-08-25T21:52:46.000034Z

nice

lowl4tency 2015-08-25T21:53:23.000037Z

From your message >I'd like to get an uberjar deployed to an EC2 instance If you are using AWS using AWS’s services is good

2015-08-25T21:53:57.000038Z

makes sense, I'll look into that as well.

lowl4tency 2015-08-25T21:54:38.000039Z

tom: it works good in bundle with ELB, EC2 and AutoScaling.

lowl4tency 2015-08-25T21:55:06.000040Z

CircleCI has integration with CodeDeploy as well

2015-08-25T21:55:46.000041Z

ok cool

markmandel 2015-08-25T21:55:53.000042Z

Yeah sorry - I don't know AWS' services that well :simple_smile:

lowl4tency 2015-08-25T21:56:16.000043Z

I have been working with AWS services about 3 month

lowl4tency 2015-08-25T21:57:12.000044Z

Really best service :simple_smile:

lowl4tency 2015-08-25T21:58:45.000045Z

I extremely recommend use AWS services such RDS, Cloudformation, ElastiCache, CodeDeploy and anther instead 3d-party and own solutions

2015-08-25T21:59:23.000046Z

ok, I'll look into those. I've been using some of their other services but not as much with devops sort of things.

lowl4tency 2015-08-25T22:00:50.000047Z

tom: I highly recommend take a look on describing of all services by AWS :simple_smile:

lowl4tency 2015-08-25T22:01:28.000048Z

I’m periodically do it again and again. For example I’m waiting when AWS implement support CircleCI for CodePipeline :simple_smile:

lowl4tency 2015-08-25T22:01:43.000049Z

At the moment it supports only Jenkins as build provider 😞

2015-08-25T22:02:56.000050Z

nice, they have a lot of services

lowl4tency 2015-08-25T22:03:24.000051Z

It’s true :simple_smile:

lowl4tency 2015-08-25T22:03:41.000052Z

Lambda is awesome service as well

lowl4tency 2015-08-25T22:03:56.000053Z

Unfortunately I have not a case for this yet

lowl4tency 2015-08-25T22:04:14.000054Z

Lambda is able to run clojure code

2015-08-25T22:05:01.000055Z

that's awesome, I tried to use lambda but it wasn't available in one of the regions I needed it. One of these days.

lowl4tency 2015-08-25T22:05:29.000056Z

tom: yes, aws usually starts a service for one region

lowl4tency 2015-08-25T22:05:54.000057Z

Virginia or Oregon are first as rule

lowl4tency 2015-08-25T22:07:16.000058Z

Also, I use boto3 (A python3 library) by AWS

lowl4tency 2015-08-25T22:07:26.000059Z

Pretty good as well

lowl4tency 2015-08-25T22:10:21.000060Z

tom: feel free to ask questions about AWS :simple_smile:

2015-08-25T22:11:01.000061Z

I will haha, just reading on codepipeline. Do you work with docker at all?

lowl4tency 2015-08-25T22:11:25.000062Z

tom: actually I use simple ec2 servers

lowl4tency 2015-08-25T22:11:43.000063Z

tom: and if you use docker I can recommend to take a look on ECS

lowl4tency 2015-08-25T22:12:53.000065Z

I don’t see any benefits from docker for my projects at the moment but in future it’s possible I guess

lowl4tency 2015-08-25T22:13:34.000066Z

And docker brings additional questions about managing and orchestration of the containers

markmandel 2015-08-25T22:37:49.000068Z

kuberntes 😉

markmandel 2015-08-25T22:38:15.000069Z

But yes it does - but there is so much tooling around docker containers, the ecosystem is just getting better and better

markmandel 2015-08-25T22:38:22.000070Z

but if it doesn't suit your needs yet - makes sense too

markmandel 2015-08-25T22:43:54.000071Z

I'm waaaay down the docker hole these days 😉 so take it all with a grain of salt

2015-08-25T22:44:58.000072Z

I cannot find any good beginner guides that (dummies level) to get started with it. If I'm on windows, would I start a VM (like with vagrant) and connect docker to that?

markmandel 2015-08-25T22:45:21.000073Z

boot2docker will be your friend

markmandel 2015-08-25T22:45:28.000074Z

but I'm not a windows user (Linux all the way down)

markmandel 2015-08-25T22:45:36.000075Z

http://boot2docker.io/

markmandel 2015-08-25T22:46:03.000076Z

I found this docker book really good: http://www.amazon.com/Docker-Book-Containerization-new-virtualization-ebook/dp/B00LRROTI4/

markmandel 2015-08-25T22:46:39.000078Z

I haven't read it, but http://www.amazon.com/Docker-Up-Running-Karl-Matthias-ebook/dp/B00ZGRS4XM/ came out recently as well

2015-08-25T22:50:28.000080Z

@markmandel: thanks!

markmandel 2015-08-25T22:53:23.000082Z

Np!

lowl4tency 2015-08-25T23:37:44.000084Z

markmandel: agreed

markmandel 2015-08-25T23:39:37.000085Z

I have to be honest, I don't know many Windows developers anymore. Unfortunately, I think you often get the short end of the stick