[iwhd] emit valid JSON for the root
by Jim Meyering
commit adc33ebe60bb4af53866381d635b457fc77c302f
Author: Pete Zaitcev <zaitcev(a)redhat.com>
Date: Thu Apr 14 22:30:18 2011 -0600
emit valid JSON for the root
Add a "providers": tag before the array of provider information.
With this patch, the GET on root returns valid JSON.
Reported by Dave Johnson.
* NEWS (Bug fixes): Mention it.
NEWS | 6 ++++++
t/basic | 1 +
template.c | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 31f2371..1e901a8 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ iwhd NEWS -*- outline -*-
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ iwhd now emits syntactically valid JSON output for the root query.
+ Before, it omitted the "providers": tag before the list of
+ provider descriptions. [bug introduced in the beginning]
+
* Noteworthy changes in release 0.93 (2011-04-08) [stable]
diff --git a/t/basic b/t/basic
index 7dcf10b..dfe28cd 100644
--- a/t/basic
+++ b/t/basic
@@ -40,6 +40,7 @@ cat <<EOF > root.json || framework_failure_
{
"service": "image_warehouse",
"version": "$VERSION",
+ "providers":
[
{
"rel": "bucket_factory",
diff --git a/template.c b/template.c
index 5eb51ed..5d89b6c 100644
--- a/template.c
+++ b/template.c
@@ -108,6 +108,7 @@ static const char json_root_header[] = "\
{\n\
\"service\": \"%s\",\n\
\"version\": \"%s\",\n\
+ \"providers\":\n\
[\
";
13 years, 1 month
[iwhd] cfg.mk: indent (non-leading) consistently with TABs
by Jim Meyering
commit 699ee503146c5563b7e9d95c6c53e8572fec66d2
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Apr 11 17:10:15 2011 +0200
cfg.mk: indent (non-leading) consistently with TABs
cfg.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/cfg.mk b/cfg.mk
index 89b5231..b7c62a0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -68,7 +68,7 @@ update-copyright-env = \
UPDATE_COPYRIGHT_USE_INTERVALS=1 \
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
-announcement_mail_headers_ = \
+announcement_mail_headers_ = \
To: iwhd-devel(a)lists.fedorahosted.org \
Cc: aeolus-devel(a)lists.fedorahosted.org \
Mail-Followup-To: iwhd-devel(a)lists.fedorahosted.org
13 years, 1 month
[iwhd] Add a memo about registrations.
by Pete Zaitcev
commit 8722c3a68255b4ed72824f2eee57e6db107dacd5
Author: Pete Zaitcev <zaitcev(a)yahoo.com>
Date: Thu Apr 14 22:24:27 2011 -0600
Add a memo about registrations.
This document describes the specific parameters and kinks of registrations
in every supported cloud, so that developers do not need to deduce them
from the code.
We do not add the document to the distribution though (TBD).
doc/registrations.md | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 142 insertions(+), 0 deletions(-)
---
diff --git a/doc/registrations.md b/doc/registrations.md
new file mode 100644
index 0000000..6a12688
--- /dev/null
+++ b/doc/registrations.md
@@ -0,0 +1,142 @@
+Notes on registration in iwhd
+=============================
+
+Every known cloud incudes a concept known as "registration", when an image
+requires special processing before it can be instantiated. Generally, if
+iwhd runs on host H, and cloud includes a storage back-end S and a management
+server M, the registration involves:
+ - formatting the image, if necessary
+ - generating any necessary manifests, metadata, or OVF files
+ - uploading the image from H to S
+ - notifying M with an API call
+
+The registration is triggered with "op=register" posted to iwhd image.
+Unfortunately, paramteres are cloud-specific (see examples).
+
+When registrarion completes with code 200, application is supposed to
+extract a cloud ID from the "ami-id" attribute, and verify that it starts
+with "OK". For example:
+ curl http://iwhdhost.eng.example.com:9090/buk1/test_img/ami-id
+
+Another unfortunate implementation limitation is that registrations are
+going to fail unless iwhd uses a filesystem-type back-end. A work is ongoing
+to lift this restriction.
+
+Amazon EC2
+----------
+
+There is no pre-set except configuring iwhd/conf.js like so:
+
+[
+ {
+ "name": "main",
+ "type": "fs",
+ "path": "_fs",
+ }
+]
+
+Note that the type is "fs", not "s3" (see the second unfortunate note above).
+
+Registration call:
+
+ curl -d op=register -d site=amazon \
+ -d api-key=AKIAJAJZYB6229Z5K3VW \
+ -d api-secret=PPU45khle/uHqq0xGPNNSJLAmPwsc9end7s3aCx+ \
+ -d ami-cert=/home/tester/cert-1.pem \
+ -d ami-key=/home/tester/pk-1.pem \
+ -d ami-uid=089534962013 \
+ -d ami-bkt=west-test \
+ -d kernel=_default_ \
+ -d ramdisk=_default_ \
+ http://localhost:9090/buk1/dummy_img
+
+Note that S3 bucket may be different from iwhd bucket. This is mostly done
+because Amazon buckets are global and it is very easy to run into conflicts.
+The kernel and ramdisk arguments are optional.
+
+The ami-id contains a pattern like "OK ami-298f1573".
+
+This back-end may be compatible with Amazonesque clouds, such as Eucalyptus
+and OpenStack.
+
+RHEV-M
+------
+
+The pre-set for RHEV-M consists of creating an NFS area (S) that both RHEV-M
+server (M) and iwhd server (H) can access for writing. Its top-level directory
+must be owned by user 36 (vdsm) and group 36 (kvm). Usually the /etc/exports
+looks like this:
+
+ /home/vdsm 10.16.0.0/16(rw) 10.11.10.167/16(rw) *(ro)
+
+This assumes iwhd is ran as root. Since iwhd must write into the area S
+with UID 36, attempts to run iwhd as non-priviledeged user require
+tricks with wrapping dc-rhev-image into a script that calls sudo.
+Do not attempt it if you value your sanity.
+
+The area S must be mounted at H (example below assumes /mnt/iwhd-fish).
+
+Finally, RHEV-M must be told to "import" and "attach" so-called
+"export storage domain". At this time, RHEV-M server mounts the area S
+and creates the necessary directory structure. The names it selects are
+impossible to guess ahead, so this must be done before any registrations
+are attempted. Only then iwhd is able to store anything into S.
+
+The provider in iwhd/conf.js uses "fs-rhev-m" type:
+
+[
+ {
+ "name": "main",
+ "type": "fs-rhev-m",
+ "path": "_fs",
+ }
+]
+
+Registration call:
+
+ curl -d op=register -d site=main \
+ -d api-url=http://rhevm23.virt.lab.eng.bos.redhat.com/rhevm-api \
+ -d api-key=rhevadmin(a)virt.lab.eng.bos.redhat.com \
+ -d api-secret=donotusepassw0rd \
+ -d nfs-host=fish.usersys.redhat.com \
+ -d nfs-path=/home/vdsm/v1 \
+ -d nfs-dir=/mnt/iwhd-fish \
+ http://localhost:9090/buk1/dummy_img
+
+The ami-id contains a pattern like "OK <uuid>". The UUID is the "image"
+UUID that can be used to find the image by RHEV-M datacenters through
+its RESTful API.
+
+Condor
+------
+
+Condor is a toy cloud that DeltaCloud use for testing.
+
+Condor uses NFS just like RHEV-M, but there are no problems with UID 36,
+so iwhd can be run as non-root. The only requirement is to create a
+subdirectory called "staging/" in area S, and make sure that iwhd can
+write into S.
+
+The area S must be mounted at H, of course.
+
+[
+ {
+ "name": "condor",
+ "type": "fs-condor",
+ "path": "/home/iwhd/_fs",
+ }
+]
+
+Registration call:
+
+ curl -d op=register -d site=main \
+ -d nfs-dir=/mnt/falcon-in \
+ http://localhost:9090/buk1/dummy_img_2
+
+This basically copies the image into /mnt/falcon-in/staging/, then
+renames it into /mnt/falcon-in/.
+
+VMware vSphere
+--------------
+
+Not implemented yet.
13 years, 1 month
[iwhd] maint: Cc aeolus-devel on the next release announcement
by Jim Meyering
commit e020a25be55b2f93144db20cd02107005608dc83
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Apr 11 16:00:13 2011 +0200
maint: Cc aeolus-devel on the next release announcement
* cfg.mk (announcement_mail_headers_): Define, so that we'll
Cc: aeolus-devel(a)lists.fedorahosted.org for the next release.
cfg.mk | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/cfg.mk b/cfg.mk
index 4d99556..89b5231 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -67,3 +67,8 @@ exclude_file_name_regexp--sc_bindtextdomain = ^dc-rhev-image\.c$$
update-copyright-env = \
UPDATE_COPYRIGHT_USE_INTERVALS=1 \
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
+
+announcement_mail_headers_ = \
+To: iwhd-devel(a)lists.fedorahosted.org \
+Cc: aeolus-devel(a)lists.fedorahosted.org \
+Mail-Followup-To: iwhd-devel(a)lists.fedorahosted.org
13 years, 1 month
[iwhd] Created tag v0.93
by Jim Meyering
The signed tag 'v0.93' was created.
Tagger: Jim Meyering <meyering(a)redhat.com>
Date: Fri Apr 8 18:38:27 2011 +0200
iwhd 0.93
Changes since the last tag 'v0.91':
Jim Meyering (62):
post-release administrivia
maint: also create xz-compressed tarballs
tweak diagnostics
avoid file descriptor leak in replication
remove final vestiges of glib
configure.ac didn't did not honor xml2-config's settings
turn off -Winline to avoid compiler warning/error on rawhide
build: remove unnecessary uses of xml-related cflags and ldflags
do not emit invalid xml for an attribute name
correct typo in object_attr URL: s,http:/,http://,
build: do not require texinfo, since we don't use makeinfo
give better diagnostic upon OOM
diagnose excess arguments
build: work around -Wunused-result warning in copy-file.c
fix "make rpm" to reflect a recent addition
build: add init.d-style script and conf.js and install them
allow "GET http://host/bucket/object/_attrs" to list attributes
adjust code, doc and tests to use ".../_attrs", not ".../attrs"
maint: remove notes.txt
maint: avoid new syntax-check failure
move many decls "down" to where used; no semantic change
doc: keep NEWS up to date
fix remaining URLs in attribute-listing output to be accurate
maint: ignore a few more generated files
generate object files like foo.o (not iwhd-foo.o) for iwhd
maint: avoid warnings about unused local variables
version 0.92
doc/image_repo.odt: update
doc: don't distribute an empty README file
build: update gnulib submodule to latest
maint: set a variable in cfg.mk rather than using an .x-sc* file...
maint: add casts (cast-away const) in test code
maint: build parser tester in top level directory, not in t/
maint: complete the removal of unnecessary iwhd- prefixes
tests: skip annoyingly long gnulib lock tests
enable #if-0'd asprintf-using code to avoid snprintf truncation risk
build: avoid spurious syntax-check failure
add internationalization
make iwhd --version print copyright information
maint: remove now-unused definitions
maint: enable more compiler warnings
tests: plug long-standing leak in test-only parsing code
iwhd: reject a provider that's specified with an invalid port number
maint: prohibit any use of atoi/atof
dc-rhev-image: always detect/diagnose write failure
tests: enable another synatx-check test
tests: make test port-selection safe and maintainable
don't ignore failing strdup
don't segfault upon ignored meta_get_value failure
fix bug in previous change
maint: remove lock-dir so that "make distcheck" passes again
maint: emit a proper diagnostic when MHD_start_daemon fails
maint: eliminate unnecessary global, cfg_file
maint: reduce scope from global to file: client_lock
maint: limit scope of backend.c globals
dc-rhev-image: always diagnose OOM
doc: remove from iwhd.8 the reference to texinfo documentation
doc: avoid "../iwhd" artifact in generated man page
doc: set up to use transifex for translations
maint: fix "make syntax-check" vs PATH=...:... portability nit
maint: restore template on line 3 to required form
version 0.93
Pete Zaitcev (14):
Add dc-rhev-image.
[patch iwhd 2/3] Fix error handling and waitpid
[patch iwhd 3/3] Touch up the warehouse_final.md
Cleanups: exit(EXIT_FAILURE) fprintf -> error unused valiables stub with ignore_value()
Return 404 from non-existing bucket
Fix-ups for backend.c buglets
Add Condor Cloud back-end
Update NEWS with Condor back-end.
Match the ERROR tag properly in fs_rhevm_register.
Mucking around with rc and ret introduced a regression in 0.92: the registration does the right thing, but then reports code 400 to the user. The trunk code is no better.
Drop slash from template names.
Make directories that we need in export domain.
Free curl headers.
Update NEWS.
13 years, 1 month
[iwhd] post-release administrivia
by Jim Meyering
commit 2dd539afe26318d999411e35148c9cef496825c2
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Apr 8 18:41:29 2011 +0200
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
.prev-version | 2 +-
NEWS | 3 +++
cfg.mk | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/.prev-version b/.prev-version
index 0ac647c..341ad3c 100644
--- a/.prev-version
+++ b/.prev-version
@@ -1 +1 @@
-0.91
+0.93
diff --git a/NEWS b/NEWS
index 99dca67..31f2371 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
iwhd NEWS -*- outline -*-
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+
* Noteworthy changes in release 0.93 (2011-04-08) [stable]
** New features
diff --git a/cfg.mk b/cfg.mk
index 5359a59..4d99556 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -39,7 +39,7 @@ bootstrap-tools = autoconf,automake,gnulib
# Now that we have better tests, make this the default.
export VERBOSE = yes
-old_NEWS_hash = dba674b8d2d0a340da7654d16cced91e
+old_NEWS_hash = e9ec1d38f8c5686545a3e1ed3ce34add
sc_prohibit_echo_minus_en:
@prohibit='\<echo -[en]' \
13 years, 1 month
[iwhd] version 0.93
by Jim Meyering
commit 707a432a662d04e34aafc1e89a41002d8a5f71d9
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Apr 8 18:38:27 2011 +0200
version 0.93
* NEWS: Record release date.
NEWS | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index a6a114a..99dca67 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
iwhd NEWS -*- outline -*-
-* Noteworthy changes in release ?.? (????-??-??) [?]
+* Noteworthy changes in release 0.93 (2011-04-08) [stable]
** New features
13 years, 1 month
[iwhd] maint: restore template on line 3 to required form
by Jim Meyering
commit 9206dc2a4db84a36dda1b2452b399ee3a4d02193
Author: Jim Meyering <meyering(a)redhat.com>
Date: Fri Apr 8 18:38:22 2011 +0200
maint: restore template on line 3 to required form
* NEWS: Change "Noteworthy changes..." line back to the template
that is required by the do-release-commit-and-tag release script.
NEWS | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 46b6948..a6a114a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
iwhd NEWS -*- outline -*-
-* Noteworthy changes in trunk (to be release 0.93 [stable])
+* Noteworthy changes in release ?.? (????-??-??) [?]
** New features
@@ -10,6 +10,7 @@ iwhd NEWS -*- outline -*-
RHEV-M registration did all the right things, but returned code 400.
+
* Noteworthy changes in release 0.92 (2011-03-15) [stable]
** New features
13 years, 1 month
[iwhd] maint: fix "make syntax-check" vs PATH=...:... portability nit
by Jim Meyering
commit 17156f252798f10f40bf26b17963c8a0405ec8a4
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Apr 7 20:27:57 2011 +0200
maint: fix "make syntax-check" vs PATH=...:... portability nit
* man/Makefile.am (iwhd.8): (iwhd.8): Use $(PATH_SEPARATOR), not ":".
man/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/man/Makefile.am b/man/Makefile.am
index 1e40092..7cb842c 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -22,6 +22,6 @@ MAINTAINERCLEANFILES = $(dist_man8_MANS)
iwhd.8: $(top_srcdir)/configure.ac $(top_srcdir)/rest.c
$(AM_V_GEN) \
(echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $(top_srcdir)/rest.c)|\
- PATH=..:$$PATH \
+ PATH=..$(PATH_SEPARATOR)$$PATH \
$(HELP2MAN) --no-info -i - -S '$(PACKAGE) $(VERSION)' iwhd \
> $@-t && mv $@-t $@
13 years, 1 month
[iwhd] doc: set up to use transifex for translations
by Jim Meyering
commit 8a0d9db4efa3d2a217eb96e4f901af3df46e08d7
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Apr 7 18:47:01 2011 +0200
doc: set up to use transifex for translations
* .tx/config: New file with details of project created at
https://www.transifex.net/projects/p/iwhd/.
With this, you'd run "tx push -s" to upload the po/iwhd.pot
file we generate.
.tx/config | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/.tx/config b/.tx/config
new file mode 100644
index 0000000..9c627a3
--- /dev/null
+++ b/.tx/config
@@ -0,0 +1,7 @@
+[main]
+host = https://www.transifex.net
+
+[iwhd.iwhdpot]
+file_filter = po/<lang>.po
+source_file = po/iwhd.pot
+source_lang = en
13 years, 1 month