forked from elastic/apm-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
47 lines (41 loc) · 1.78 KB
/
Tiltfile
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
# Build a custom elastic-agent image with a locally built apm-server binary injected.
custom_build(
'elastic-agent',
'bash ./testing/docker/elastic-agent/build.sh -t $EXPECTED_REF',
['go.mod', 'go.sum', 'Makefile', '*.mk', '.git', 'cmd', 'internal', 'x-pack'],
)
# Build and install the APM integration package whenever source under
# "apmpackage" changes.
script_dir = os.path.join(config.main_dir, 'script')
run_with_go_ver = os.path.join(script_dir, 'run_with_go_ver')
local_resource(
'apmpackage',
cmd = [os.path.join(script_dir, 'run_with_go_ver'), 'go', 'run', './cmd/runapm -init'],
dir = 'systemtest',
deps = ['apmpackage'],
resource_deps=['kibana'],
)
k8s_yaml(kustomize('testing/infra/k8s/overlays/local'))
k8s_kind('Agent', image_json_path='{.spec.image}')
k8s_kind('Kibana')
k8s_kind('Elasticsearch')
k8s_resource('elastic-operator', objects=['eck-trial-license:Secret:elastic-system'])
k8s_resource('apm-server', port_forwards=8200)
k8s_resource('kibana', port_forwards=5601)
k8s_resource('elasticsearch', port_forwards=9200, objects=['elasticsearch-admin:Secret:default'])
# Delete ECK entirely on `tilt down`, to ensure `tilt up` starts from a clean slate.
#
# Without this, ECK refuses to recreate the trial license. That's expected
# for actual trial use, but we rely an Enterprise feature for local development:
# installing the integration package by uploading to Fleet.
if config.tilt_subcommand == "down":
print(local("kubectl delete --ignore-not-found namespace/elastic-system"))
# Add a button for sending trace events and metrics to APM Server.
load('ext://uibutton', 'cmd_button')
cmd_button(
'apm-server:sendotlp',
argv=['sh', '-c', 'cd systemtest && %s go run ./cmd/sendotlp' % run_with_go_ver],
resource='apm-server',
icon_name='input',
text='Send OTLP data',
)