## Environment, Deployments, Caching, Logging
#### What you wanted to know but never dare to ask
2 Oct. 2019
---
### Disclaimers
---
### Disclaimer #1
We all know there's this untold agreement of not reading the documentation.
However, Confluence is a wonderful place, you should go there once...
---
### Disclaimer #2:
In this room there are Backend Developers, Frontend Developers, DevOps Engineer and QA who are more knowledgeable than me on everything I will be
talking about.
----
Does this make this meeting a scam?
Probably, but you're not getting anything better. So feel free to interrupt and correct.
---
## Deployments
---
## Glossary (part 1)
- **Build**:
Transforming the code into runnable software
- **Deploy**:
Putting the runnable software somewhere to be used by users
- **Pipeline**
A list of operations which lead to a result (a "script" under steroids)
---
## Glossary (part 2)
- **Environment**
Where the application is deployed (e.g. development, production)
- **Environment variables**
Application configuration which varies depending on the environment (e.g. which database to call, where to log...)
- **Container**
A unit of software which contains one or more applications and what's needed to run them
---
### Monolithic pipelines :-1:
> _Build and deploy in the same pipeline_
- All dependencies are built along with the application;
- All dependencies are deployed along with the application;
- Environment variables are built within the application
---
### Problems
- Usually unneeded rebuilding and deploying dependencies;
- Usually unneeded to recreate the test environment;
- Running tests is expensive;
- Application needs to be rebuilt per environment (without any real code change!);
---
### Atomic Pipelines :+1:
> Every pipeline does _one_ job and does it good
---
### Features
- Asynchronous build and deploy (build today, deploy tomorrow);
- Same codebase running on every environment;
- Application build and deploy independent of dependencies;
- Short deployment times (<1min);
---
### Examples
[Atomic Pipelines](https://jenkins.infra.globalgaming.cloud/view/Atomic/)
---
### NPM Packages Pipelines Step by Step
> :warning: This has to be refactored yet
---
### Frontend Pipelines Step by Step
---
### API Pipelines Step by Step
---
### Additional Pipelines
* E2E tests
* Integration Tests
* Contentful Health Checks
* Contentful Backups
* Release Analysis
* Pull Request Analysis
* Cache (Build, Deploy, Flush)
---
## Environments
---
### Glossary
* **VPC**:
A virtual data center
* **Region**:
Where things are actually deployed
* **Availability Zone**:
A "sub region" existing for redundancy purposes
---
### Why did we need a _new_ setup?
* :cloud: completely cloud
* :lock: prevent public access to internal resources and environments
* :computer: automated infrastructure as code deployments
* :facepunch: clusters fighting for resources (dev-qa/staging-prod)
* :dart: centralized management (monitoring, alerting, k8s)
---
### The scary diagram
[New Setup Diagram Link](https://confluence.infra.globalgaming.cloud/display/AT/01.+Microservices+Infrastructure)
---
### Wrap up
- *Stricter Control*: some bad pratices we are used to are not allowed anymore
- *Predictable Environments*: all the environments are the same and spawning a new environment is easy
---
## Caching
> There's two hard problems in computer science: we only have one joke and it's not funny anymore.
---
### The document no one read :eyeglasses:
[API Caching documentation](https://confluence.infra.globalgaming.cloud/display/PROD/Caching)
---
## Monitoring
> Is s@#t hitting the fan?
---
### Other links no one visits :link:
* [Monitoring](https://confluence.infra.globalgaming.cloud/display/AT/03.+Monitoring)
* _Sentry_
* _Alerting_
---
## Logging
> S@#t just hit the fan. Now what?
---
### Documenting is the best part of my job :tada:
* [Platform logging](https://confluence.infra.globalgaming.cloud/display/AT/04.+Platform+Logging)
* [Visualization, Setup, Retention](https://confluence.infra.globalgaming.cloud/display/AT/02.+Visualisations%2C+Setup%2C+Retention)
---
#### Thank you!
{%youtube MlDx9s-zJMM %}
_Pink Floyd - Atom Heart Mother_
{"metaMigratedAt":"2023-06-15T00:28:22.036Z","metaMigratedFrom":"YAML","title":"Environment, Deployments, Caching, Logging","breaks":true,"description":"View the slide with \"Slide Mode\".","slideOptions":"{\"theme\":\"white\",\"embedded\":true,\"parallaxBackgroundSize\":\"100000px\"}","contributors":"[{\"id\":\"5255dc1f-7255-469d-9736-f0aed3518ad4\",\"add\":10453,\"del\":8333}]"}