You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/08/23 14:18:31 UTC

[PATCH core] Added support files for CondorCloud and updated RPM spec to match latest version from Fedora

From: Michal Fojtik <mf...@redhat.com>

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/deltacloud-core.gemspec                     |    2 +
 server/support/condor/bash/cached_images.sh        |    8 +
 server/support/condor/bash/cloud_exit_hook.sh      |   17 ++
 server/support/condor/bash/cloud_functions         |  175 ++++++++++++++++++++
 server/support/condor/bash/cloud_prepare_hook.sh   |   20 +++
 server/support/condor/bash/libvirt_cloud_script.sh |   13 ++
 server/support/condor/config/50condor_cloud.config |   37 ++++
 .../condor/config/50condor_cloud_node.config       |   37 ++++
 server/support/condor/config/condor-cloud          |    2 +
 server/support/condor/config/condor_config.local   |   44 +++++
 server/support/fedora/deltacloud-core.spec         |  145 ++++++++++++----
 11 files changed, 465 insertions(+), 35 deletions(-)
 create mode 100644 server/support/condor/bash/cached_images.sh
 create mode 100644 server/support/condor/bash/cloud_exit_hook.sh
 create mode 100644 server/support/condor/bash/cloud_functions
 create mode 100644 server/support/condor/bash/cloud_prepare_hook.sh
 create mode 100644 server/support/condor/bash/libvirt_cloud_script.sh
 create mode 100644 server/support/condor/config/50condor_cloud.config
 create mode 100644 server/support/condor/config/50condor_cloud_node.config
 create mode 100644 server/support/condor/config/condor-cloud
 create mode 100644 server/support/condor/config/condor_config.local

diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
index 4667dfa..293d783 100644
--- a/server/deltacloud-core.gemspec
+++ b/server/deltacloud-core.gemspec
@@ -43,6 +43,8 @@ Gem::Specification.new do |s|
     'config/*.xml',
     'tmp',
     'support/fedora/**',
+    'support/condor/bash/**',
+    'support/condor/config/**',
     'lib/**/*.rb',
     'lib/**/*.yml',
     'tests/**/*.rb',
