r/devops • • Sep 30 '20

Full CI/CD pipeline for degree's final assignment

Hi everyone!

This is my last semester from the university and I need to pick up a topic for the final assignment which will consist of 4 months of work and a remote defense.

Although I am finishing this online degree (in UE) I am a sysadmin with almost 10y of experience and I have little experience in Docker but know the full picture of how it works the "DevOps" world.

So, do you think that is too much to learn and do for someone who never touched Container Orchestrators, Service Mesh, CI/CD tools, etc. but have a solid experience in Linux/Windows, Network, Storage and Virtualization? The objective as the title says is to explain and create a full CI/CD pipeline even it's just as simple as some scripts but all the tools and tech involved I will have to provision and configure.

Edit:

I forgot to say that I have a full-time job and this is an online degree but that's only concerning from a time perspective (which I will need...)

The objective is not to program an entire app, is more to describe and show the entire process even the service is just a "Hello World" (but let's make it more complex than that lol).

So besides implementing a "simple" 3-tier app, then explaining and documenting technologies and processes is what I am trying to achieve.

In the end, I will have to show an environment where it works (a "demo" basically) and lots of questions will have to be answered in the remote defense for sure.

Eager to know your thoughts!

52 Upvotes

67 comments sorted by

52

u/ur_boy_skinny_penis Sep 30 '20

The objective as the title says is to explain and create a full CI/CD pipeline even it's just as simple as some scripts but all the tools and tech involved I will have to provision and configure.

This is achievable easily within a day or two by watching some youtube tutorials, spinning up some free-tier EC2 instances, and making some relatively simple configurations. I think the real question here is "how complex do you want the full pipeline to be?"

If you just wanna set up a simple pipeline to automate a code build, put together a container, and maybe work with some Docker Compose/Minikube orchestration, that's likely very achievable.

If you want some Enterprise-level monstrosity, it may be a bit much to learn all at once. That being said, four months seems like enough time to learn a decent amount of the concepts and put together a respectable pipeline to me.

2

u/itgaiden Oct 01 '20

Thanks for your thoughts man.

Yes, I understand what you say but I want a simpler pipeline where I can show the entire process with all the technology, processes, and other things involved.

Something like an enterprise-level I think it could be complicated for me but not only for the complexity but for the time... Combining a full-time job with this will make it quite complicated as all of this is "new" to me because I've never implemented most of the things but we will see.

1

u/malice2525 Oct 09 '20

Do you have any resources for any of these enterprise level projects ?

15

u/[deleted] Sep 30 '20

Totally doable.

My suggestion would be to start super small and document each step in improvement.

Like step 1 could be running docker build on your laptop. Cool. Step 2 is a CI tool building the image and pushing it somewhere. Then introduce the concepts of tests. All the way to automatic tests with commit and deploys etc.

Will make the whole process more impressive to see and understand to see the DevOps lifecycle.

1

u/itgaiden Oct 01 '20

Like it.

More or less that's what I thought to do, documenting each step, techs and processes involved, etc.

The goal is to present the whole "DevOps" lifecycle within this project without doing a super application and that would be a great approach.

I appreciate your thoughts

6

u/neekz0r Sep 30 '20

Absolutely doable!

You need not use docker to accomplish CI/CD, but it certainly helps and is in line with modern practices.

My advise would be to just get a simple CI/CD going first, and then integrate docker -- this also has the benefit of a more "natural" path that a lot of companies are at.

That is to say, they already have a CI/CD system (of sorts) in place but would like to move towards docker.

1

u/itgaiden Oct 01 '20

Yes, the goal is going simple by documenting processes, techs involved.

Thought about Docker because you probably know is the standard for containers.

Thanks!

4

u/asheriff91 Sep 30 '20

No, I don’t think it’s too much to learn how to build a CI/CD pipeline given your experience. I would look into tools like Github Actions, terraform, python, and some cloud. Maybe create a CI/CD for a simple python function.

1

u/itgaiden Oct 01 '20

Thank you, something "simple" is the goal, and by documenting everything the way to show it in the project and the later remote defense.

3

u/[deleted] Sep 30 '20

This question is equivalent to how much effort would it take to write a web app with no prior experience?

Well... depends on the web app. Single hello world page? Or are we talking product worthy fullstack web app with a responsive UX?

CICD as a high level concept is really simple. It depends on what your definition of a "full" CICD pipeline is. Simple push to build test deploy will likely take only a day or two.

Large companies have many different concerns and processes for various reasons. All the complexity is around understand what these needs are and the various tradeoffs among all the different tools and approaches. How far along the spectrum do you want to go?

1

u/itgaiden Oct 01 '20

I got you.

I coded Java in the past but I was thinking of something simple but not a Hello World for sure haha.

So for me, what I am trying to achieve is to explain the whole lifecycle with all the processes and tech involved without being too involved in the code that is being used (although I would need to make something interesting to push).

Therefore, doing a "simple" 3-tier app for the whole process will be nice as I will keep all the focus on the other things I need to explain.

Thank you!

1

u/[deleted] Oct 01 '20

Again the "whole lifecycle" differs a lot for different companies and contexts.

Take for example testing. How much testing are you talking about here? Just run unit tests during a build is easy, but no enterprise running Java will only run that... How about integration tests? Maybe E2E tests with a database rebased from production? UI tests? If you have a mobile presence (highly likely these days) then multi-device or even multi-browser compatibility tests.... what about performance or scalability tests? How resilient is your app? Do you need to destructive testing to test failover? Don't even get me started with the acronym soup world of security testing...so yeah it can get really complex real fast.

Tech companies have varying degrees and combinations of all of these processes in their CICD flows. It will also depend heavily on the regulatory or compliance landscape of their domain as well. Some of these steps have entire teams dedicated to maintaining the tooling and automation.

I think in order for you to scope it out clearly you need to figure out what phases or steps are in the typical software development lifecycle process for the complexity level you are targeting. Start with a real world company example and try to break it down depending on their domain.

1

u/itgaiden Oct 01 '20

Thanks again for your notes. Well, can be complicated to break down as I am not aware of many things that developers do or are involved (like the many different types of testings). So, yes, I'll need to figure it out but I am not going to complicate myself on the app it self and I will focus more on the rest of the tools/techs/infra needed.

3

u/DsZidan Oct 01 '20

Preety doable. Check this repo https://github.com/alehpineda/fastapi_test Python API using fastapi, code check, unit test, ci/cd using github actions, deploy to heroku.

1

u/itgaiden Oct 01 '20

Interesting, another to take into account bus using github actions seems the way to go (as I already expected!)

3

u/sathyabhat Oct 01 '20

You can check my sample repo on a end to end CI/CD flow https://github.com/SathyaBhat/devops-workflow

Using something like this should be m possible to complete the objective in few hours

1

u/itgaiden Oct 01 '20

Wow, thanks for sharing this. I'll have to make my own but this would become helpful for sure ;)

4

u/ricksebak Oct 01 '20

4 months of work? You could deploy something like this in only a few minutes: https://github.com/awslabs/ecs-refarch-continuous-deployment

1

u/itgaiden Oct 01 '20

haha thanks for sharing but I have to make something on my own! Anyway I'll keep an eye on this.

2

u/[deleted] Oct 01 '20

You can do it. Trust me.

2

u/itgaiden Oct 01 '20

Thanks, people will think that you're reply is useless but it's not ;)

