Skip to content

Commit 56ad56b

Browse files
committed
Added TeamCity
1 parent 5557e1b commit 56ad56b

13 files changed

+262
-2
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ http://<ip or domain name>:5000/v2/<repo-name>/tags/list
124124

125125
![Automation Framework Swarm](diagrams/automation_framework_swarm.png)
126126

127-
### What is Available in Compose and Kubernetes
127+
### What is Available in Compose
128128

129129
| ARCHITECTURE | USED FOR |
130130
|---|---|
@@ -139,5 +139,20 @@ http://<ip or domain name>:5000/v2/<repo-name>/tags/list
139139
| Grafana | Pretty Graphs |
140140
| Docker Registry | To hold docker images |
141141
| Docker Registry Browser | To Browse the Registry |
142+
| JetBrains TeamCity | CI/CD |
142143

143144
![Automation Framework Compose](diagrams/automation_framework_compose.png)
145+
146+
### What is Available in Kubernetes
147+
148+
| ARCHITECTURE | USED FOR |
149+
|---|---|
150+
| ELK Elastic Search | Logging search, various other stuff |
151+
| Hashicorp Vault | Secrets Storage |
152+
| MongoDB | Document dB |
153+
| Batfish | Modeling |
154+
| Influxdb | Series dB |
155+
| Grafana | Pretty Graphs |
156+
| JetBrains TeamCity | CI/CD |
157+
158+
![Automation Framework Compose](diagrams/automation_framework_kubernetes.png)
54.9 KB
Loading

diagrams/automation_framework_compose.py

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from diagrams.onprem.database import Mongodb
1313
from diagrams.onprem.database import Influxdb
1414
from diagrams.onprem.monitoring import Grafana
15+
from diagrams.onprem.ci import TC
1516

1617

1718
def main():
@@ -95,6 +96,9 @@ def main():
9596
mongodb_express
9697
]
9798

99+
with Cluster('CI/CD'):
100+
team_city = TC('TeamCity')
101+
98102
kafka_brokers - python_container
99103

100104
python_container - vault