diff --git a/server/support/condor/bash/cached_images.sh b/server/support/condor/bash/cached_images.sh
new file mode 100644
index 0000000..bccfd4b
--- /dev/null
+++ b/server/support/condor/bash/cached_images.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+source /usr/libexec/condor/cloud_functions
+
+cd $CACHE
+echo "CACHED_IMAGES=\"$(echo * | tr ' ' '\n' | grep -v -e '*' -e .qcow2 | tr '\n' ',')\""
+
+exit 0
diff --git a/server/support/condor/bash/cloud_exit_hook.sh b/server/support/condor/bash/cloud_exit_hook.sh
new file mode 100644
index 0000000..2f47ae0
--- /dev/null
+++ b/server/support/condor/bash/cloud_exit_hook.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+source /usr/libexec/condor/cloud_functions
+
+while read line; do
+   name="${line%% =*}"
+   value="${line#*= }"
+   case $name in
+     VM_XML ) VM_XML="$line" ;;
+   esac
+done
+
+DISK=$(echo $VM_XML | sed "s:.*<source file='\([^']*\)'/>.*:\1:")
+
+rm -f $DISK
+
+exit 0
diff --git a/server/support/condor/bash/cloud_functions b/server/support/condor/bash/cloud_functions
new file mode 100644
index 0000000..7b8fcb9
--- /dev/null
+++ b/server/support/condor/bash/cloud_functions
@@ -0,0 +1,175 @@
+source /etc/sysconfig/condor-cloud
+
+ERROR_MSG=
+
+MISSING_DEPS=
+which qemu-img > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+   MISSING_DEPS="$MISSING_DEPS qemu-img"
+   return 1
+fi
+
+#
+# image_exists_global <image>
+#
+# Test to see if the given image is in the global image store. 0 is
+# returned if the image is present, 1 otherwise.
+#
+# This implementation uses the filesystem path $STORAGE as the global
+# store.
+#
+function image_exists_global {
+   IMAGE=$1
+   test -e $STORAGE/$IMAGE
+}
+
+#
+# image_exists_local <image>
+#
+# Test to see if the given image is in the local image store. 0 is
+# returned if the image is present, 1 otherwise.
+#
+# This implementation uses the filesystem path $CACHE as the local
+# store.
+#
+function image_exists_local {
+   IMAGE=$1
+   test -e $CACHE/$IMAGE
+}
+
+#
+# put_image <image>
+#
+# Put the image passed as the first argument, into the global image
+# store.  Return 0 on success and 1 on any failure.
+#
+# This implementation uses the filesystem path $STORAGE as the global
+# store.
+#
+function put_image {
+   IMAGE=$1
+   IMAGE_NAME=$(basename $IMAGE)
+
+   LOCK="$STORAGE/$IMAGE_NAME.lock"
+
+   CAT=cat; which pv > /dev/null 2>&1 && CAT=pv
+
+   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
+      echo "$LOCK held by $(cat $LOCK)" >2
+      sleep $((RANDOM % 29))
+   done
+
+   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
+
+   RC=0
+   if ! image_exists_global $IMAGE_NAME; then
+      trap 'rm -f $LOCK; rm -f $STORAGE/$IMAGE_NAME; exit $?' INT TERM EXIT
+      ERROR_MSG=$($CAT $IMAGE > $STORAGE/$IMAGE_NAME)
+      if [ $? -eq 0 ]; then
+         # Permissions on the image are entirely open
+         chmod a=r $STORAGE/$IMAGE_NAME
+      else
+         RC=1
+      fi
+   fi
+
+   rm -f $LOCK; trap - INT TERM EXIT
+
+   return $RC
+}
+
+#
+# get_image <image>
+#
+# Get an image from the global image store and make a copy locally for
+# use by guest VMs. Return 0 on success and 1 on any failure.
+#
+# This implementation uses the filesystem path $STORAGE as the global
+# store and $CACHE as the local.
+#
+function get_image {
+   IMAGE=$1
+
+   LOCK="$CACHE/$IMAGE.lock"
+
+   if ! image_exists_global $IMAGE; then
+      ERROR_MSG="$STORAGE/$IMAGE not found"
+      return 1
+   fi
+
+   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
+      echo "$LOCK held by $(cat $LOCK)" >2
+      sleep $((RANDOM % 29))
+   done
+
+   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
+
+   if ! image_exists_local $IMAGE; then
+      trap 'rm -f $LOCK; rm -f $CACHE/$IMAGE; exit $?' INT TERM EXIT
+      ERROR_MSG=$(cp $STORAGE/$IMAGE $CACHE/$IMAGE)
+      if [ $? -ne 0 ]; then
+         return 1
+      fi
+
+      # libvirt chowns the qcow2 image to qemu.qemu so that qemu can
+      # read/write it. The base image is not chowned, so we must make sure
+      # it is readable by qemu. If this is not done, a common VMGahpLog
+      # error will be:
+      #   Failed to create libvirt domain: monitor socket did not show up.:
+      #    No such file or directory
+      # Other than readable, no one should ever write to the file, so write
+      # perms are removed.
+      chmod a+r $CACHE/$IMAGE
+   fi
+
+   rm -f $LOCK
+   trap - INT TERM EXIT
+
+   return 0
+}
+
+#
+# make_image <image>
+#
+# Create a qcow2 image based off the given image and place it in the
+# local image store. The qcow2 image is echo'd to stdout. The return
+# value has no meaning.
+#
+# This implementation uses the filesystem path $CACHE as the local
+# store.
+#
+function make_image {
+   BASE_IMAGE=$1
+   LOCATION=$2
+
+   LOCK="$CACHE/$BASE_IMAGE.lock"
+
+   if ! image_exists_local $BASE_IMAGE; then
+      ERROR_MSG="$BASE_IMAGE not found"
+      return 1
+   fi
+
+   #
+   # Use the $LOCK as a barrier in case the image is concurrently
+   # being added to the $CACHE. Granted, that is a case that should
+   # never happen. Unfortunately, the existence of the $LOCK cannot be
+   # used as an assertion condition because a concurrent get_image
+   # will briefly create $LOCK even when the $BASE_IMAGE is already in
+   # the $CACHE.
+   #
+   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
+      echo "$LOCK held by $(cat $LOCK)" >2
+      sleep $((RANDOM % 29))
+   done
+   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
+
+   IMAGE=$LOCATION/$BASE_IMAGE.qcow2
+
+   qemu-img create -f qcow2 -b $CACHE/$BASE_IMAGE $IMAGE > /dev/null 2>&1
+   # XXX: test for success, give return value meaning
+
+   rm -f $LOCK
+
+   echo $IMAGE
+   return 0
+}
diff --git a/server/support/condor/bash/cloud_prepare_hook.sh b/server/support/condor/bash/cloud_prepare_hook.sh
new file mode 100644
index 0000000..bdfec08
--- /dev/null
+++ b/server/support/condor/bash/cloud_prepare_hook.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+source /usr/libexec/condor/cloud_functions
+
+while read line; do
+   name="${line%% =*}"
+   value="${line#*= }"
+   case $name in
+     cloud_image ) BASE_IMAGE="$(echo $value | tr -d '\"')" ;;
+     VM_XML ) VM_XML="$line" ;;
+   esac
+done
+
+get_image $BASE_IMAGE
+
+IMAGE=$(make_image $BASE_IMAGE $PWD)
+
+echo $(echo $VM_XML | sed "s:{DISK}:$IMAGE:")
+
+exit 0
diff --git a/server/support/condor/bash/libvirt_cloud_script.sh b/server/support/condor/bash/libvirt_cloud_script.sh
new file mode 100644
index 0000000..1b591a2
--- /dev/null
+++ b/server/support/condor/bash/libvirt_cloud_script.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+while read line; do
+   line=$(echo "$line" | tr -d '"')
+   name="${line%% =*}"
+   value="${line#*= }"
+   case $name in
+     VMPARAM_VM_NAME ) NAME="$value" ;;
+     VM_XML ) VM_XML="$value" ;;
+   esac
+done
+
+echo $(echo $VM_XML | sed "s:{NAME}:$NAME:")
diff --git a/server/support/condor/config/50condor_cloud.config b/server/support/condor/config/50condor_cloud.config
new file mode 100644
index 0000000..5e1f088
--- /dev/null
+++ b/server/support/condor/config/50condor_cloud.config
@@ -0,0 +1,37 @@
+DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
+
+GRIDMANAGER_JOB_PROBE_INTERVAL = 30
+
+FILESYSTEM_DOMAIN = condor_cloud
+
+VM_GAHP_DEBUG = D_FULLDEBUG
+
+VM_GAHP_SEND_ALL_CLASSAD = TRUE
+VM_GAHP_LOG = $(LOG)/VMGahpLog
+VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
+VM_TYPE = kvm
+VM_MEMORY = $(MEMORY)
+VM_NETWORKING = TRUE
+VM_NETWORKING_TYPE = bridge,nat
+VM_NETWORKING_BRIDGE_INTERFACE = vnet0
+
+LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
+
+
+# Hook must be go=rx
+CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
+CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
+
+# Advertise set of images available on this node
+STARTD_CRON_JOBLIST = CACHED_IMAGES
+STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
+STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
+
+START = true
+
+#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
+#SLOT_TYPE_1_PARTITIONABLE = TRUE
+#NUM_SLOTS = 1
+#NUM_SLOTS_TYPE_1 = 1
+NUM_CPUS = $(DETECTED_CORES) * 4
+MEMORY = $(DETECTED_MEMORY) * 4
diff --git a/server/support/condor/config/50condor_cloud_node.config b/server/support/condor/config/50condor_cloud_node.config
new file mode 100644
index 0000000..bd7566f
--- /dev/null
+++ b/server/support/condor/config/50condor_cloud_node.config
@@ -0,0 +1,37 @@
+DAEMON_LIST = MASTER, STARTD
+
+GRIDMANAGER_JOB_PROBE_INTERVAL = 30
+
+FILESYSTEM_DOMAIN = condor_cloud
+
+VM_GAHP_DEBUG = D_FULLDEBUG
+
+VM_GAHP_SEND_ALL_CLASSAD = TRUE
+VM_GAHP_LOG = $(LOG)/VMGahpLog
+VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
+VM_TYPE = kvm
+VM_MEMORY = $(MEMORY)
+VM_NETWORKING = TRUE
+VM_NETWORKING_TYPE = bridge,nat
+VM_NETWORKING_BRIDGE_INTERFACE = vnet0
+
+LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
+
+
+# Hook must be go=rx
+CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
+CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
+
+# Advertise set of images available on this node
+STARTD_CRON_JOBLIST = CACHED_IMAGES
+STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
+STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
+
+START = true
+
+#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
+#SLOT_TYPE_1_PARTITIONABLE = TRUE
+#NUM_SLOTS = 1
+#NUM_SLOTS_TYPE_1 = 1
+NUM_CPUS = $(DETECTED_CORES) * 4
+MEMORY = $(DETECTED_MEMORY) * 4
diff --git a/server/support/condor/config/condor-cloud b/server/support/condor/config/condor-cloud
new file mode 100644
index 0000000..42e4627
--- /dev/null
+++ b/server/support/condor/config/condor-cloud
@@ -0,0 +1,2 @@
+STORAGE=/var/lib/condor-cloud/shared_images
+CACHE=/var/lib/condor-cloud/local_cache
diff --git a/server/support/condor/config/condor_config.local b/server/support/condor/config/condor_config.local
new file mode 100644
index 0000000..6f574a6
--- /dev/null
+++ b/server/support/condor/config/condor_config.local
@@ -0,0 +1,44 @@
+ALLOW_WRITE = *
+ALLOW_ADMINISTRATOR = *
+ALLOW_NEGOTIATOR = *
+ALLOW_NEGOTIATOR_SCHEDD = *
+COLLECTOR_HOST = localhost
+
+DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
+
+GRIDMANAGER_JOB_PROBE_INTERVAL = 30
+
+GRIDMANAGER_DEBUG = D_FULLDEBUG
+NEGOTIATOR_DEBUG = D_FULLDEBUG
+COLLECTOR_DEBUG = D_FULLDEBUG
+VM_GAHP_DEBUG = D_FULLDEBUG
+
+VM_GAHP_SEND_ALL_CLASSAD = TRUE
+VM_GAHP_LOG = $(LOG)/VMGahpLog
+VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
+VM_TYPE = kvm
+VM_MEMORY = $(MEMORY)
+VM_NETWORKING = TRUE
+VM_NETWORKING_TYPE = bridge,nat
+VM_NETWORKING_BRIDGE_INTERFACE = vnet0
+
+LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
+
+
+# Hook must be go=rx
+CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
+CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
+
+# Advertise set of images available on this node
+STARTD_CRON_JOBLIST = CACHED_IMAGES
+STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
+STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
+
+START = true
+
+#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
+#SLOT_TYPE_1_PARTITIONABLE = TRUE
+#NUM_SLOTS = 1
+#NUM_SLOTS_TYPE_1 = 1
+#NUM_CPUS = $(DETECTED_CORES) * 4
+MEMORY = $(DETECTED_MEMORY) * 4
diff --git a/server/support/fedora/deltacloud-core.spec b/server/support/fedora/deltacloud-core.spec
index 0048336..5f5f8d7 100644
--- a/server/support/fedora/deltacloud-core.spec
+++ b/server/support/fedora/deltacloud-core.spec
@@ -1,9 +1,10 @@
 %global app_root %{_datadir}/%{name}
