Skip to content

Conversation

@soenkeliebau
Copy link
Member

Not sure if this is feasible to use with Tilt due to fairly long build times, might be necessary to pause deployment of the resources in Tilt and manually triggering as and when needed.

…the default Docker build process instead.

Not sure if this is feasible to use with Tilt due to fairly long build times, might be necessary to pause deployment of the resources in Tilt and manually triggering as and when needed.
@soenkeliebau soenkeliebau marked this pull request as draft November 11, 2025 13:57
@soenkeliebau
Copy link
Member Author

full disclosure, not tested it yet, just rescued from https://github.com/stackabletech/operator-templating/tree/feat/multiple_builders

outputs_image_ref_to='result/ref',
)
else if builder == 'docker':
docker_build(registry + '/' + operator_name, '.', dockerfile='docker/Dockerfile')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also need deps to be set, like the custom_build?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like docker_build supports that: https://docs.tilt.dev/api.html#api.docker_build

Not sure how it would know when to rebuild though ...

Copy link
Member Author

@soenkeliebau soenkeliebau Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '.' in the docker_build call is the context, that is watched for changes, a rebuild is triggered when anything changes in the current working directory.
We can probably do better than that, but auto-rebuild should happen with this..

docker_build supports live update functionality, which I think would allow us to copy the compiled binary into the running container .. not sure how the restart would then happen though ...

https://github.com/tilt-dev/live_update/blob/master/go/Tiltfile

Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we change the builder name to just nix

Comment on lines 8 to 9
# Configure which builder to use from config file, defaults to 'crate2nix'
builder = settings.get('builder', 'crate2nix')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crate2nix just generates the Cargo.nix file

Suggested change
# Configure which builder to use from config file, defaults to 'crate2nix'
builder = settings.get('builder', 'crate2nix')
# Configure which builder to use from config file, defaults to 'nix'
builder = settings.get('builder', 'nix')

# ignore=['result*', 'Cargo.nix', 'target', *.yaml],
outputs_image_ref_to='result/ref',
)
if builder == 'crate2nix':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if builder == 'crate2nix':
if builder == 'nix':

else if builder == 'docker':
docker_build(registry + '/' + operator_name, '.', dockerfile='docker/Dockerfile')
else:
fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, crate2nix]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, crate2nix]')
fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, nix]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants