563 Commits

Author SHA1 Message Date
Jim Rollenhagen
082cf29cec Force heartbeat immediately after async command completes
This change passes the agent object into extensions, such that
they may call agent methods as needed. It also causes async
commands to force a heartbeat immediately after completing the
command. This allows Ironic to get a heartbeat and continue
work as quickly as possible, while also allowing deployers to
configure Ironic (agent) to heartbeat less often.

Change-Id: Ib3c3a43dfd0ed4ed51b7d52ac099f01181ca822f
2014-10-13 11:09:09 -07:00
Jim Rollenhagen
4f57590b2e Use poll instead of threading.Event in heartbeat thread
poll() does not rely on absolute time.
This fixes an issue where the system clock may be changed, and
the heartbeat thread would stop heartbeating.

This also gives us flexibility to force a heartbeat in a later
change.

Change-Id: Ifde7b53f59788addc43a5dac95c7b6519d87e834
Closes-Bug: 1355375
2014-10-13 10:50:08 -07:00
Jenkins
049fa642e5 Merge "Delete unused method get_agent_mac_address()" 2014-09-22 16:41:43 +00:00
Jenkins
8eb417130f Merge "Add docstrings for api/ tree" 2014-09-22 16:34:40 +00:00
Jim Rollenhagen
de2b004654 Delete unused method get_agent_mac_address()
Does what it says.

Change-Id: I01e20e3a1e7317c17da6fc04ee0b0a672cf8247b
2014-09-22 14:32:27 +00:00
Jim Rollenhagen
a524db83b6 Add docstrings for api/ tree
Does what it says.

Partial-Bug 1367915

Change-Id: Id1a718d652f6d98e6acb1d667f42d9c3cc82aef5
2014-09-22 07:31:09 -07:00
Jenkins
44bfb2b043 Merge "Add support to build iso image" 2014-09-19 17:05:24 +00:00
Jenkins
47cffdafc5 Merge "Preserve environment variables when doing sudo" 2014-09-19 17:05:18 +00:00
Jenkins
cdd9839155 Merge "Add docstrings for agent.py" 2014-09-19 16:51:47 +00:00
Ramakrishnan G
9f855a0bcf Preserve environment variables when doing sudo
This commit adds the '-E' option for all the sudo commands
in build script of agent which causes it to preserve environment
variables.

Change-Id: Ic3fbc4ee8189cc82ef99359bf61eef33dae40a5a
Closes-Bug: 1371418
2014-09-19 10:45:57 +05:30
Ramakrishnan G
8c2936027b Add support to build iso image
This script adds support to build iso image from the given
kernel and ramdisk

Change-Id: I15dd8b8663af15b4194299986792ad8e6487508b
Implements: blueprint ilo-virtualmedia-ipa
2014-09-17 21:34:48 +05:30
Josh Gachnang
0835d1648b Remove PyPy from default tox runlist
PyPy has been failing locally for a month or two. On Ubuntu 14.04: 
"No module named _bsddb", on 12.04: "Not a .py file: 
/data/dev/work/ironic-python-agent/.tox/pypy/build/setuptools/
setuptools/cli-32.exe"

PyPy isn't enabled as a job in the gate yet (even non-voting). Until 
we sort the gate out and fix the above errors, we should remove it 
from the default tox runlist.

Change-Id: I34c0a72edebc296b79c6058e64ffb98f60979bcb
2014-09-12 20:39:29 +00:00
Jenkins
fcb6d13d96 Merge "Enhance decorators in agent and automate creation of command_map" 2014-09-12 17:56:31 +00:00
Jim Rollenhagen
69884b669d Add docstrings for agent.py
Does what it says.

Partial-Bug: 1367915

Change-Id: If2617f30c75c4a844c20a60afa41330daf84053a
2014-09-11 16:50:33 -07:00
Szymon Wroblewski
324f037eb0 Enhance decorators in agent and automate creation of command_map
sync_command and async_command in ironic_python_agent/extensions/base.py
are implemented so that they change decorated method signature,
which is really bad practice. Example:

@sync_command
def orig_method(self, **kw):
...

sync_command decorator returns lambda which has one additional
argument 'command_name'

def sync_command(func):
    def decorated(self, command_name, **kw):
         ...
         func(self, **kw)
         ...
    return decorated

Additional parameter 'command_name' is moved from decorated function to
decorator signature in both decorators. Every call of decorated functions
is fixed, BaseAgentExtension.execute is updated to not send this extra
argument. BaseAgentExtension.__init__ automatically generates command_map
from decorated methods.

Change-Id: Iff0f495bc8d9c731892feb0f4759a7f10ee76328
Closes-Bug: 1314148
2014-09-11 10:49:33 +02:00
Jim Rollenhagen
a9f2179761 Fix exception that is not properly raised
This commit fixes an exception that was not properly raised, and
also makes the exception more relevant.

This also fixes an outstanding bug where, if the agent
was not associated with a node, get_node_uuid() would fail in an
unexpected manner.