+%%global alphatag git
 
 Summary: Deltacloud REST API
 Name: deltacloud-core
-Version: 0.3.0
-Release: 12%{?dist}
+Version: 0.4.0
+Release: 0.1.%{alphatag}
 Group: Development/Languages
 License: ASL 2.0 and MIT
 URL: http://incubator.apache.org/deltacloud
@@ -12,6 +13,7 @@ Source1: deltacloudd-fedora
 Source2: deltacloud-core
 Source3: deltacloud-core-config
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: rubygems
 Requires: ruby(abi) = 1.8
 Requires: rubygem(haml)
@@ -41,7 +43,6 @@ BuildRequires: rubygem(rspec) >= 1.3.0
 BuildRequires: rubygem(json) >= 1.4.0
 BuildArch: noarch
 Obsoletes: rubygem-deltacloud-core
-Provides: rubygem(deltacloud-core)
 
 %description
 The Deltacloud API is built as a service-based REST API.
@@ -60,28 +61,26 @@ Documentation for %{name}
 %package all
 Summary: Deltacloud Core with all drivers
 Requires: %{name} = %{version}-%{release}
-Requires: deltacloud-core-azure
 Requires: deltacloud-core-ec2
-Requires: deltacloud-core-gogrid
-Requires: deltacloud-core-mock
-Requires: deltacloud-core-opennebula
 Requires: deltacloud-core-rackspace
-Requires: deltacloud-core-rhevm
+Requires: deltacloud-core-gogrid
 Requires: deltacloud-core-rimuhosting
+Requires: deltacloud-core-rhevm
 Requires: deltacloud-core-sbc
-Requires: deltacloud-core-terremark
 
 %description all
 Deltacloud core with all available drivers
 
-%package azure
-Summary: Deltacloud Core for Azure
-Requires: %{name} = %{version}-%{release}
-Requires: rubygem(waz-blobs)
+# FIXME: Azure requires waz-blobs gem which is not yet included in Fedora repos
+#
+#%package azure
+#Summary: Deltacloud Core for Azure
+#Requires: %{name} = %{version}-%{release}
+#Requires: rubygem(waz-blobs)
 
-%description azure
-The azure sub-package brings in all dependencies necessary to use deltacloud
-core to connect to Azure.
+#%description azure
+#The azure sub-package brings in all dependencies necessary to use deltacloud
+#core to connect to Azure.
 
 %package ec2
 Summary: Deltacloud Core for EC2
@@ -92,6 +91,15 @@ Requires: rubygem(aws)
 The ec2 sub-package brings in all dependencies necessary to use deltacloud
 core to connect to EC2.
 
+%package eucalyptus
+Summary: Deltacloud Core for Eucalyptus
+Requires: %{name} = %{version}-%{release}
+Requires: rubygem(aws)
+
+%description eucalyptus
+The eucalyptus sub-package brings in all dependencies necessary to use deltacloud
+core to connect to EC2.
+
 %package gogrid
 Summary: Deltacloud Core for GoGrid
 Requires: %{name} = %{version}-%{release}
@@ -100,14 +108,6 @@ Requires: %{name} = %{version}-%{release}
 The gogrid sub-package brings in all dependencies necessary to use deltacloud
 core to connect to GoGrid.
 
-%package mock
-Summary: Deltacloud Core for Mock
-Requires: %{name} = %{version}-%{release}
-
-%description mock
-The mock sub-package brings in all dependencies necessary to use deltacloud
-core to connect to Mock.
-
 %package opennebula
 Summary: Deltacloud Core for OpenNebula
 Requires: %{name} = %{version}-%{release}
@@ -135,6 +135,15 @@ Requires: rubygem(rest-client)
 The rhevm sub-package brings in all dependencies necessary to use deltacloud
 core to connect to RHEV-M.
 
+%package vsphere
+Summary: Deltacloud Core for vSphere
+Requires: %{name} = %{version}-%{release}
+Requires: rubygem(rbvmomi)
+
+%description vsphere
+The vsphere sub-package brings in all dependencies necessary to use deltacloud
+core to connect to VMware vSphere.
+
 %package rimuhosting
 Summary: Deltacloud Core for Rimuhosting
 Requires: %{name} = %{version}-%{release}