2

u/guterz Oct 01 '20

Gitlab with their free runners / free tier AWS account / Terraform building a simple lamp stack in AWS using the shared Gitlab runners. Totally free and super simple (by simple I mean ample documentation for all services).

2

u/itgaiden Oct 01 '20

Thanks for sharing. Something like that sounds nice. I was thinking already in AWS stack so it makes sense what you say.

3

u/halcyon918 Oct 01 '20

This. Gitlab makes this trivial. Throw in cloud formation on aws to deploy to ECS. Super easy. Then get fancy and throw in test coverage and other quality gates.

Just remember to also tear down what you build. In gitlab you can schedule a pipeline to run which you can use to ensure your resources are destroyed.

2

u/Thats_just_excessive Oct 01 '20

Depends on how complex you want it.

I’ve run two pipelines at an enterprise level. Some needs are more complex than others.

Simple project?

  • Build

  • Test

  • Scan

  • Release (package)

  • Deploy

Complex project? Ask yourselves the questions - Continuous deployment vs Continuous delivery? Cloud vs VM? Where will it deploy? How much resiliency do you need (see k8s replicasets)? Is it globally distributed? How secure should it be? How much validation is required? Canary or blue green deployments needed?

The list goes on. I wouldn’t say answer all of those questions, but for your own sake (it’s your education, make it worthwhile) be able to answer at least some of them. Never hurts to know more things :)

