-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Bug 1743873: data/bootstrap: extract ironic images from release image #2234
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
Merged
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -ex | ||
|
|
||
| # We should switch to openshift builds of these images when ready ref | ||
| # https://github.com/openshift/installer/issues/2090 | ||
| IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic:master"} | ||
| IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"quay.io/metal3-io/ironic-inspector:master"} | ||
| IPA_DOWNLOADER_IMAGE=${IPA_DOWNLOADER_IMAGE:-"quay.io/metal3-io/ironic-ipa-downloader:master"} | ||
| COREOS_DOWNLOADER_IMAGE=${COREOS_DOWNLOADER_IMAGE:-"quay.io/openshift-metal3/rhcos-downloader:master"} | ||
| . /usr/local/bin/release-image.sh | ||
|
|
||
| IRONIC_IMAGE=$(image_for ironic) | ||
| IRONIC_INSPECTOR_IMAGE=$(image_for ironic-inspector) | ||
| IPA_DOWNLOADER_IMAGE=$(image_for ironic-ipa-downloader) | ||
| COREOS_DOWNLOADER_IMAGE=$(image_for ironic-rhcos-downloader) | ||
|
|
||
| # This image is templated in via the installer pkg/asset/ignition/bootstrap/bootstrap.go | ||
| RHCOS_BOOT_IMAGE_URL="{{.BootImage}}" | ||
|
|
@@ -87,7 +86,6 @@ podman wait -i 1000 ipa-downloader | |
| podman wait -i 1000 coreos-downloader | ||
| while ! curl --fail http://localhost/images/rhcos-ootpa-latest.qcow2.md5sum ; do sleep 1; done | ||
| while ! curl --fail --head http://localhost/images/ironic-python-agent.initramfs ; do sleep 1; done | ||
| while ! curl --fail --head http://localhost/images/ironic-python-agent.tar.headers ; do sleep 1; done | ||
|
||
| while ! curl --fail --head http://localhost/images/ironic-python-agent.kernel ; do sleep 1; done | ||
|
|
||
| sudo podman run -d --net host --privileged --name ironic-conductor \ | ||
|
|
||
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
17 changes: 17 additions & 0 deletions
17
data/data/bootstrap/files/usr/local/bin/release-image-download.sh.template
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,17 @@ | ||
| #!/usr/bin/env bash | ||
| # Download the release image. This script is executed as a oneshot | ||
| # service by systemd, because we cannot make use of Requires and a | ||
| # simple service: https://github.com/systemd/systemd/issues/1312. | ||
| # | ||
| # This script continues trying to download the release image until | ||
| # successful because we cannot use Restart=on-failure with a oneshot | ||
| # service: https://github.com/systemd/systemd/issues/2582. | ||
| # | ||
|
|
||
| RELEASE_IMAGE={{.ReleaseImage}} | ||
|
|
||
| echo "Pulling $RELEASE_IMAGE..." | ||
| while ! podman pull --quiet "$RELEASE_IMAGE" | ||
| do | ||
| echo "Pull failed. Retrying $RELEASE_IMAGE..." | ||
| done |
13 changes: 13 additions & 0 deletions
13
data/data/bootstrap/files/usr/local/bin/release-image.sh.template
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,13 @@ | ||
| #!/usr/bin/env bash | ||
| # This library provides an `image_for` helper function which can get the | ||
| # pull spec for a specific image in a release. | ||
|
|
||
| # Convert the release image pull spec to an "absolute" form if a digest is available | ||
| if ! RELEASE_IMAGE_DIGEST=$( podman inspect {{.ReleaseImage}} --format '{{"{{"}} index .RepoDigests 0 {{"}}"}}' ) || [[ -z "${RELEASE_IMAGE_DIGEST}" ]]; then | ||
| echo "Warning: Could not resolve release image to pull by digest" 2>&1 | ||
| RELEASE_IMAGE_DIGEST="{{.ReleaseImage}}" | ||
| fi | ||
|
|
||
| image_for() { | ||
| podman run --quiet --rm --net=none "${RELEASE_IMAGE_DIGEST}" image "${1}" | ||
| } |
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
9 changes: 9 additions & 0 deletions
9
data/data/bootstrap/systemd/units/release-image.service.template
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,9 @@ | ||
| [Unit] | ||
| Description=Download the OpenShift Release Image | ||
| Wants=network-online.target | ||
| After=network-online.target | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/local/bin/release-image-download.sh | ||
| RemainAfterExit=true | ||
wking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.