Skip to content

Commit f00766b

Browse files
Allow devstack to build ironic agent ramdisk
This provides a way to test Ironic-python-agent code that is not yet merged. Change-Id: I85084c383263173a33250592a95a17f46827b347
1 parent ddcde92 commit f00766b

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
@@ -558,6 +559,19 @@ function configure_ironic_auxiliary {
558559
ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
559560
}
560561

562+
function build_ipa_coreos_ramdisk {
563+
echo "Building ironic-python-agent deploy ramdisk"
564+
local kernel_path=$1
565+
local ramdisk_path=$2
566+
git_clone $IRONIC_PYTHON_AGENT_REPO $IRONIC_PYTHON_AGENT_DIR $IRONIC_PYTHON_AGENT_BRANCH
567+
cd $IRONIC_PYTHON_AGENT_DIR
568+
imagebuild/coreos/build_coreos_image.sh
569+
cp imagebuild/coreos/UPLOAD/coreos_production_pxe_image-oem.cpio.gz $ramdisk_path
570+
cp imagebuild/coreos/UPLOAD/coreos_production_pxe.vmlinuz $kernel_path
571+
sudo rm -rf UPLOAD
572+
cd -
573+
}
574+
561575
# build deploy kernel+ramdisk, then upload them to glance
562576
# this function sets ``IRONIC_DEPLOY_KERNEL_ID``, ``IRONIC_DEPLOY_RAMDISK_ID``
563577
function upload_baremetal_ironic_deploy {
@@ -582,8 +596,8 @@ function upload_baremetal_ironic_deploy {
582596
if [ "$IRONIC_BUILD_DEPLOY_RAMDISK" = "True" ]; then
583597
# we can build them only if we're not offline
584598
if [ "$OFFLINE" != "True" ]; then
585-
if [ "$IRONIC_DEPLOY_RAMDISK" == "agent_ssh" ]; then
586-
die $LINENO "Ironic-python-agent build is not yet supported"
599+
if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then
600+
build_ipa_coreos_ramdisk $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_DEPLOY_RAMDISK_PATH
587601
else
588602
ramdisk-image-create $IRONIC_DEPLOY_FLAVOR \
589603
-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)