-
-
Notifications
You must be signed in to change notification settings - Fork 1
Added option to allow the user the option of not using crate2nix but the default Docker build process instead. #560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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.
|
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') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
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
NickLarsenNZ
left a comment
There was a problem hiding this 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
template/Tiltfile
Outdated
| # Configure which builder to use from config file, defaults to 'crate2nix' | ||
| builder = settings.get('builder', 'crate2nix') |
There was a problem hiding this comment.
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
| # 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') |
template/Tiltfile
Outdated
| # ignore=['result*', 'Cargo.nix', 'target', *.yaml], | ||
| outputs_image_ref_to='result/ref', | ||
| ) | ||
| if builder == 'crate2nix': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, crate2nix]') | |
| fail('Unsupported builder specified: [' + builder + '] - currently supported builders are: [docker, nix]') |
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.