Skip to content

Commit 4bd4264

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Allow devstack to build ironic agent ramdisk"
2 parents 68fd37e + f00766b commit 4bd4264

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

files/apts/ironic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
docker.io
12
ipmitool
23
iptables
34
ipxe

files/rpms/ironic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
docker-io
12
ipmitool
23
iptables
34
ipxe-bootimgs

lib/ironic

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set +o pipefail
2929

3030
# Set up default directories
3131
IRONIC_DIR=$DEST/ironic
32+
IRONIC_PYTHON_AGENT_DIR=$DEST/ironic-python-agent
3233
IRONIC_DATA_DIR=$DATA_DIR/ironic
3334
IRONIC_STATE_PATH=/var/lib/ironic
3435
IRONICCLIENT_DIR=$DEST/python-ironicclient
@@ -559,6 +560,19 @@ function configure_ironic_auxiliary {
559560
ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
560561
}
561562

563+
function build_ipa_coreos_ramdisk {
564+
echo "Building ironic-python-agent deploy ramdisk"
565+
local kernel_path=$1
566+
local ramdisk_path=$2
567+
git_clone $IRONIC_PYTHON_AGENT_REPO $IRONIC_PYTHON_AGENT_DIR $IRONIC_PYTHON_AGENT_BRANCH
568+
cd $IRONIC_PYTHON_AGENT_DIR
569+
imagebuild/coreos/build_coreos_image.sh
570+
cp imagebuild/coreos/UPLOAD/coreos_production_pxe_image-oem.cpio.gz $ramdisk_path
571+
cp imagebuild/coreos/UPLOAD/coreos_production_pxe.vmlinuz $kernel_path
572+
sudo rm -rf UPLOAD
573+
cd -
574+
}
575+
562576
# build deploy kernel+ramdisk, then upload them to glance
563577
# this function sets ``IRONIC_DEPLOY_KERNEL_ID``, ``IRONIC_DEPLOY_RAMDISK_ID``
564578
function upload_baremetal_ironic_deploy {
@@ -583,8 +597,8 @@ function upload_baremetal_ironic_deploy {
583597
if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then
584598
# we can build them only if we're not offline
585599
if [ "$OFFLINE" != "True" ]; then
586-
if [ "$IRONIC_DEPLOY_RAMDISK" == "agent_ssh" ]; then
587-
die $LINENO "Ironic-python-agent build is not yet supported"
600+
if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then
601+
build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH
588602
else
589603
ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \
590604
-o $TOP_DIR/files/ir-deploy

stackrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@ HORIZON_BRANCH=${HORIZON_BRANCH:-master}
172172
HORIZONAUTH_REPO=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
173173
HORIZONAUTH_BRANCH=${HORIZONAUTH_BRANCH:-master}
174174

175-
# baremetal provisionint service
175+
# baremetal provisioning service
176176
IRONIC_REPO=${IRONIC_REPO:-${GIT_BASE}/openstack/ironic.git}
177177
IRONIC_BRANCH=${IRONIC_BRANCH:-master}
178+
IRONIC_PYTHON_AGENT_REPO=${IRONIC_PYTHON_AGENT_REPO:-${GIT_BASE}/openstack/ironic-python-agent.git}
179+
IRONIC_PYTHON_AGENT_BRANCH=${IRONIC_PYTHON_AGENT_BRANCH:-master}
178180

179181
# ironic client
180182
IRONICCLIENT_REPO=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}

0 commit comments

Comments
 (0)