@@ -151,6 +160,19 @@ Requires: %{name} = %{version}-%{release}
 The sbc sub-package brings in all dependencies necessary to use deltacloud core
 to connect to SBC.
 
+%package condor
+Summary: Deltacloud Core for CondorCloud
+Requires: %{name} = %{version}-%{release}
+Requires: rubygem(uuid)
+Requires: rubygem(rest-client)
+Requires: condor >= 7.4.0
+# FIXME: condor-vm-gaph is not yet included in Fedora
+# Requires: condor-vm-gaph >= 7.4.0
+
+%description condor
+The condor sub-package brings in all dependencies necessary to use deltacloud core
+to connect to CondorCloud.
+
 %package terremark
 Summary: Deltacloud Core for Terremark
 Requires: %{name} = %{version}-%{release}
@@ -183,11 +205,23 @@ find %{buildroot}%{app_root}/lib -type f | xargs chmod -x
 chmod -x %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 chmod 0755 %{buildroot}%{_initddir}/%{name}
 chmod 0755 %{buildroot}%{app_root}/bin/deltacloudd
-rm -rf %{buildroot}%{app_root}/support
+# Temporary remove Azure drivers until all dependencies will be pushed in to Fedora
+rm -rf %{buildroot}%{app_root}/config/drivers/azure.yaml
+rm -rf %{buildroot}%{app_root}/support/fedora
 rdoc --op %{buildroot}%{_defaultdocdir}/%{name}
 