2

u/itgaiden Oct 01 '20

Well something in between. Not that simple but I don't need something globally distributed, not mentioning all the security things but trying to cover almost everything... It's already hard to decide what to exactly do but thanks, really appreciate this!

1

u/skat_in_the_hat Oct 01 '20

write some code, put it in an rpm, build it with jenkins, and push it to prod.

1

u/itgaiden Oct 01 '20

Seriously that would be the basic but more resilient code you can make haha

1

u/skat_in_the_hat Oct 01 '20

The devil is in the details.

  • Make jenkins use docker containers as build slaves.

  • Use chef-solo to deploy the jenkins server, and feed it in via cloud-init.

  • Use groovy templates to create a seed job that creates all of your other jobs.

  • Make a jenkins job to use a docker file to generate your build slave container image.

1

u/itgaiden Oct 01 '20

Aware of 1st and 4th but not the other ones, thanks!

1

u/[deleted] Oct 01 '20 edited Oct 01 '20

About a year ago, I had to do a case study, java restful app (springboot) that wrote something to a dB, 2 microservices. Using gradle, new aws infrastructure, aws eks, aws rds, helm, Jenkins, docker, teraform, elk stack, nexus. It took me about a day and half to do in total.

This is a pretty typical Ci CD pipeline these days.

So that's about 8 technologies , so about 1 1/2 weeks to learn each tech. Do able, yes, but it's gonna be hard.

Remember to sign up for some free aws credit, but watch out for the cluster costs, if ur using more than 2 ec2 container for ur cluster, the cost can quicker add up

1

u/itgaiden Oct 01 '20

Nice tech summary! The worst for me will be to learn AWS stuff, I have managed AWS stuff in the past but years ago. Anyway, it will be a big commitment (and hard to keep with a full-time job) but that's why the final assignment is for. Thanks for insights and recommendations!

1

u/[deleted] Oct 01 '20

if your going to use terraform to provision your aws infrastrcutre/rds/eks, don't write it yourself, just use one of the modules, they're writtern by hashicorp themselves and will save you a load of time.

1

u/itgaiden Oct 01 '20

I was aware of that but thanks anyway!

1

u/SysRqREISUB Oct 01 '20

Definitely doable.

Keep in mind that you don't need a service mesh OR container orchestration to set up a CI/CD pipeline. I would guess that most organizations who have CD pipelines aren't using service meshes. Many aren't even using container orchestration.

If you understand how container orchestration and service meshes work, they'll make your job easier. It's a big time commitment (and it's worth taking IMO) but a tradeoff nonetheless.

1

u/itgaiden Oct 01 '20

Yes, combining a full-time job with this it will be a great commitment but seems the right way to get my self in the topic ;) Completely agree with Service Mesh although I know that it works really well and I wanted to make at least a mention. Btw, thanks for sharing your thoughts.

1

u/fear_the_future Oct 01 '20

This is hardly worthy of a final assignment. A week of work at most if you stick to well trodden ground.

1

u/itgaiden Oct 01 '20

yees, that's why I decided to do it. It's a challenging thing for me and way off my comfort zone but quite excited to do it ;)

1

u/fear_the_future Oct 01 '20

Don't underestimate yourself. With sysadmin experience it shouldn't be too hard to do. Mostly you just need to clone the gitops-istio repo on GitHub and provision a ECS cluster with Terraform.

1

u/itgaiden Oct 01 '20

In reality I am more "scared" of the thins I can miss and documenting the whole thing... I'll have fun doing it but not documenting every tool/tech/process. Lucky that there are many options now like you say ;)

1

u/therealkevinard Oct 01 '20

The trickiest bit may me selecting the tool. Aside from that, ci/cd tooling is generally approachable and very thoroughly documented. Virtually all of them have a quickstart page that will walk you through your first pipeline.

That's usage.

They also generally assume you're comfortable with containerization, so they'll often deliver or reference a docker-compose file. You should absolutely get familiar with that. Installing can sometimes be very complicated (especially with worker nodes involved), but docker-compose up -d is a breeze.

1

u/itgaiden Oct 01 '20

I have more or less an idea of what fits better but maybe I can be wrong but with the top ones there shouldn't be any issues (or just a few). haha thanks for that last recommendation;)

1

u/therealkevinard Oct 01 '20

