Skip to content

Commit

Permalink
Update Tiltfile for faster iteration:
Browse files Browse the repository at this point in the history
The live update makes the development loop
quite fast.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Nov 21, 2024
1 parent 361c83d commit 4b18a16
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,47 @@ local_resource('compile smee',
cmd='make cmd/smee/smee-linux-amd64',
deps=["go.mod", "go.sum", "internal", "Dockerfile", "cmd/smee/main.go", "cmd/smee/flag.go", "cmd/smee/backend.go"]
)
docker_build(
'quay.io/tinkerbell/smee',
'.',
dockerfile='Dockerfile',
load('ext://restart_process', 'docker_build_with_restart')
#docker_build(
# 'quay.io/tinkerbell/smee',
# '.',
# dockerfile='Dockerfile',
#)
docker_build_with_restart(
'quay.io/tinkerbell/smee',
'.',
dockerfile='Dockerfile',
entrypoint=['/usr/bin/smee'],
live_update=[
sync('cmd/smee/smee-linux-amd64', '/usr/bin/smee'),
],
)
#k8s_yaml(kustomize('./manifests/kustomize/overlays/k3d'))
default_registry('ttl.sh/meohmy-dghentld')

trusted_proxies = os.getenv('trusted_proxies', '')
lb_ip = os.getenv('LB_IP', '192.168.2.114')
load('ext://local_output', 'local_output')
default_trusted_proxies = local_output("kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}' | tr ' ' ','")
trusted_proxies = os.getenv('TRUSTED_PROXIES', default_trusted_proxies)
lb_ip = os.getenv('LB_IP', '')
stack_version = os.getenv('STACK_CHART_VERSION', '0.5.0')
layer2_interface = os.getenv('LAYER2_INTERFACE', 'eth1')
stack_location = os.getenv('STACK_LOCATION', '/home/tink/repos/tinkerbell/charts/tinkerbell/stack') # or a local path like '/home/tink/repos/tinkerbell/charts/tinkerbell/stack'
namespace = 'tink'

if lb_ip == '':
fail('Please set the LB_IP environment variable. This is required to deploy the stack.')

load('ext://helm_resource', 'helm_resource')
helm_resource('stack',
chart='oci://ghcr.io/tinkerbell/charts/stack',
namespace='tink',
image_deps=['quay.io/tinkerbell/smee'],
image_keys=[('smee.image')],
flags=[
'--create-namespace',
'--version=%s' % stack_version,
'--set=global.trustedProxies={%s}' % trusted_proxies,
'--set=global.publicIP=%s' % lb_ip,
'--set=stack.kubevip.interface=%s' % layer2_interface,
'--set=stack.relay.sourceInterface=%s' % layer2_interface,
],
release_name='tink-stack'
chart=stack_location,
namespace=namespace,
image_deps=['quay.io/tinkerbell/smee'],
image_keys=[('smee.image')],
flags=[
'--create-namespace',
'--version=%s' % stack_version,
'--set=global.trustedProxies={%s}' % trusted_proxies,
'--set=global.publicIP=%s' % lb_ip,
'--set=stack.kubevip.interface=eth1',
'--set=stack.relay.sourceInterface=eth1',
],
release_name='stack'
)

0 comments on commit 4b18a16

Please sign in to comment.