forked from metal3-io/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 50
WIP rebase on latest metal3-io PRs #32
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| interface=PROVISIONING_INTERFACE | ||
| bind-dynamic | ||
| enable-tftp | ||
| tftp-root=/shared/tftpboot | ||
| log-dhcp | ||
|
|
||
| enable-ra | ||
| ra-param=PROVISIONING_INTERFACE,10 | ||
|
|
||
| dhcp-vendorclass=set:pxe6,enterprise:343,PXEClient | ||
| dhcp-range=DHCP_RANGE | ||
| dhcp-userclass=set:ipxe6,iPXE | ||
| dhcp-option=tag:pxe6,option6:bootfile-url,tftp://IRONIC_URL_HOST/snponly.efi | ||
| dhcp-option=tag:ipxe6,option6:bootfile-url,http://IRONIC_URL_HOST:HTTP_PORT/dualboot.ipxe | ||
|
|
||
| # Disable listening for DNS | ||
| port=0 | ||
|
|
||
| # Disable default router(s) and DNS over provisioning network | ||
| dhcp-option=3 | ||
| dhcp-option=6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
|
|
||
| # Wait for the interface or IP to be up, sets $IRONIC_IP | ||
| function wait_for_interface_or_ip() { | ||
| # If $PROVISIONING_IP is specified, then we wait for that to become available on an interface, otherwise we look at $PROVISIONING_INTERFACE for an IP | ||
| if [ ! -z "${PROVISIONING_IP}" ]; | ||
| then | ||
| IRONIC_IP="" | ||
| until [ ! -z "${IRONIC_IP}" ]; do | ||
| echo "Waiting for ${PROVISIONING_IP} to be configured on an interface" | ||
| IRONIC_IP=$(ip -br addr show | grep "${PROVISIONING_IP}" | grep -Po "[^\s]+/[0-9]+" | sed -e 's%/.*%%' | head -n 1) | ||
| sleep 1 | ||
| done | ||
| else | ||
| until [ ! -z "${IRONIC_IP}" ]; do | ||
| echo "Waiting for ${PROVISIONING_INTERFACE} interface to be configured" | ||
| IRONIC_IP=$(ip -br addr show dev $PROVISIONING_INTERFACE | grep -Po "[^\s]+/[0-9]+" | grep -e "^fd" -e "\." | sed -e 's%/.*%%' | head -n 1) | ||
| sleep 1 | ||
| done | ||
| fi | ||
|
|
||
| # If the IP contains a colon, then it's an IPv6 address, and the HTTP | ||
| # host needs surrounding with brackets | ||
| if [[ "$IRONIC_IP" =~ .*:.* ]] | ||
| then | ||
| IPV=6 | ||
| IRONIC_URL_HOST="[$IRONIC_IP]" | ||
| else | ||
| IPV=4 | ||
| IRONIC_URL_HOST=$IRONIC_IP | ||
| fi | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,30 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
| . /bin/ironic-common.sh | ||
|
|
||
| HTTP_PORT=${HTTP_PORT:-"80"} | ||
| DHCP_RANGE=${DHCP_RANGE:-"172.22.0.10,172.22.0.100"} | ||
| DNSMASQ_EXCEPT_INTERFACE=${DNSMASQ_EXCEPT_INTERFACE:-"lo"} | ||
|
|
||
| PROVISIONING_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| until [ ! -z "${PROVISIONING_IP}" ]; do | ||
| echo "Waiting for ${PROVISIONING_INTERFACE} interface to be configured" | ||
| sleep 1 | ||
| PROVISIONING_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| done | ||
| wait_for_interface_or_ip | ||
|
|
||
| mkdir -p /shared/tftpboot | ||
| mkdir -p /shared/html/images | ||
| mkdir -p /shared/html/pxelinux.cfg | ||
| mkdir -p /shared/log/dnsmasq | ||
|
|
||
| # Copy files to shared mount | ||
| cp /usr/share/ipxe/undionly.kpxe /usr/share/ipxe/ipxe.efi /shared/tftpboot | ||
| cp /tftpboot/undionly.kpxe /tftpboot/ipxe.efi /tftpboot/snponly.efi /shared/tftpboot | ||
|
|
||
| # Copy IPv4 or IPv6 config | ||
| cp /etc/dnsmasq.conf.ipv$IPV /etc/dnsmasq.conf | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing dnsmasq.conf files |
||
|
|
||
| # Use configured values | ||
| sed -i -e s/IRONIC_IP/${PROVISIONING_IP}/g -e s/HTTP_PORT/${HTTP_PORT}/g \ | ||
| sed -i -e s/IRONIC_URL_HOST/${IRONIC_URL_HOST}/g -e s/HTTP_PORT/${HTTP_PORT}/g \ | ||
| -e s/DHCP_RANGE/${DHCP_RANGE}/g -e s/PROVISIONING_INTERFACE/${PROVISIONING_INTERFACE}/g \ | ||
| /etc/dnsmasq.conf | ||
| for iface in $( echo "$DNSMASQ_EXCEPT_INTERFACE" | tr ',' ' '); do | ||
| sed -i -e "/^interface=.*/ a\except-interface=${iface}" /etc/dnsmasq.conf | ||
| done | ||
|
|
||
| # Allow access to dhcp and tftp server for pxeboot | ||
| for port in 67 69 ; do | ||
| if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT 2>/dev/null ; then | ||
| iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT | ||
| fi | ||
| done | ||
|
|
||
| /usr/sbin/dnsmasq -d -q -C /etc/dnsmasq.conf 2>&1 | tee /shared/log/dnsmasq/dnsmasq.log & | ||
| /bin/runhealthcheck "dnsmasq" &>/dev/null & | ||
| sleep infinity | ||
|
|
||
| exec /usr/sbin/dnsmasq -d -q -C /etc/dnsmasq.conf | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These changes need to go into Dockerfile.ocp, unless we can get this into the downstream ipxe-bootimgs?
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.
yup, this may cause a problem, last time I tried to build a image in this build system with two "FROM " statements in the DockerFile the build system changed one of them but not the other (this may be what you need or it might get in the way....), as far as I could see it happens here
https://github.com/openshift/builder/blob/master/pkg/build/builder/docker.go#L374
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've asked:
Requesting IPv6 support: https://bugzilla.redhat.com/show_bug.cgi?id=1776926
Requesting snponly.efi: https://bugzilla.redhat.com/show_bug.cgi?id=1776929
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 it does the last FROM, it may not be a big issue as long as where it's built can hit docker.io to get the centos images, we only use the builder to make the ipxe images.
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.
1776926 has been marked as a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=1637650 so perhaps we can use the non-qemu ipxe-roms package from the RHEL8 appstream repo?
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.
snpnoly.efi is still missing, which we need to make things work correctly.
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.
Ok I'll copy the current build-from-source for now and we can follow-up with a change that makes this work with the packaged ipxe-roms
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.
as a workaround, we can have the source that we want to compile in the image repo itself or in a downstream repo
or, well, wait for the bugzilla to be resolved