diagrams/automation_framework_k8s.py

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
from diagrams import Diagram, Cluster, Edge
2+
from diagrams.custom import Custom
3+
from diagrams.onprem.security import Vault
4+
from diagrams.onprem.network import Zookeeper
5+
from diagrams.onprem.queue import Kafka
6+
from diagrams.elastic.elasticsearch import Elasticsearch
7+
from diagrams.elastic.elasticsearch import Kibana
8+
from diagrams.elastic.elasticsearch import Logstash
9+
from diagrams.onprem.container import Docker
10+
from diagrams.programming.language import Python
11+
from diagrams.generic.storage import Storage
12+
from diagrams.onprem.database import Mongodb
13+
from diagrams.onprem.database import Influxdb
14+
from diagrams.onprem.monitoring import Grafana
15+
from diagrams.onprem.ci import TC
16+
17+
18+
def main():
19+
graph_attr = {
20+
"fontsize": "45",
21+
'overlap_scaling': '100',
22+
'size': '24!',
23+
'ratio': 'expand'
24+
}
25+
26+
with Diagram(name='Automation Framework Kubernetes', direction='LR', graph_attr=graph_attr):
27+
with Cluster('Docker Cluster'):
28+
docker = Docker('Docker')
29+
30+
with Cluster('container1'):
31+
python_container = Python('APIs\nOther Microservices')
32+
33+
with Cluster('Docker Registry'):
34+
docker_registry_container = Docker('Docker Registry\ntcp:5000')
35+
36+
with Cluster('Docker Registry Browser'):
37+
docker_registry_browser_container = Python('Docker Registry Browser\ntcp:8088')
38+
39+
with Cluster('BatFish'):
40+
batfish_container = Custom('BatFish\ntcp:8888\ntcp:9997\ntcp:9996', 'custom_icons/BatFish.png')
41+
42+
with Cluster('Secrets Managers'):
43+
vault = Vault('HashiCorp Vault\ntcp:8200')
44+
secrets_managers = [
45+
vault,
46+
]
47+
48+
with Cluster('Logging and Search'):
49+
with Cluster('ELK Stack'):
50+
elastic_search = Elasticsearch('Elastic Search\ntcp:9200')
51+
kibana = Kibana('Kibana\ntcp:5601')
52+
logstash = Logstash('Logstash\ntcp:5044')
53+
search_log = [
54+
elastic_search,
55+
kibana,
56+
logstash
57+
]
58+
59+
with Cluster('Influxdb'):
60+
infulxdb = Influxdb('Influxdb\ntcp:8086')
61+
62+
with Cluster('Grafana'):
63+
grafana = Grafana('Grafana\ntcp:3000')
64+
65+
with Cluster('Database'):
66+
with Cluster('Mongo dB'):
67+
mongodb = Mongodb('MongoDb\ntcp:27017')
68+
mongodb_express = Mongodb('MongoDb Express\ntcp:8181')
69+
mongo_group = [
70+
mongodb,
71+
mongodb_express
72+
]
73+
74+
with Cluster('CI/CD'):
75+
team_city = TC('TeamCity')
76+
77+
78+
python_container - vault
79+
80+
python_container - logstash
81+
82+
python_container - infulxdb
83+
84+
python_container - mongodb
85+
86+
87+
if __name__ == '__main__':
88+
main()
67.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
version: '3.4'
3+
services:
4+
teamcity-server-instance:
5+
image: jetbrains/teamcity-server:latest
6+
container_name: teamcity-server-instance
7+
ports:
8+
- 8111:8111
9+
volumes:
10+
- "teamcity-server-datadir-compose:/data/teamcity_server/datadir"
11+
- "teamcity-server-logs-compose:/opt/teamcity/logs"
12+
restart: on-failure
13+
teamcity-agent-1:
14+
build:
15+
context: ../dockerfile
16+
dockerfile: Dockerfile-Python-Agent
17+
image: localhost:32000/teamcity-agent-python:latest
18+
container_name: teamcity-agent-1
19+
environment:
20+
SERVER_URL: http://10.0.0.102:8111
21+
volumes:
22+
- "teamcity-agent-1-conf-compose:/data/teamcity_agent/conf"
23+
restart: on-failure
24+
25+
volumes:
26+
teamcity-server-datadir-compose:
27+
teamcity-server-logs-compose:
28+
teamcity-agent-1-conf-compose:
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM jetbrains/teamcity-agent:EAP-linux-sudo
2+
3+
LABEL version="2021.9.6.001"
4+
LABEL description="TeamCity Python3 agent"
5+
LABEL maintainer="Ben Trachtenberg"
6+
7+
SHELL ["/bin/bash", "-c"]
8+
9+
RUN sudo apt-get update \
10+
&& sudo apt-get install -qy \
11+
python3-pip \
12+
python3-venv
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--- # Version 2021.9.6.001
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: teamcity-agent-python
6+
labels:
7+
app: teamcity-agent-python
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: teamcity-agent-python
13+
template:
14+
metadata:
15+
labels:
16+
app: teamcity-agent-python
17+
spec:
18+
terminationGracePeriodSeconds: 1
19+
containers:
20+
- name: teamcity-agent-python
21+
image: localhost:32000/teamcity-agent-python:latest
22+
imagePullPolicy: Always
23+
env:
24+
- name: SERVER_URL
25+
value: "http://teamcity-server:8111"
26+
resources:
27+
requests:
28+
memory: "256Mi"
29+
cpu: "250m"
30+
limits:
31+
memory: "500Mi"
32+
cpu: "500m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
--- # Version 2021.9.6.001
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: teamcity-server
6+
labels:
7+
app: teamcity-server
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: teamcity-server
13+
template:
14+
metadata:
15+
labels:
16+
app: teamcity-server
17+
spec:
18+
terminationGracePeriodSeconds: 1
19+
containers:
20+
- name: teamcity-server
21+
image: jetbrains/teamcity-server:latest
22+
imagePullPolicy: Always
23+
ports:
24+
- containerPort: 8111
25+
resources:
26+
requests:
27+
memory: "2Gi"
28+
cpu: "500m"
29+
limits:
30+
memory: "4Gi"
31+
cpu: "1"
32+
volumeMounts:
33+
- name: teamcity-server-datadir
34+
mountPath: /data/teamcity_server/datadir
35+
- name: teamcity-server-logs
36+
mountPath: /opt/teamcity/logs
37+
volumes:
38+
- name: teamcity-server-datadir
39+
persistentVolumeClaim:
40+
claimName: teamcity-server-datadir-claim
41+
- name: teamcity-server-logs
42+
persistentVolumeClaim:
43+
claimName: teamcity-server-logs-claim
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: teamcity-server
6+
spec:
7+
type: LoadBalancer
8+
ports:
9+
- port: 8111
10+
targetPort: 8111
11+
name: teamcity-server-gui
12+
selector:
13+
app: teamcity-server
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- # Version 2021.9.6.001
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: teamcity-server-datadir-claim
6+
spec:
7+
accessModes:
8+
- ReadWriteMany
9+
volumeMode: Filesystem
10+
resources:
11+
requests:
12+
storage: 20Gi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- # Version 2021.9.6.001
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: teamcity-server-logs-claim
6+
spec:
7+
accessModes:
8+
- ReadWriteMany
9+
volumeMode: Filesystem
10+
resources:
11+
requests:
12+
storage: 20Gi

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ pytest-html~=3.1.1
44
coverage~=5.5.0
55
pylint~=2.8.2
66
sphinx~=4.0.0
7-
diagrams~=0.19.0
7+
diagrams~=0.20.0

0 commit comments

Comments
 (0)