Change-Id: Ifca474a73dd50b5fd2242e5b7e938a5db04f27a8
2014-09-10 14:53:37 -07:00
Jay Faulkner
123603edd9 Add missing "/files" to IPA image URLs
Corrects a 404 error when visiting these URLs.

Change-Id: I701186c0845f86ac0326efa148c3846ad0440786
2014-09-08 17:24:22 -07:00
Jay Faulkner
7d691f691d Fix minor documentation issues
I updated the URL to point to the correct path to the uploaded IPA
ramdisk, as well as adding a note about running IPA inside Virtual
Media.

Change-Id: Ib4f3da5ea9fd0172e9d4ff018fd5a2890ddb978b
2014-09-08 11:23:40 -07:00
Jay Faulkner
bd9219d6c7 Fix incorrect documentation
Two changes, first is that we now upload individual files instead of a
tarball of both. The other is a catch from Jim to properly use building.

Change-Id: Icfaccb190d066feee5f30aed83c1b830fbe9cd89
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
2014-09-08 09:35:22 -07:00
Jenkins
6026919ef3 Merge "Add vmedia boot support in IPA" 2014-09-03 19:46:27 +00:00
Ramakrishnan G
8c0584c121 Add vmedia boot support in IPA
This commit adds support for booting IPA from virtual
media cdrom.  When IPA is booted over virtual media cdrom,
the parameters to the IPA are passed in a text file within
the virtual media floppy.

Change-Id: Ia04585416aada85022af73fb2b945bd3895606f0
Closes-Bug: #1358723
2014-09-02 12:51:50 +05:30
Jim Rollenhagen
b6d1130510 Clean up image build script
This change allows the image build script to support the existing
jobs that build images for distribution, as well as future jobs that
build the image within devstack for testing.

Change-Id: I6cae0ce336fde872678fafe6ba2b31af465944a1
2014-08-26 13:08:04 -07:00
Jenkins
50b8f25653 Merge "Updated from global requirements" 2014-08-01 14:32:25 +00:00
Jay Faulkner
992c4b745d Prevent python 2.7 from being purged in container
Python 2.7 is being removed, somehow, despite python3 being specified.
This should fix the issue and make the container usable again.

Change-Id: Ida8aa7e527f8230cc893adf9192003340fc0dbf5
2014-07-31 15:11:04 -07:00
OpenStack Proposal Bot
b3a98fca4a Updated from global requirements
Change-Id: I4c28ee1bcbafba1cb2bab00463fe4354cd6ec25f
2014-07-30 15:55:02 -07:00
Jay Faulkner
fee7ca28b4 Bump IPA container to use Trusty
Bump IPA container to use trusty. This gives us a newer version of pip
which is required to install newer requirements that are packaged as
wheels.

Only other change to dockerfile is to ensure python 3 is
removed, in order to avoid raising the size of the container. After this
patch, the agent image goes up in size 3M, which is managable.

Change-Id: I11f39fadb87d42dd15885e6afc63df2c927ce771
2014-07-30 15:48:19 -07:00
Jenkins
e4f5984043 Merge "Bump CoreOS to latest stable" 2014-07-30 00:01:53 +00:00
Jim Rollenhagen
b0d989c245 Bump CoreOS to latest stable
Two reasons:

1) Use a build that is marked stable
2) Fixes an issue where boot hangs for minutes on updating CA
   things, which enables much faster deploy times.

Change-Id: Ic7fca96f0dfe87065e2df5feaf2c29efc662a0e1
2014-07-29 23:04:16 +00:00
Jenkins
557a50f41f Merge "Add support for psutil v1 as well as v2" 2014-07-29 21:57:25 +00:00
Jay Faulkner
39819644e5 Add support for psutil v1 as well as v2
Openstack global requirements updated to specify version 1 only, and we
only supported version 2.

Change-Id: Iee97e4b14cae00238028ef936d2f96fbc8e2604c
2014-07-29 13:43:54 -07:00
Jay Faulkner
965acb55ae Add two undeclared dependencies to the Dockerfile
While auditing our dependencies in antipiation of DIB elements being
created, I found these dependencies not being explicitly installed by
docker. We should explicitly install them even if we expect them to
exist in the base image.

Change-Id: I38ec7167ae24b9abbda08cbbbdd55205612b7288
2014-07-29 10:54:54 -07:00
Josh Gachnang
83782018f7 Improve Disk Detection
The previous implementation of list_block_devices used blockdev,
which would list partitions, software RAID and other devices as block devices.
By switching to lsblk, the agent can filter down to only physical block
devices, which is all the agent cares about for any of its operations.

This change adds two new fields to the BlockDevice class: model, a string of
the block devices reported model, and rotational, a boolean representing a
spinning disk (True) or a solid state disk (False). This data can be useful
for vendor hardware managers.

Change-Id: I385c3bb378c2c49385bca14a1d7efa074933becf
Closes-Bug: 1344351
2014-07-18 17:42:23 -07:00
Ellen Hui
5e1aa0a8f8 Fix no IP on interface error
Finding an IPv4 address to advertise fails and crashes if the
interface exists but has no valid IPs.  This can be fixed by
adding KeyError to the exceptions caught.

