-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.star
31 lines (25 loc) · 951 Bytes
/
main.star
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
main_redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star")
VOTING_APP_IMAGE = "mcr.microsoft.com/azuredocs/azure-vote-front:v1"
def run(plan, should_party = False):
"""
Runs a toy app stack containing a voting app with Redis as the backend.
Args:
should_party (bool): Whether we'll throw a small party before launching the app!
"""
if should_party:
plan.print("Preparing for party...")
plan.print("It's party time!")
redis_run_output = main_redis_module.run(plan)
redis_hostname = redis_run_output.hostname
plan.add_service(
name = "voting-app",
config = ServiceConfig(
ports = {
"http": PortSpec(number = 80, transport_protocol = "TCP", application_protocol = "http")
},
image = VOTING_APP_IMAGE,
env_vars = {
"REDIS": redis_hostname,
}
)
)