This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via e83f9b64c1cd304f50dfdd392963f7a18d78b577 (commit)
from d24b2ce226447b4191ea1fa6d0288b65adc496ff (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/e83f9b64c1cd304f50dfdd392963f7a18d78b577
commit e83f9b64c1cd304f50dfdd392963f7a18d78b577
Author: Pete Zaitcev <zaitcev(a)yahoo.com>
Date: Thu Nov 25 15:29:23 2010 -0700
switch to using installed ec2 tools
Amazon and RPMfusion package perfectly useable ec2-ami-tools and
ec2-api-tools, for Fedora 13 and 14 at least. Let's use them and
drop account-specific environment variables. But be careful to permit
going back, in case (e.g. running on Fedora 15 Rawhide).
Also, document the dc-register-image's paramenters.
diff --git a/dc-register-image b/dc-register-image
index 3192f32..0a839bd 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -18,22 +18,61 @@
# Uncomment for debugging.
#ECHO=echo
+# $bucket is iwhd bucket (not S3 bucket, see $ami_bkt below).
bucket=$1; shift
+# $object is iwhd's image name, which also serves as a basename in S3.
+# So, if $object=foo.img, then we end uploading foo.img.manifest.xml and
+# a bunch of foo.img.part.NN files.
+# The foo.img itself is an uncompressed root filesystem, a device image.
+# Finally, $object is in local directory $bucket/ (as fs back-end works).
object=$1; shift
+# $api_key is "key ID" for S3.
api_key=$1; shift
+# $api_secret is "secret" for S3.
api_secret=$1; shift
+# $cert_file contains X.509 certificate for EC2 (cert-foo.pem).
cert_file=$1; shift
+# $key_file contains private key for EC2 (pk-foo.pem).
key_file=$1; shift
+# $api_uid is AWS account ID, but without dashes.
api_uid=$1; shift
+# $ami_bkt is S3 bucket into which we upload foo.img.manifest.xml etc.
ami_bkt=$1; shift
+# $kernel is an aki-xxxxxxxx ID (e.g. aki-99a0f1dc is pvgrub)
kernel=$1; shift
+# $ramdisk is an ari-xxxxxxxx ID or "_default_" (most of the time for pvgrub)
ramdisk=$1; shift
-# TBD: figure out what to do about these paths.
-export EC2_HOME=~/jdarcy/ec2-api-tools-1.3-53907
-export PATH=$PATH:$EC2_HOME/bin
-export JAVA_HOME=/usr
+# We do not set JAVA_HOME and EC2_HOME because they are not necessary
+# if pre-packaged versions of ec2-api-tools and ec2-ami-tools are installed
+# from RPMfusion and Amazon respectively. This also allows the user to
+# set these locations in case an alternative set of tools is desired.
+#
+# However, we look for each missing tool in commonly overlooked locations.
+which_it () {
+ cmd=$1
+ ret=$(/usr/bin/which $cmd 2>/dev/null)
+ if [ $? != 0 ]; then
+ if [ -x /usr/local/bin/$cmd ]; then
+ ret=/usr/local/bin/$cmd
+ elif [ -x ~/bin/$cmd ]; then
+ ret=~/bin/$cmd
+ fi
+ fi
+ if [ -z "$ret" ]; then
+ echo "ERROR missing_$cmd" >&2
+ exit 1
+ fi
+ echo $ret
+}
+
+ec2_bundle_image=$(which_it ec2-bundle-image)
+ec2_upload_bundle=$(which_it ec2-upload-bundle)
+ec2_register=$(which_it ec2-register)
+[ -z "$ec2_bundle_image" -o -z "$ec2_upload_bundle" -o -z "$ec2_register" ] && exit 1
+
+# XXX Is this safe against running 2 requests simultaneously?
tmpdir=$(mktemp -d -p $PWD/$bucket) || exit 1
trap "rm -rf $tmpdir" EXIT
@@ -44,25 +83,25 @@ fi
if [ "$ramdisk" != "_default_" ]; then
bundle_args="$bundle_args --ramdisk $ramdisk"
fi
-$ECHO ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args
+$ECHO $ec2_bundle_image -i $bucket/$object -d $tmpdir $bundle_args
if [ $? != 0 ]; then
echo "ERROR bundling_failed" >&2
- echo ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args >&2
+ echo $ec2_bundle_image -i $bucket/$object -d $tmpdir $bundle_args >&2
exit 1
fi
upload_args="--batch --retry -b $ami_bkt -a $api_key -s $api_secret"
-$ECHO ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args
+$ECHO $ec2_upload_bundle -m $tmpdir/$object.manifest.xml $upload_args
if [ $? != 0 ]; then
echo "ERROR uploading_failed" >&2
- echo ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args >&2
+ echo $ec2_upload_bundle -m $tmpdir/$object.manifest.xml $upload_args >&2
exit 1
fi
register_args="-C $cert_file -K $key_file"
-$ECHO ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object
+$ECHO $ec2_register $register_args $ami_bkt/$object.manifest.xml -n $object
if [ $? != 0 ]; then
echo "ERROR registration_failed" >&2
- echo ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object >&2
+ echo $ec2_register $register_args $ami_bkt/$object.manifest.xml -n $object >&2
exit 1
fi
-----------------------------------------------------------------------
Summary of changes:
dc-register-image | 59 ++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 49 insertions(+), 10 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via d24b2ce226447b4191ea1fa6d0288b65adc496ff (commit)
via 464741d6589ad92dd4086ad04c43199ed8e1801c (commit)
from 1478b5d5011e213aa1ecc2549a5bc52e333c8bbd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/d24b2ce226447b4191ea1fa6d0288b65adc496ff
commit d24b2ce226447b4191ea1fa6d0288b65adc496ff
Author: Pete Zaitcev <zaitcev(a)yahoo.com>
Date: Thu Nov 18 08:37:30 2010 -0700
error to stderr
This is useless in production, since backend.c dups the same pipe to both
stderr and stdout. However it is marginally uselful in debugging if they
are redirected by a developer.
OK, I admit it: this feels more "correct".
diff --git a/dc-register-image b/dc-register-image
index 6225e08..3192f32 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -46,23 +46,23 @@ if [ "$ramdisk" != "_default_" ]; then
fi
$ECHO ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args
if [ $? != 0 ]; then
- echo "ERROR bundling_failed"
- echo ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args
+ echo "ERROR bundling_failed" >&2
+ echo ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args >&2
exit 1
fi
upload_args="--batch --retry -b $ami_bkt -a $api_key -s $api_secret"
$ECHO ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args
if [ $? != 0 ]; then
- echo "ERROR uploading_failed"
- echo ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args
+ echo "ERROR uploading_failed" >&2
+ echo ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args >&2
exit 1
fi
register_args="-C $cert_file -K $key_file"
$ECHO ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object
if [ $? != 0 ]; then
- echo "ERROR registration_failed"
- echo ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object
+ echo "ERROR registration_failed" >&2
+ echo ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object >&2
exit 1
fi
http://repo.or.cz/w/iwhd.git/commit/464741d6589ad92dd4086ad04c43199ed8e1801c
commit 464741d6589ad92dd4086ad04c43199ed8e1801c
Author: Pete Zaitcev <zaitcev(a)yahoo.com>
Date: Thu Nov 18 08:36:14 2010 -0700
exit if mkdir fails
One fine way to have this fail is to use a back-end other than fs.
To be fixed for real later, just stub it out for now to prevent
a bunch of apriori incorrect operations that follow.
diff --git a/dc-register-image b/dc-register-image
index 585c40d..6225e08 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -34,7 +34,7 @@ export EC2_HOME=~/jdarcy/ec2-api-tools-1.3-53907
export PATH=$PATH:$EC2_HOME/bin
export JAVA_HOME=/usr
-tmpdir=$(mktemp -d -p $PWD/$bucket)
+tmpdir=$(mktemp -d -p $PWD/$bucket) || exit 1
trap "rm -rf $tmpdir" EXIT
bundle_args="--batch --arch x86_64 -c $cert_file -k $key_file -u $api_uid"
-----------------------------------------------------------------------
Summary of changes:
dc-register-image | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 1478b5d5011e213aa1ecc2549a5bc52e333c8bbd (commit)
from cc80a83104880b098979a27d594734c916497c92 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/1478b5d5011e213aa1ecc2549a5bc52e333c8bbd
commit 1478b5d5011e213aa1ecc2549a5bc52e333c8bbd
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Nov 10 19:28:06 2010 +0100
GNUmakefile: replace leading spaces with TABs
diff --git a/GNUmakefile b/GNUmakefile
index 1cb7735..1622633 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -14,8 +14,8 @@ include Makefile
else
all:
- @echo There seems to be no Makefile in this directory.
- @echo "You must run ./configure before running `make'."
- @exit 1
+ @echo There seems to be no Makefile in this directory.
+ @echo "You must run ./configure before running `make'."
+ @exit 1
endif
-----------------------------------------------------------------------
Summary of changes:
GNUmakefile | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")