-
Notifications
You must be signed in to change notification settings - Fork 20
hack: support even more customization #211
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
hack: support even more customization #211
Conversation
🎉 All dependencies have been resolved ! |
This pull request now has conflicts with the target branch. Please resolve these conflicts and force push the updated branch. |
91f5930
to
a7a0ae7
Compare
d26fb4e
to
4e1f6c7
Compare
Do note that I am building this mainly for my use, as well as others on our dev community, but I don't expect a general audience. So I expect it to be niche and a tad obscure :-) |
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.
Generally lgtm. See below for some comments.
The commit message for images/server: allow --ceph-from-custom=1
needs some cleanup and would you like placing an example .ini somewhere in the repository (with image
and sambacc
sections)?
4e1f6c7
to
568e57c
Compare
Signed-off-by: John Mulligan <[email protected]>
Allow `--ceph-from-custom=1` to be equivalent to `--ceph-from-custom`. This makes it easier to write a Dockerfile without conditionals tricks when constructing the command based on build args. Allow `--ceph-from-custom=0` for the same reason. The former is better when used directly from the CLI but that's rare. Signed-off-by: John Mulligan <[email protected]>
This build arg takes either `0` or `1` and defaults to 0. It can be used to disable automatically setting up ceph repos as it tells the install script that ceph repos are coming from the custom repos list. Signed-off-by: John Mulligan <[email protected]>
Fit in line length. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
Don't call the same function many times when that function's value is never expected to change at this scope. Signed-off-by: John Mulligan <[email protected]>
I find lambda to be a bit of an unpleasant thing and try to remove it when possible. Since all uses of lambda in this code are calling the same function we can remove the function (and unchanging) argument and have the variable section map to the run function's remaining kwargs. Signed-off-by: John Mulligan <[email protected]>
I constantly rely on my shell history to make custom modifications to create images based on work-in-progress package builds. Adding a customizations file allows me to store things in a file so I can run: ``` ./hack/build-image \ -i quay.io/phlogistonjohn/samba-server:custom-centos-amd64-x2 \ -C foo.ini ``` instead of a long line of embedded junk on the shell. No docs yet because this is for me. :-) Signed-off-by: John Mulligan <[email protected]>
Split up the function setting up the docker buildx or podman build commands so that the higher level function is shorter overall. Best viewed with git diff -w Signed-off-by: John Mulligan <[email protected]>
Re-run `black` on the hack/build-image script. Signed-off-by: John Mulligan <[email protected]>
In the functions that create docker buildx commands or podman build commands allow passing a custom container file. This will be used by a future change that writes a temporary edited container file that needs to be passed to the container commands. Signed-off-by: John Mulligan <[email protected]>
Add support for adding a sambacc section to the new customize config that will create a modified version of the container file. This modified container builds sambacc packages from a git branch (or tag) and then installs that instead of the default install source. It is basically a code version of the manual instructions [1] in the repo. [1] https://github.com/samba-in-kubernetes/samba-container/blob/master/docs/development.md#build-stage Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
568e57c
to
c196db2
Compare
Updated. PTA(nother)L |
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.
LGTM!
Depends on: #210
Depends on: #212
This PR fleshes out something I've been wanting for a while, a way to record and repeatedly build custom samba server images. These customizations include things like bringing in samba, ceph, or other dependencies from special rpm repos; tweaking other build container build arguments; or using custom arguments not on the command line, so that I don't have to rely heavily on my shell history.
Another special customization is the ability to build and install sambacc from a git checkout. This allows for a faster and cleaner build and install of a sambacc development branch. It is based on the instructions https://github.com/samba-in-kubernetes/samba-container/blob/master/docs/development.md#build-stage
The pr starts off with various cleanup patches an prep work before adding the new config file (in pieces).
A config file looks something like this:
and can be run something like this:
/hack/build-image --debug -i quay.io/phlogistonjohn/samba-server:custom-centos-amd64-x2 -C foo.ini