Change-Id: I60204427ec5201696d02c5c26f4b43a00d794413
Closes-Bug: #1342448
2014-07-16 00:35:28 +00:00
Jay Faulkner
edcf7b11b6 Migrate CoreOS to use coreos-cloudinit
http://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/
describes how to use coreos-cloudinit to configure a node. Migrate to
using this instead of a single BASH script (which is deprecated).

This also means we need the latest version of CoreOS, so I've updated
coreos-oem-inject.py to pull from the most recent copies, and this
includes moving to the amd64-usr builds.

Change-Id: I620b8fec1bfc5d58b560434d17b4f617734fadb8
2014-07-09 16:46:26 -07:00
Jay Faulkner
929824237c Install requirements for coreos-oem-inject.py
This script needs plumbum and requests, which are not installed by
default on bare-trusty.

Change-Id: I6bf1ebe66afcbbf47c5d9fe96d1a2b1b889882de
2014-07-03 13:16:43 -07:00
Jim Rollenhagen
2cc4517d7c Run make with sudo when building
When building, `make` ends up calling `docker`, which needs to be
done via sudo. This runs make with sudo.

Change-Id: I49558dff3a00e1795d3fe0489a2ff183f00e6183
2014-07-02 15:10:17 -07:00
Jim Rollenhagen
cf99515f97 Add current directory logging to build script
Helps debug post job.

Change-Id: Ia30a8b5511dc087ddd1ecdbfe8eb3ca1e63a0ad5
2014-07-02 11:04:00 -07:00
Jim Rollenhagen
07c4dfc707 Fix author/email in setup.cfg
This changes the email in setup.cfg from an internal Rackspace
email to the openstack-dev list, and the author to OpenStack.

Change-Id: Iebd652c157ba639c72898b7554a23fe9bed77c22
2014-07-01 16:16:08 -07:00
Kyle Stevenson
3c09b3975f Add support for passing no configdrive
Some people use metadata services, we should allow instances to be created without configdrive.

Change-Id: I5eb64b33291d6b975cf19357c04bf85066e4e3e8
2014-06-27 18:07:19 +00:00
Jay Faulkner
b4961f846e Add infra build script to IPA
We now do builds of the IPA CoreOS ramdisk in the post script. (Ref:
openstack-infra/config/tree/modules/openstack_project/files/
jenkins_job_builder/config/ironic-python-agent-jobs.yaml)
We should store the build script for this in the local repo so we can
modify it as needed without needing commits to openstack-infra/config.

Change-Id: I92655c0552179613c23b129d1e2dce2ef1643391
2014-06-25 17:22:13 -07:00
Mike Heald
d26bb42059 Converted documentation in md format to rst
Change-Id: I88c642a24fb032b6e0920c8ba378127f8e12116c
Closes-Bug: 1332741
2014-06-25 09:04:49 +01:00
Jay Faulkner
b5cd83b13c No longer recommend use of ipa-advertise-url
Because IPA now detects what IP to advertise, specifying this in the PXE
config should no longer be a recommended default.

Change-Id: I3a854fd07cd7987425288b61fd6eeac925db0bff
2014-06-24 15:39:55 -07:00
Jenkins
a4079e1075 Merge "Better errors for execute() failures" 2014-06-24 20:47:22 +00:00
Jim Rollenhagen
c5df7070af Better errors for execute() failures
Exceptions raised due to processutils.execute() failing now include
stdout and stderr.

Change-Id: Id5d1b5bc51d377f9f3c338cd7303ea800f76e5cd
2014-06-24 06:50:54 -07:00
Jenkins
8f32811710 Merge "Improve readme for CoreOS imagebuild" 2014-06-20 23:22:33 +00:00
Jay Faulkner
689430d69f Improve readme for CoreOS imagebuild
This:
  - includes a link to new gate-built images
  - updates the kernel command line options (none needed in newer
    images)

Change-Id: I79e9a0ab7de1dc61dd035bebf81c87136e4c3202
2014-06-20 15:53:51 -07:00
Jay Faulkner
b43c8c4c4e Fix comments to reflect reality
These comments were left in write_image.sh from the 'teeth-agent' days
when these were split into two scripts. I moved the comment into the
correct script and clarified what it means.

Change-Id: Iccdcd925be5c94d993d8125534264f496de4594f
2014-06-20 15:39:12 -07:00
Jay Faulkner
8e131e75e3 Fix invalid command in Dockerfile
This cleanup command was invalid. Not removing the apt lists adds a few
unneeded megabytes to the agent image.

Change-Id: I55ad4434d20a8984ea4cf5866360fd2622d811f4
2014-06-18 15:47:29 -07:00
Jenkins
d8f5eb963e Merge "Improve cache_image testing" 2014-06-17 00:17:29 +00:00
Jenkins
6c6f94bdda Merge "Remove duplicated test for caching image" 2014-06-17 00:16:17 +00:00