FWIW: I'm using Concourse right now. While I _love it_ for what it is, I would absolutely not recommend for this assignment. (it's an amazing tool, but it has a big learning curve - it's a commitment lol)

1

u/itgaiden Oct 01 '20

I just googled it and wow, thanks for sharing it. I won't do it as you suggest as I think that there will be plenty of time to dedicate to all the other stuff!

1

u/therealkevinard Oct 01 '20

Sidebaring, I guess, but for future reference: what I love about Concourse. Literally any piece of code you can put in a docker image. Give it 1-3 of possible commands. Check = see if something changed since last time (this is the trigger for new actions). Get = find information (this is an input for something). Put = update something (this... It updates something)

Its core stuff is intentionally lean because it's so easy to customize - just 1-3 of 3 possible commands.

Can totally have it order pizza for you when you send a txt, or do a whole-home alarm clock in response to a 6:30 email. I WISH i could put the screenshot from their discourse convo earlier lol

(To reiterate, though: not for this assignment, but for the future lol)

1

u/itgaiden Oct 02 '20

haha you're really tempting me to dig more into this although I am a newbie in the topic! haha Thanks again!

1

u/Maghilvannan Editable Placeholder Flair Oct 01 '20

Hey can I be of any help,Iam too doing my UG .I have experience in circle CI and AWS and very eager to do a project related to devops

2

u/itgaiden Oct 01 '20

Good to know, thanks!

1

u/xelfer Oct 01 '20

Have you looked at AWS codestar? You can set up a cicd pipeline in that in about 3 clicks, it does it all for you.

I can even send you a tutorial video I made on how to do it if you're interested. :)

1

u/itgaiden Oct 01 '20

I appreciate it although I would like to create it from the scratch! Anyway is nice to know that thinks like that are already available so thanks.

1

u/xelfer Oct 01 '20

No problem! Will you use codepipeline? Otherwise you might want to read the Jenkins on AWS white paper

1

u/itgaiden Oct 01 '20

I don't know yet but I am "scared" about how difficult can be to setup correctly Jenkins even I am just putting a couple of things... For now I am writing the proposal but I am still looking for the correct tools without the implementation knowledge x)

2

u/xelfer Oct 01 '20

Ah cool :) If you can just use AWS services codepipeline/codebuild/codedeploy are fairly straightforward

1

u/anthr76 Oct 01 '20

This sounds fun. Curious where are you getting this degree from? I've been looking to go back to school

1

u/itgaiden Oct 01 '20

Well, this is an online university (University of Catalonia) which is quite nice and well known here in Spain :)

1

u/dexx4d Oct 01 '20

When I moved into DevOps, I set up a similar project in my public repo to deploy my Hugo-based website on git PR merge using Travis.

Even working full time as a software dev, and as a parent of two small kids, it took me about a week to get it built out - I spent more time on making the website pretty.

1

u/itgaiden Oct 01 '20

Haha, really nice insight! ;) Thanks for sharing!

1

u/yitsushi Oct 01 '20

It's totally realistic. For simple solution I may suggest gitea and drone. Both can work together nicely and easy to set up.

1

u/marcjpb Sep 30 '20

Could be a great topic but I would pick one part of the ci/cd and go in depth instead of covering everything barely.

Kinda like automatic testing or orchestration or docker image management etc.

1

u/itgaiden Oct 01 '20

Thanks! Yes the main problem is how much deep I want to go because it can become quite complicated (as far as I know) and consuming.

-2

u/grumpieroldman Oct 01 '20

My thoughts? Docker is a pos. Use LXD.

1

u/itgaiden Oct 01 '20

Oh, I thought that Podman was the next one to go x)

1

u/jumperabg golang and devops Oct 01 '20

What about Kata Containers?

1

u/itgaiden Oct 01 '20

Had to google it but seems interesting. thanks for that.

9

u/[deleted] Oct 01 '20 edited Oct 01 '20

[removed] — view removed comment

2

u/itgaiden Oct 01 '20

Really nice explanation, thanks!
Got the GitHub Education for some months so I still have many months left ;)

Regarding infra, maybe I will make it more complex but not too much because my goal is to present the whole lifecycle and not focusing too much on the technologies nor processes (when not needed) but explaining how they work together.

Those above stages are what I would like to figure it out and it would search for more.

Sure my Linkedin Profile is already completed for many years, maybe I forgot to say in the description that I am doing this online degree while having a full-time job haha.

Thanks again for your thoughts and recommendations!