+%install condor
+install -m 0655 %{buildroot}%{app_root}/support/condor/config/condor-cloud \
+  %{buildroot}%{_sysconfdir}/sysconfig/condor-cloud
+install -m 0655 %{buildroot}%{app_root}/support/condor/config/50* \
+  %{buildroot}%{_sysconfdir}/condor/config.d
+install -m 0755 %{buildroot}%{app_root}/support/condor/bash/* \
+  %{buildroot}%{_libexecdir}/condor
+rm -rf %{buildroot}%{app_root}/support/condor
+
 %check
 pushd %{buildroot}%{app_root}
+rake mock:fixtures:clean
 rake test:mock
 popd
 
@@ -219,7 +253,8 @@ fi
 %{app_root}/*.rb
 %{app_root}/views
 %{app_root}/lib
-%{app_root}/config
+%dir %{app_root}/config/drivers
+%{app_root}/config/drivers/mock.yaml
 %dir %{app_root}/public
 %{app_root}/public/images
 %{app_root}/public/stylesheets
@@ -237,42 +272,82 @@ fi
 %{app_root}/%{name}.gemspec
 %{app_root}/Rakefile
 
-%files all
-%defattr(-, root, root, -)
-
-%files azure
-%defattr(-, root, root, -)
+#%files azure
+#%defattr(-, root, root, -)
 
 %files ec2
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/ec2.yaml
 
-%files gogrid
+%files eucalyptus
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/eucalyptus.yaml
 
-%files mock
+%files gogrid
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/gogrid.yaml
 
 %files opennebula
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/opennebula.yaml
 
 %files rackspace
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/rackspace.yaml
 
 %files rhevm
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/rhevm.yaml
 
 %files rimuhosting
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/rimuhosting.yaml
 
 %files sbc
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/sbc.yaml
+
+%files vsphere
+%defattr(-, root, root, -)
+%{app_root}/config/drivers/vsphere.yaml
 
 %files terremark
 %defattr(-, root, root, -)
+%{app_root}/config/drivers/terremark.yaml
+
+%files condor
+%defattr(-, root, root, -)
+%{app_root}/config/drivers/condor.yaml
+%{app_root}/config/condor.yaml
+%{app_root}/config/addresses.xml
+%%config(noreplace) %{_sysconfdir}/sysconfig/condor-cloud
+%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud.config
+%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud_node.config
+%{_libexecdir}/condor/cached_images.sh
+%{_libexecdir}/condor/cloud_exit_hook.sh
+%{_libexecdir}/condor/cloud_functions
+%{_libexecdir}/condor/cloud_prepare_hook.sh
+%{_libexecdir}/condor/libvirt_cloud_script.sh
+
+%files all
+%defattr(-, root, root, -)
 
 %changelog
-* Mon Aug 01 2011 Chris Lalancette <cl...@redhat.com> - 0.3.0-12
-- Add the -all package
+* Mon Jul 26 2011 Michal Fojtik <mf...@redhat.com> - 0.4.0-0.1.git
+- Deltacloud core GIT build
+
+* Mon Jul 11 2011 Michal Fojtik <mf...@redhat.com> - 0.4.0-1
+- Version bump to 0.4.0
+- Added CondorCloud driver
+
+* Mon Jul 11 2011 Michal Fojtik <mf...@redhat.com> - 0.3.0-11
+- Added virtual package with all drivers
+
+* Fri Jun 7 2011 Michal Fojtik <mf...@redhat.com> - 0.3.0-10
+- Added patch to handle long usernames
+
+* Fri Jun 3 2011 Michal Fojtik <mf...@redhat.com> - 0.3.0-9
+- Removed Azure and Terremark driver because of unsatisfied dependencies
 
 * Tue May 31 2011 Chris Lalancette <cl...@redhat.com> - 0.3.0-8
 - Create sub-packages to bring in dependencies
-- 
1.7.4.1


Re: [PATCH core] Added support files for CondorCloud and updated RPM spec to match latest version from Fedora

Posted by Michal Fojtik <mf...@redhat.com>.
On Aug 23, 2011, at 2:18 PM, mfojtik@redhat.com wrote:

> From: Michal Fojtik <mf...@redhat.com>
> 
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---
> server/deltacloud-core.gemspec                     |    2 +
> server/support/condor/bash/cached_images.sh        |    8 +
> server/support/condor/bash/cloud_exit_hook.sh      |   17 ++
> server/support/condor/bash/cloud_functions         |  175 ++++++++++++++++++++
> server/support/condor/bash/cloud_prepare_hook.sh   |   20 +++
> server/support/condor/bash/libvirt_cloud_script.sh |   13 ++
> server/support/condor/config/50condor_cloud.config |   37 ++++
> .../condor/config/50condor_cloud_node.config       |   37 ++++
> server/support/condor/config/condor-cloud          |    2 +
> server/support/condor/config/condor_config.local   |   44 +++++
> server/support/fedora/deltacloud-core.spec         |  145 ++++++++++++----
> 11 files changed, 465 insertions(+), 35 deletions(-)
> create mode 100644 server/support/condor/bash/cached_images.sh
> create mode 100644 server/support/condor/bash/cloud_exit_hook.sh
> create mode 100644 server/support/condor/bash/cloud_functions
> create mode 100644 server/support/condor/bash/cloud_prepare_hook.sh
> create mode 100644 server/support/condor/bash/libvirt_cloud_script.sh
> create mode 100644 server/support/condor/config/50condor_cloud.config
> create mode 100644 server/support/condor/config/50condor_cloud_node.config
> create mode 100644 server/support/condor/config/condor-cloud
> create mode 100644 server/support/condor/config/condor_config.local
> 
> diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
> index 4667dfa..293d783 100644
> --- a/server/deltacloud-core.gemspec
> +++ b/server/deltacloud-core.gemspec
> @@ -43,6 +43,8 @@ Gem::Specification.new do |s|
>     'config/*.xml',
>     'tmp',
>     'support/fedora/**',
> +    'support/condor/bash/**',
> +    'support/condor/config/**',
>     'lib/**/*.rb',
>     'lib/**/*.yml',
>     'tests/**/*.rb',
> diff --git a/server/support/condor/bash/cached_images.sh b/server/support/condor/bash/cached_images.sh
> new file mode 100644
> index 0000000..bccfd4b
> --- /dev/null
> +++ b/server/support/condor/bash/cached_images.sh
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +source /usr/libexec/condor/cloud_functions
> +
> +cd $CACHE
> +echo "CACHED_IMAGES=\"$(echo * | tr ' ' '\n' | grep -v -e '*' -e .qcow2 | tr '\n' ',')\""
> +
> +exit 0
> diff --git a/server/support/condor/bash/cloud_exit_hook.sh b/server/support/condor/bash/cloud_exit_hook.sh
> new file mode 100644
> index 0000000..2f47ae0
> --- /dev/null
> +++ b/server/support/condor/bash/cloud_exit_hook.sh
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +source /usr/libexec/condor/cloud_functions
> +
> +while read line; do
> +   name="${line%% =*}"
> +   value="${line#*= }"
> +   case $name in
> +     VM_XML ) VM_XML="$line" ;;
> +   esac
> +done
> +
> +DISK=$(echo $VM_XML | sed "s:.*<source file='\([^']*\)'/>.*:\1:")
> +
> +rm -f $DISK
> +
> +exit 0
> diff --git a/server/support/condor/bash/cloud_functions b/server/support/condor/bash/cloud_functions
> new file mode 100644
> index 0000000..7b8fcb9
> --- /dev/null
> +++ b/server/support/condor/bash/cloud_functions
> @@ -0,0 +1,175 @@
> +source /etc/sysconfig/condor-cloud
> +
> +ERROR_MSG=
> +
> +MISSING_DEPS=
> +which qemu-img > /dev/null 2>&1
> +if [ $? -ne 0 ]; then
> +   MISSING_DEPS="$MISSING_DEPS qemu-img"
> +   return 1
> +fi
> +
> +#
> +# image_exists_global <image>
> +#
> +# Test to see if the given image is in the global image store. 0 is
> +# returned if the image is present, 1 otherwise.
> +#
> +# This implementation uses the filesystem path $STORAGE as the global
> +# store.
> +#
> +function image_exists_global {
> +   IMAGE=$1
> +   test -e $STORAGE/$IMAGE
> +}
> +
> +#
> +# image_exists_local <image>
> +#
> +# Test to see if the given image is in the local image store. 0 is
> +# returned if the image is present, 1 otherwise.
> +#
> +# This implementation uses the filesystem path $CACHE as the local
> +# store.
> +#
> +function image_exists_local {
> +   IMAGE=$1
> +   test -e $CACHE/$IMAGE
> +}
> +
> +#
> +# put_image <image>
> +#
> +# Put the image passed as the first argument, into the global image
> +# store.  Return 0 on success and 1 on any failure.
> +#
> +# This implementation uses the filesystem path $STORAGE as the global
> +# store.
> +#
> +function put_image {
> +   IMAGE=$1
> +   IMAGE_NAME=$(basename $IMAGE)
> +
> +   LOCK="$STORAGE/$IMAGE_NAME.lock"
> +
> +   CAT=cat; which pv > /dev/null 2>&1 && CAT=pv
> +
> +   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
> +      echo "$LOCK held by $(cat $LOCK)" >2
> +      sleep $((RANDOM % 29))
> +   done
> +
> +   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
> +
> +   RC=0
> +   if ! image_exists_global $IMAGE_NAME; then
> +      trap 'rm -f $LOCK; rm -f $STORAGE/$IMAGE_NAME; exit $?' INT TERM EXIT
> +      ERROR_MSG=$($CAT $IMAGE > $STORAGE/$IMAGE_NAME)
> +      if [ $? -eq 0 ]; then
> +         # Permissions on the image are entirely open
> +         chmod a=r $STORAGE/$IMAGE_NAME
> +      else
> +         RC=1
> +      fi
> +   fi
> +
> +   rm -f $LOCK; trap - INT TERM EXIT
> +
> +   return $RC
> +}
> +
> +#
> +# get_image <image>
> +#
> +# Get an image from the global image store and make a copy locally for
> +# use by guest VMs. Return 0 on success and 1 on any failure.
> +#
> +# This implementation uses the filesystem path $STORAGE as the global
> +# store and $CACHE as the local.
> +#
> +function get_image {
> +   IMAGE=$1
> +
> +   LOCK="$CACHE/$IMAGE.lock"
> +
> +   if ! image_exists_global $IMAGE; then
> +      ERROR_MSG="$STORAGE/$IMAGE not found"
> +      return 1
> +   fi
> +
> +   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
> +      echo "$LOCK held by $(cat $LOCK)" >2
> +      sleep $((RANDOM % 29))
> +   done
> +
> +   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
> +
> +   if ! image_exists_local $IMAGE; then
> +      trap 'rm -f $LOCK; rm -f $CACHE/$IMAGE; exit $?' INT TERM EXIT
> +      ERROR_MSG=$(cp $STORAGE/$IMAGE $CACHE/$IMAGE)
> +      if [ $? -ne 0 ]; then
> +         return 1
> +      fi
> +
> +      # libvirt chowns the qcow2 image to qemu.qemu so that qemu can
> +      # read/write it. The base image is not chowned, so we must make sure
> +      # it is readable by qemu. If this is not done, a common VMGahpLog
> +      # error will be:
> +      #   Failed to create libvirt domain: monitor socket did not show up.:
> +      #    No such file or directory
> +      # Other than readable, no one should ever write to the file, so write
> +      # perms are removed.
> +      chmod a+r $CACHE/$IMAGE
> +   fi
> +
> +   rm -f $LOCK
> +   trap - INT TERM EXIT
> +
> +   return 0
> +}
> +
> +#
> +# make_image <image>
> +#
> +# Create a qcow2 image based off the given image and place it in the
> +# local image store. The qcow2 image is echo'd to stdout. The return
> +# value has no meaning.
> +#
> +# This implementation uses the filesystem path $CACHE as the local
> +# store.
> +#
> +function make_image {
> +   BASE_IMAGE=$1
> +   LOCATION=$2
> +
> +   LOCK="$CACHE/$BASE_IMAGE.lock"
> +
> +   if ! image_exists_local $BASE_IMAGE; then
> +      ERROR_MSG="$BASE_IMAGE not found"
> +      return 1
> +   fi
> +
> +   #
> +   # Use the $LOCK as a barrier in case the image is concurrently
> +   # being added to the $CACHE. Granted, that is a case that should
> +   # never happen. Unfortunately, the existence of the $LOCK cannot be
> +   # used as an assertion condition because a concurrent get_image
> +   # will briefly create $LOCK even when the $BASE_IMAGE is already in
> +   # the $CACHE.
> +   #
> +   while ! ( set -o noclobber; echo "$$" > $LOCK ) 2> /dev/null; do
> +      echo "$LOCK held by $(cat $LOCK)" >2
> +      sleep $((RANDOM % 29))
> +   done
> +   trap 'rm -f $LOCK; exit $?' INT TERM EXIT
> +
> +   IMAGE=$LOCATION/$BASE_IMAGE.qcow2
> +
> +   qemu-img create -f qcow2 -b $CACHE/$BASE_IMAGE $IMAGE > /dev/null 2>&1
> +   # XXX: test for success, give return value meaning
> +
> +   rm -f $LOCK
> +
> +   echo $IMAGE
> +   return 0
> +}
> diff --git a/server/support/condor/bash/cloud_prepare_hook.sh b/server/support/condor/bash/cloud_prepare_hook.sh
> new file mode 100644
> index 0000000..bdfec08
> --- /dev/null
> +++ b/server/support/condor/bash/cloud_prepare_hook.sh
> @@ -0,0 +1,20 @@
> +#!/bin/sh
> +
> +source /usr/libexec/condor/cloud_functions
> +
> +while read line; do
> +   name="${line%% =*}"
> +   value="${line#*= }"
> +   case $name in
> +     cloud_image ) BASE_IMAGE="$(echo $value | tr -d '\"')" ;;
> +     VM_XML ) VM_XML="$line" ;;
> +   esac
> +done
> +
> +get_image $BASE_IMAGE
> +
> +IMAGE=$(make_image $BASE_IMAGE $PWD)
> +
> +echo $(echo $VM_XML | sed "s:{DISK}:$IMAGE:")
> +
> +exit 0
> diff --git a/server/support/condor/bash/libvirt_cloud_script.sh b/server/support/condor/bash/libvirt_cloud_script.sh
> new file mode 100644
> index 0000000..1b591a2
> --- /dev/null
> +++ b/server/support/condor/bash/libvirt_cloud_script.sh
> @@ -0,0 +1,13 @@
> +#!/bin/sh
> +
> +while read line; do
> +   line=$(echo "$line" | tr -d '"')
> +   name="${line%% =*}"
> +   value="${line#*= }"
> +   case $name in
> +     VMPARAM_VM_NAME ) NAME="$value" ;;
> +     VM_XML ) VM_XML="$value" ;;
> +   esac
> +done
> +
> +echo $(echo $VM_XML | sed "s:{NAME}:$NAME:")
> diff --git a/server/support/condor/config/50condor_cloud.config b/server/support/condor/config/50condor_cloud.config
> new file mode 100644
> index 0000000..5e1f088
> --- /dev/null
> +++ b/server/support/condor/config/50condor_cloud.config
> @@ -0,0 +1,37 @@
> +DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
> +
> +GRIDMANAGER_JOB_PROBE_INTERVAL = 30
> +
> +FILESYSTEM_DOMAIN = condor_cloud
> +
> +VM_GAHP_DEBUG = D_FULLDEBUG
> +
> +VM_GAHP_SEND_ALL_CLASSAD = TRUE
> +VM_GAHP_LOG = $(LOG)/VMGahpLog
> +VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
> +VM_TYPE = kvm
> +VM_MEMORY = $(MEMORY)
> +VM_NETWORKING = TRUE
> +VM_NETWORKING_TYPE = bridge,nat
> +VM_NETWORKING_BRIDGE_INTERFACE = vnet0
> +
> +LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
> +
> +
> +# Hook must be go=rx
> +CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
> +CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
> +
> +# Advertise set of images available on this node
> +STARTD_CRON_JOBLIST = CACHED_IMAGES
> +STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
> +STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
> +
> +START = true
> +
> +#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
> +#SLOT_TYPE_1_PARTITIONABLE = TRUE
> +#NUM_SLOTS = 1
> +#NUM_SLOTS_TYPE_1 = 1
> +NUM_CPUS = $(DETECTED_CORES) * 4
> +MEMORY = $(DETECTED_MEMORY) * 4
> diff --git a/server/support/condor/config/50condor_cloud_node.config b/server/support/condor/config/50condor_cloud_node.config
> new file mode 100644
> index 0000000..bd7566f
> --- /dev/null
> +++ b/server/support/condor/config/50condor_cloud_node.config
> @@ -0,0 +1,37 @@
> +DAEMON_LIST = MASTER, STARTD
> +
> +GRIDMANAGER_JOB_PROBE_INTERVAL = 30
> +
> +FILESYSTEM_DOMAIN = condor_cloud
> +
> +VM_GAHP_DEBUG = D_FULLDEBUG
> +
> +VM_GAHP_SEND_ALL_CLASSAD = TRUE
> +VM_GAHP_LOG = $(LOG)/VMGahpLog
> +VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
> +VM_TYPE = kvm
> +VM_MEMORY = $(MEMORY)
> +VM_NETWORKING = TRUE
> +VM_NETWORKING_TYPE = bridge,nat
> +VM_NETWORKING_BRIDGE_INTERFACE = vnet0
> +
> +LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
> +
> +
> +# Hook must be go=rx
> +CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
> +CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
> +
> +# Advertise set of images available on this node
> +STARTD_CRON_JOBLIST = CACHED_IMAGES
> +STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
> +STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
> +
> +START = true
> +
> +#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
> +#SLOT_TYPE_1_PARTITIONABLE = TRUE
> +#NUM_SLOTS = 1
> +#NUM_SLOTS_TYPE_1 = 1
> +NUM_CPUS = $(DETECTED_CORES) * 4
> +MEMORY = $(DETECTED_MEMORY) * 4
> diff --git a/server/support/condor/config/condor-cloud b/server/support/condor/config/condor-cloud
> new file mode 100644
> index 0000000..42e4627
> --- /dev/null
> +++ b/server/support/condor/config/condor-cloud
> @@ -0,0 +1,2 @@
> +STORAGE=/var/lib/condor-cloud/shared_images
> +CACHE=/var/lib/condor-cloud/local_cache
> diff --git a/server/support/condor/config/condor_config.local b/server/support/condor/config/condor_config.local
> new file mode 100644
> index 0000000..6f574a6
> --- /dev/null
> +++ b/server/support/condor/config/condor_config.local
> @@ -0,0 +1,44 @@
> +ALLOW_WRITE = *
> +ALLOW_ADMINISTRATOR = *
> +ALLOW_NEGOTIATOR = *
> +ALLOW_NEGOTIATOR_SCHEDD = *
> +COLLECTOR_HOST = localhost
> +
> +DAEMON_LIST = MASTER, SCHEDD, COLLECTOR, NEGOTIATOR, STARTD
> +
> +GRIDMANAGER_JOB_PROBE_INTERVAL = 30
> +
> +GRIDMANAGER_DEBUG = D_FULLDEBUG
> +NEGOTIATOR_DEBUG = D_FULLDEBUG
> +COLLECTOR_DEBUG = D_FULLDEBUG
> +VM_GAHP_DEBUG = D_FULLDEBUG
> +
> +VM_GAHP_SEND_ALL_CLASSAD = TRUE
> +VM_GAHP_LOG = $(LOG)/VMGahpLog
> +VM_GAHP_SERVER = $(SBIN)/condor_vm-gahp
> +VM_TYPE = kvm
> +VM_MEMORY = $(MEMORY)
> +VM_NETWORKING = TRUE
> +VM_NETWORKING_TYPE = bridge,nat
> +VM_NETWORKING_BRIDGE_INTERFACE = vnet0
> +
> +LIBVIRT_XML_SCRIPT = $(LIBEXEC)/libvirt_cloud_script.sh
> +
> +
> +# Hook must be go=rx
> +CLOUD_HOOK_PREPARE_JOB = $(LIBEXEC)/cloud_prepare_hook.sh
> +CLOUD_HOOK_JOB_EXIT = $(LIBEXEC)/cloud_exit_hook.sh
> +
> +# Advertise set of images available on this node
> +STARTD_CRON_JOBLIST = CACHED_IMAGES
> +STARTD_CRON_CACHED_IMAGES_EXECUTABLE = $(LIBEXEC)/cached_images.sh
> +STARTD_CRON_CACHED_IMAGES_PERIOD = 300s
> +
> +START = true
> +
> +#SLOT_TYPE_1 = cpus=100%,disk=100%,swap=100%
> +#SLOT_TYPE_1_PARTITIONABLE = TRUE
> +#NUM_SLOTS = 1
> +#NUM_SLOTS_TYPE_1 = 1
> +#NUM_CPUS = $(DETECTED_CORES) * 4
> +MEMORY = $(DETECTED_MEMORY) * 4
> diff --git a/server/support/fedora/deltacloud-core.spec b/server/support/fedora/deltacloud-core.spec
> index 0048336..5f5f8d7 100644
> --- a/server/support/fedora/deltacloud-core.spec
> +++ b/server/support/fedora/deltacloud-core.spec
> @@ -1,9 +1,10 @@
> %global app_root %{_datadir}/%{name}
> +%%global alphatag git
> 
> Summary: Deltacloud REST API
> Name: deltacloud-core
> -Version: 0.3.0
> -Release: 12%{?dist}
> +Version: 0.4.0
> +Release: 0.1.%{alphatag}
> Group: Development/Languages
> License: ASL 2.0 and MIT
> URL: http://incubator.apache.org/deltacloud
> @@ -12,6 +13,7 @@ Source1: deltacloudd-fedora
> Source2: deltacloud-core
> Source3: deltacloud-core-config
> BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
> +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
> Requires: rubygems
> Requires: ruby(abi) = 1.8
> Requires: rubygem(haml)
> @@ -41,7 +43,6 @@ BuildRequires: rubygem(rspec) >= 1.3.0
> BuildRequires: rubygem(json) >= 1.4.0
> BuildArch: noarch
> Obsoletes: rubygem-deltacloud-core
> -Provides: rubygem(deltacloud-core)
> 
> %description
> The Deltacloud API is built as a service-based REST API.
> @@ -60,28 +61,26 @@ Documentation for %{name}
> %package all
> Summary: Deltacloud Core with all drivers
> Requires: %{name} = %{version}-%{release}
> -Requires: deltacloud-core-azure
> Requires: deltacloud-core-ec2
> -Requires: deltacloud-core-gogrid
> -Requires: deltacloud-core-mock
> -Requires: deltacloud-core-opennebula
> Requires: deltacloud-core-rackspace
> -Requires: deltacloud-core-rhevm
> +Requires: deltacloud-core-gogrid
> Requires: deltacloud-core-rimuhosting
> +Requires: deltacloud-core-rhevm
> Requires: deltacloud-core-sbc
> -Requires: deltacloud-core-terremark
> 
> %description all
> Deltacloud core with all available drivers
> 
> -%package azure
> -Summary: Deltacloud Core for Azure
> -Requires: %{name} = %{version}-%{release}
> -Requires: rubygem(waz-blobs)
> +# FIXME: Azure requires waz-blobs gem which is not yet included in Fedora repos
> +#
> +#%package azure
> +#Summary: Deltacloud Core for Azure
> +#Requires: %{name} = %{version}-%{release}
> +#Requires: rubygem(waz-blobs)
> 
> -%description azure
> -The azure sub-package brings in all dependencies necessary to use deltacloud
> -core to connect to Azure.
> +#%description azure
> +#The azure sub-package brings in all dependencies necessary to use deltacloud
> +#core to connect to Azure.
> 
> %package ec2
> Summary: Deltacloud Core for EC2
> @@ -92,6 +91,15 @@ Requires: rubygem(aws)
> The ec2 sub-package brings in all dependencies necessary to use deltacloud
> core to connect to EC2.
> 
> +%package eucalyptus
> +Summary: Deltacloud Core for Eucalyptus
> +Requires: %{name} = %{version}-%{release}
> +Requires: rubygem(aws)
> +
> +%description eucalyptus
> +The eucalyptus sub-package brings in all dependencies necessary to use deltacloud
> +core to connect to EC2.
> +
> %package gogrid
> Summary: Deltacloud Core for GoGrid
> Requires: %{name} = %{version}-%{release}
> @@ -100,14 +108,6 @@ Requires: %{name} = %{version}-%{release}
> The gogrid sub-package brings in all dependencies necessary to use deltacloud
> core to connect to GoGrid.
> 
> -%package mock
> -Summary: Deltacloud Core for Mock
> -Requires: %{name} = %{version}-%{release}
> -
> -%description mock
> -The mock sub-package brings in all dependencies necessary to use deltacloud
> -core to connect to Mock.
> -
> %package opennebula
> Summary: Deltacloud Core for OpenNebula
> Requires: %{name} = %{version}-%{release}
> @@ -135,6 +135,15 @@ Requires: rubygem(rest-client)
> The rhevm sub-package brings in all dependencies necessary to use deltacloud
> core to connect to RHEV-M.
> 
> +%package vsphere
> +Summary: Deltacloud Core for vSphere
> +Requires: %{name} = %{version}-%{release}
> +Requires: rubygem(rbvmomi)
> +
> +%description vsphere
> +The vsphere sub-package brings in all dependencies necessary to use deltacloud
> +core to connect to VMware vSphere.
> +
> %package rimuhosting
> Summary: Deltacloud Core for Rimuhosting
> Requires: %{name} = %{version}-%{release}
> @@ -151,6 +160,19 @@ Requires: %{name} = %{version}-%{release}
> The sbc sub-package brings in all dependencies necessary to use deltacloud core
> to connect to SBC.
> 
> +%package condor
> +Summary: Deltacloud Core for CondorCloud
> +Requires: %{name} = %{version}-%{release}
> +Requires: rubygem(uuid)
> +Requires: rubygem(rest-client)
> +Requires: condor >= 7.4.0
> +# FIXME: condor-vm-gaph is not yet included in Fedora
> +# Requires: condor-vm-gaph >= 7.4.0
> +
> +%description condor
> +The condor sub-package brings in all dependencies necessary to use deltacloud core
> +to connect to CondorCloud.
> +
> %package terremark
> Summary: Deltacloud Core for Terremark
> Requires: %{name} = %{version}-%{release}
> @@ -183,11 +205,23 @@ find %{buildroot}%{app_root}/lib -type f | xargs chmod -x
> chmod -x %{buildroot}%{_sysconfdir}/sysconfig/%{name}
> chmod 0755 %{buildroot}%{_initddir}/%{name}
> chmod 0755 %{buildroot}%{app_root}/bin/deltacloudd
> -rm -rf %{buildroot}%{app_root}/support
> +# Temporary remove Azure drivers until all dependencies will be pushed in to Fedora
> +rm -rf %{buildroot}%{app_root}/config/drivers/azure.yaml
> +rm -rf %{buildroot}%{app_root}/support/fedora
> rdoc --op %{buildroot}%{_defaultdocdir}/%{name}
> 
> +%install condor
> +install -m 0655 %{buildroot}%{app_root}/support/condor/config/condor-cloud \
> +  %{buildroot}%{_sysconfdir}/sysconfig/condor-cloud
> +install -m 0655 %{buildroot}%{app_root}/support/condor/config/50* \
> +  %{buildroot}%{_sysconfdir}/condor/config.d
> +install -m 0755 %{buildroot}%{app_root}/support/condor/bash/* \
> +  %{buildroot}%{_libexecdir}/condor
> +rm -rf %{buildroot}%{app_root}/support/condor
> +
> %check
> pushd %{buildroot}%{app_root}
> +rake mock:fixtures:clean
> rake test:mock
> popd
> 
> @@ -219,7 +253,8 @@ fi
> %{app_root}/*.rb
> %{app_root}/views
> %{app_root}/lib
> -%{app_root}/config
> +%dir %{app_root}/config/drivers
> +%{app_root}/config/drivers/mock.yaml
> %dir %{app_root}/public
> %{app_root}/public/images
> %{app_root}/public/stylesheets
> @@ -237,42 +272,82 @@ fi
> %{app_root}/%{name}.gemspec
> %{app_root}/Rakefile
> 
> -%files all
> -%defattr(-, root, root, -)
> -
> -%files azure
> -%defattr(-, root, root, -)
> +#%files azure
> +#%defattr(-, root, root, -)
> 
> %files ec2
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/ec2.yaml
> 
> -%files gogrid
> +%files eucalyptus
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/eucalyptus.yaml
> 
> -%files mock
> +%files gogrid
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/gogrid.yaml
> 
> %files opennebula
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/opennebula.yaml
> 
> %files rackspace
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/rackspace.yaml
> 
> %files rhevm
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/rhevm.yaml
> 
> %files rimuhosting
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/rimuhosting.yaml
> 
> %files sbc
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/sbc.yaml
> +
> +%files vsphere
> +%defattr(-, root, root, -)
> +%{app_root}/config/drivers/vsphere.yaml
> 
> %files terremark
> %defattr(-, root, root, -)
> +%{app_root}/config/drivers/terremark.yaml
> +
> +%files condor
> +%defattr(-, root, root, -)
> +%{app_root}/config/drivers/condor.yaml
> +%{app_root}/config/condor.yaml
> +%{app_root}/config/addresses.xml
> +%%config(noreplace) %{_sysconfdir}/sysconfig/condor-cloud
> +%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud.config
> +%%config(noreplace) %{_sysconfdir}/condor/config.d/50condor_cloud_node.config
> +%{_libexecdir}/condor/cached_images.sh
> +%{_libexecdir}/condor/cloud_exit_hook.sh
> +%{_libexecdir}/condor/cloud_functions
> +%{_libexecdir}/condor/cloud_prepare_hook.sh
> +%{_libexecdir}/condor/libvirt_cloud_script.sh
> +
> +%files all
> +%defattr(-, root, root, -)
> 
> %changelog
> -* Mon Aug 01 2011 Chris Lalancette <cl...@redhat.com> - 0.3.0-12
> -- Add the -all package

^^

Sorry for this change Chris! I just copied over the file from my
nighty builds which was the old version. This change log line will
be on correct place before push.

  -- Michal

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Re: [PATCH core] Added support files for CondorCloud and updated RPM spec to match latest version from Fedora

Posted by David Lutterkort <lu...@redhat.com>.
On Tue, 2011-08-23 at 14:18 +0200, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>
> 
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---

ACK. Pushed

David