-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlphasfile
More file actions
140 lines (121 loc) · 2.88 KB
/
Copy pathAlphasfile
File metadata and controls
140 lines (121 loc) · 2.88 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
sysenv = ["HOME", "USER", "PATH", "LANG", "LC_ALL", "TZ", "TERM", "TMPDIR"]
service "go" "nats-server" {
git {
url = "github.com/nats-io/nats-server"
tag = "v2.14.0"
}
vars = {
client = net::pickport()
http = net::pickport()
}
arguments {
values = {
main = {
D = false
V = false
p = self.vars.client
m = self.vars.http
}
}
}
}
service "rust" "tansu" {
crate {
name = "tansu"
features = ["dynostore"]
}
vars = {
kafka = net::pickport()
}
arguments {
values = {
main = {
listener-url = "tcp://127.0.0.1:${self.vars.kafka}"
advertised-listener-url = "tcp://127.0.0.1:${self.vars.kafka}"
}
}
options {
prefix = "--"
}
}
}
service "go" "prometheus" {
git {
url = "github.com/prometheus/prometheus"
tag = "v3.11.3"
}
src { exe = "./cmd/prometheus" }
vars = {
port = net::pickport()
}
arguments {
values = {
main = {
"config.file" = self.file.config.path
"log.format" = "json"
"web.listen-address" = ":${self.vars.port}"
"storage.tsdb.path" = "${fs::tmp()}/prometheus-data"
}
}
options {
prefix = "--"
}
}
file "config" {
path = "${fs::tmp()}/prometheus.yml"
body = <<-EOT
global:
scrape_interval: 15s
scrape_configs: []
EOT
}
readiness {
http {
path = "/-/ready"
port = self.vars.port
}
period = "200ms"
timeout = "1s"
failure_threshold = 30
}
}
service "ruby" "ruby-service" {
git {
url = "github.com/niwasawa/ruby-sinatra-hello-world"
}
# No build {} — the toolchain default for ruby is
# `bundle config set --local path vendor/bundle && bundle install`,
# which is exactly what this service needs. Bundler 2.x removed the
# `--path` flag; the new form writes .bundle/config so `bundle exec`
# at runtime finds the gems too.
vars = {
port = net::pickport()
}
env = {
PORT = self.vars.port
}
log {
format = "plain"
# Drop ruby backtrace noise ("from …" frames and ":in `…'" tails) so
# only the app's own output shows. Cheap raw-byte prefix tests gate the
# regex; see internal/logfilter for the DSL and its cost planner.
filter = <<-EOT
hasPrefix(line, "\tfrom ")
or hasPrefix(line, "/Users/")
or matches(line, ":in `.*'")
EOT
}
runtime {
# `rackup` was extracted from rack 3.x into its own gem and the
# Sinatra-hello-world Gemfile doesn't declare it — use puma (already
# a dependency) to serve config.ru directly. `-b tcp://host:port`
# binds explicitly, no separate -o.
cmd = ["bundle", "exec", "puma", "-b", "tcp://0.0.0.0:${self.vars.port}", "config.ru"]
}
readiness {
http {
port = self.vars.port
path = "/"
}
}
}