-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathflight_ticket.py
47 lines (38 loc) · 1.35 KB
/
flight_ticket.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Interface to the Flight Ticket application"""
import time
from aiopslab.service.helm import Helm
from aiopslab.service.kubectl import KubeCtl
from aiopslab.service.apps.base import Application
from aiopslab.paths import TARGET_MICROSERVICES
from aiopslab.paths import FLIGHT_TICKET_METADATA
class FlightTicket(Application):
def __init__(self):
super().__init__(FLIGHT_TICKET_METADATA)
self.load_app_json()
self.kubectl = KubeCtl()
self.create_namespace()
def load_app_json(self):
super().load_app_json()
metadata = self.get_app_json()
self.frontend_service = None
self.frontend_port = None
def deploy(self):
"""Deploy the Helm configurations."""
self.kubectl.create_namespace_if_not_exist(self.namespace)
Helm.add_repo(
"flight-ticket",
"https://xlab-uiuc.github.io/flight-ticket",
)
Helm.install(**self.helm_configs)
Helm.assert_if_deployed(self.helm_configs["namespace"])
def delete(self):
"""Delete the Helm configurations."""
# NOTE: We should probably clear redis?
Helm.uninstall(**self.helm_configs)
time.sleep(30)
def cleanup(self):
Helm.uninstall(**self.helm_configs)
# if __name__ == "__main__":
# app = FlightTicket()
# app.deploy()
# app.delete()