Commit Graph

5803 Commits

Author SHA1 Message Date
Mathieu Lonjaret c75ef4e08b Merge "pkg/server/help: fix server's hostname when needed" 2015-10-26 14:29:54 +00:00
Mathieu Lonjaret 69d3f9c937 Merge "pkg/index/receive: unless CAMLI_DEBUG_IMAGES, be less EXIF-verbose" 2015-10-23 13:48:52 +00:00
mpl 2b2ad502e5 pkg/index/receive: unless CAMLI_DEBUG_IMAGES, be less EXIF-verbose
Change-Id: Iec0c9acae268285980ce04943c58d56ae19fb711
2015-10-22 17:37:21 +02:00
mpl afa5d42469 pkg/deploy/gce: remove now useless debugging code
Change-Id: Ib2f71056330805287932f259b0c2eec3e1b4b09f
2015-10-21 16:08:25 +02:00
mpl 20ad3d699b pkg/deploy/gce: use WIP tarball if WIP=1 in request URL
That way I don't have to constantly edit deploy.go (and fix it before
committing a CL) when debugging for GCE.

Change-Id: Ie4f75443e4356c5ce1a59931f3cb9e34344350be
2015-10-21 01:46:38 +02:00
mpl 7410fc29ab pkg/server/help: fix server's hostname when needed
When baseURL or listen is something like ":3179" or "0.0.0.0:3179", the
resulting server hostname in the client config would be useless.
Therefore, in that case we use req.Host to set the hostname instead.

Fixes issue #641

Change-Id: I33d65776fbac945a411f4328ebbbc5763dec8eb6
2015-10-21 00:16:21 +02:00
Mathieu Lonjaret 8f31f48fe1 Merge "deploy/gce: use our own systemd-docker image" 2015-10-19 20:30:37 +00:00
mpl c9e6ca58ef deploy/gce: use our own systemd-docker image
Fixes issue #646

Change-Id: I209132ec45cb433804b4cc86513aee252f17ea21
2015-10-19 22:27:54 +02:00
Salman Aljammaz c90ae0219c add makefile to build systemd-docker from source
The systemd-docker image on Docker Hub uses an out of date version
of the Docker client. We build our own to get the version required
by recent CoreOS releases. See #646.

Change-Id: I0b1dc6c70f44055c8f92be44cf16269df8a63f0e
2015-10-19 20:52:48 +01:00
mpl a87632f593 dock.go: do not overwrite "production" tarball with WORKINPROGRESS
Change-Id: Ib71eaf028b56bc440a24d63af2f33156cb9935c6
2015-10-16 23:24:20 +02:00
Mathieu Lonjaret 49efa41316 Merge "dock.go: update CopyObject" 2015-10-16 21:21:37 +00:00
mpl dc38e21fb1 dock.go: update CopyObject
its signature changed with last update of google.golang.org

Change-Id: I318f8966d3ced374607211c7ff27abe1ed30d28d
2015-10-16 23:03:21 +02:00
mpl e52149992a pkg/httputil: allow local connections from root
Context:
https://groups.google.com/d/msg/camlistore/RtpjveY4FVM/P5xldD88CQAJ

Change-Id: Ibc4a1052d94129a40a390390f91d90e6d3236ccd
2015-10-15 23:12:18 +02:00
Mathieu Lonjaret 2ee493d48b Merge "blobserver, server: use httputil.MultipartReader for vendored multipart Reader" 2015-10-14 19:35:47 +00:00
Mathieu Lonjaret 4a7b68aac0 Merge "vendor mime/multipart" 2015-10-14 19:35:26 +00:00
mpl 666d525530 blobserver, server: use httputil.MultipartReader for vendored multipart Reader
We redefine a MultipartReader(*http.Request) function to use instead of
req.MultipartReader, so we can get a (bugfixed) multipart Reader from
our vendored mime/multipart, instead of the buggy one from the stdlib's.

Fixes issue #642

Change-Id: I6a205bff915632d4ee77547e6e26bc0af99665e9
2015-10-14 19:22:10 +02:00
mpl afe28ebf90 vendor mime/multipart
At a2119aca7dc82dc5b5cd40b1a2f56e82323da002 in go tip
because we want the bugfix at 821b54921a3cba5d853b531d4b03527c01bfc9b4

We could legitimately vendor as "vendor/mime/multipart" and shadow the
stdlib's but we do it in future for clarity.

Issue #642

Change-Id: Ifddbd4c9120936b8acc2f6ae31a97b1831b99f34
2015-10-14 19:16:19 +02:00
mpl 07a2721f65 camweb: make it build
Because of cloud logging changes from
9106ce8296

Change-Id: I0620c72c2ada3cf916750586194c18077c8f942a
2015-10-12 19:36:46 +02:00
Brad Fitzpatrick 9106ce8296 vendor: update cloud logging to c7e49e47d60 2015-09-29 08:52:16 -07:00
mpl 6dfe405666 camput init: get client config from server help handler
This is particularly useful for getting clients fully configured for a
server on the same host.

Context:
https://github.com/scaleway-community/scaleway-camlistore/issues/2

Change-Id: I667dd32a80cba4e1e6f6a4ca86a0497a72047d30
2015-09-28 16:44:38 +02:00
mpl 8127040762 pkg/client: use Transport.DialTLS
We can now use DialTLS when we need a custom TLS setup, i.e. with
android, or when using self-signed certificates, or when totally
skipping certificates verification.

This allows us to get rid of the scheme rewriting hack, which simplifies
things, in particular because we have less tricky URL/host parsing to
do.

For the sake of tests and not affecting "real" code, I introduced the
fake_android build tag, so the tests can use custom functions to
simulate testing whether we're on android.

Fixes #566

Change-Id: I72ac2bb69ad2365e98dd6ca2e7016ce9c2d7c57e
2015-09-26 00:09:26 +02:00
Mathieu Lonjaret 52e370a3fa Merge "pkg/client: be stricter when rewriting URLs" 2015-09-25 12:32:27 +00:00
mpl 7820d0279e vendor/google.golang.org/api: update googleapi and storage/v1
Because they were forgotten at 5744b598d4

rev b82cbee675293441769a97b99710295d58dac769

Change-Id: I37d664f969059106af68b854e74f57169dc64921
2015-09-23 17:18:33 +02:00
Mathieu Lonjaret 56c413cb01 Merge "devcam test: run devcam hook pre-commit" 2015-09-22 14:23:26 +00:00
mpl 974ed85e2e devcam test: run devcam hook pre-commit
Instead of the old ./misc/pre-commit.githook
Also fix devcam hook pre-commit so we don't show the override message in
that case.

Change-Id: I390016765056b9c4d3331d12bef8f2581e5621df
2015-09-22 15:57:36 +02:00
Brad Fitzpatrick 5744b598d4 vendor: update Google Cloud Logging, gocloud, add grpc, move http2, etc
I just wanted to update the Google Cloud Logging code (still in review
at: https://code-review.googlesource.com/#/c/2650/) but that required
updating tons of things. For instance, gocloud now always depends on
grpc, which depends on http2, which we already had in third_party, so
that now moves into vendor.

I was unable to run the tests because of some error. The error message
was useless.

But "go run make.go" compiles everything at least.
2015-09-22 14:48:04 +02:00
Mathieu Lonjaret def28fc337 Merge "third_party: no more import path rewriting because Go 1.5" 2015-09-17 11:59:14 +00:00
mpl 328ec25f9c third_party: no more import path rewriting because Go 1.5
We don't rewrite import paths anymore, because we use the new vendor
mechanism that comes with Go 1.5.

Also remove misc/pre-commit.githook because of the above, and because
the rest is covered by devcam hook.

Change-Id: Iafb32e19b21d1df44b9625a5f58bf898e6b51fa8
2015-09-16 22:22:51 +02:00
Mathieu Lonjaret 4c7a2b4aee Merge "dock.go: build windows tarball too" 2015-09-16 19:55:40 +00:00
Mathieu Lonjaret 530840d07c Merge "misc/docker: Go1.5 update + related simplifications" 2015-09-14 14:24:00 +00:00
mpl b432bf01c7 misc/docker: Go1.5 update + related simplifications
Update our Go image to use Go1.5.

Also, with Go1.5, we can compile static binaries (with CGO_ENABLED=0 and
--tags=netgo) without having to first rebuild Go itself from source with
CGO_ENABLED=0.

Finally, with Go1.5, we can now cross-compile straight outta the (linux)
binary tarball (without having to first build the necessary runtime in
src).

For both these above reasons, we don't need to use the Go -src tarball,
and we don't need to have a dedicated Go docker image for each GOOS we
cross-compile too.

Yay, progress!

Change-Id: Ibafb542a4771b151638e796ad3df78e0c8f1a4bf
2015-09-14 16:21:40 +02:00
Mathieu Lonjaret 0e05987641 Merge "website: prepare for 0.9 binaries and release" 2015-09-11 17:06:41 +00:00
mpl 32228e451e website: prepare for 0.9 binaries and release
Addresses #538

Change-Id: I695f5b8d910cdea1d01f7efadaf2454c1a07ad0f
2015-09-09 19:39:24 +02:00
mpl 59d7e89d87 serverinit,blobpacked: wipe blobpacked meta before reindexing
Fixes #639

Change-Id: Ic202e4478e4979a29b71404c08c3188cbb3c292b
2015-09-08 17:02:11 +02:00
mpl fc890a65cd pkg/images/resize: use golang.org/x/image/draw for YCbCr
Later, we should look into using it for more cases. First, to see if we
can phase "halving in place" out, and also to see the gains with other
image types (non YCbCr).

Change-Id: I4b95e2039407f1a91e04cb502674819f17680e02
2015-09-05 01:07:43 +02:00
mpl 710a4236ee pkg/images/resize: show that golang.org/x/image/draw is a win
While investigating issue #635 I remembered that golang.org/x/image/draw
might offer some interesting features. It indeed happens to have some
rescaling routines that seem to work better in the YCbCr case than our
custom code, which is illustrated by these benchmarks:

% go test -v -bench Benchmark.*YCrCb.* -run Bench* -benchmem
% ./pkg/images/resize/
PASS
BenchmarkResizeYCrCb-4   	      20	  79213653 ns/op
9437475 B/op	       5 allocs/op
BenchmarkNewResizeYCrCb-4	     100	  15711294 ns/op
1048668 B/op	       2 allocs/op
BenchmarkHalveYCrCb-4    	     100	  17328467 ns/op
128 B/op	       1 allocs/op
ok  	camlistore.org/pkg/images/resize	5.889s

One can see that not only the new resize is faster, and uses less memory
than the old one, but it is also about as fast as "resizing by halving
in place". And this is with the ApproxBiLinear algorithm; some quick
additional tests seemed to indicate that NearestNeighbor was twice as
fast, with about the same memory usage. I chose ApproxBiLinear as it
seemed the most conservative choice for now.

I think it is also worth investigating whether we can be rid of "halving
in place", since it would make for simpler code overall, and since
ApproxBiLinear might be faster in most cases. It would have the nice
side-effect of solving issue #635 too. However, "halving in place" will
always win when it comes to memory usage, so it depends on our
priorities.

Finally, these other new benchmarks show that using the new resize does
not make the #635 mystery much worse (going from ~16% to ~18%), and that
interestingly the results of the old resize and the new resize are
pretty different by themselves.

% go test -v -run TestCompare ./pkg/images/resize/
=== RUN   TestCompareOldResizeToHalveInplace
--- FAIL: TestCompareOldResizeToHalveInplace (2.49s)
	resize_test.go:377: *image.Gray PSNR 63.7793
	resize_test.go:377: *image.Gray16 PSNR 59.9547
	resize_test.go:377: *image.NRGBA PSNR 62.8252
	resize_test.go:377: *image.NRGBA64 PSNR 62.8252
	resize_test.go:377: *image.Paletted PSNR 51.4949
	resize_test.go:377: *image.RGBA PSNR 62.8252
	resize_test.go:377: *image.RGBA64 PSNR 62.8252
	resize_test.go:377: *image.YCbCr PSNR 61.9664
	resize_test.go:382: *image.YCbCr not the same 18077 pixels
different 16.35%
	resize_test.go:377: *image.YCbCr PSNR 52.4121
	resize_test.go:382: *image.YCbCr not the same 18139 pixels
different 16.40%
	resize_test.go:377: *image.YCbCr PSNR 51.4972
	resize_test.go:382: *image.YCbCr not the same 17932 pixels
different 16.21%
	resize_test.go:377: *image.YCbCr PSNR 51.6399
	resize_test.go:382: *image.YCbCr not the same 17881 pixels
different 16.17%
	resize_test.go:377: *image.YCbCr PSNR 50.7736
	resize_test.go:382: *image.YCbCr not the same 17976 pixels
different 16.25%
	resize_test.go:377: *image.YCbCr PSNR 52.4536
	resize_test.go:382: *image.YCbCr not the same 18180 pixels
different 16.44%
=== RUN   TestCompareNewResizeToHalveInplace
--- FAIL: TestCompareNewResizeToHalveInplace (2.27s)
	resize_test.go:377: *image.Gray PSNR 63.7793
	resize_test.go:377: *image.Gray16 PSNR 59.9547
	resize_test.go:377: *image.NRGBA PSNR 62.8252
	resize_test.go:377: *image.NRGBA64 PSNR 62.8252
	resize_test.go:377: *image.Paletted PSNR 51.4949
	resize_test.go:377: *image.RGBA PSNR 62.8252
	resize_test.go:377: *image.RGBA64 PSNR 62.8252
	resize_test.go:377: *image.YCbCr PSNR 59.5902
	resize_test.go:382: *image.YCbCr not the same 20757 pixels
different 18.77%
	resize_test.go:377: *image.YCbCr PSNR 52.0962
	resize_test.go:382: *image.YCbCr not the same 20811 pixels
different 18.82%
	resize_test.go:377: *image.YCbCr PSNR 51.3374
	resize_test.go:382: *image.YCbCr not the same 20671 pixels
different 18.69%
	resize_test.go:377: *image.YCbCr PSNR 51.3586
	resize_test.go:382: *image.YCbCr not the same 20618 pixels
different 18.64%
	resize_test.go:377: *image.YCbCr PSNR 57.2346
	resize_test.go:382: *image.YCbCr not the same 20705 pixels
different 18.72%
	resize_test.go:377: *image.YCbCr PSNR 50.7504
	resize_test.go:382: *image.YCbCr not the same 20847 pixels
different 18.85%
=== RUN   TestCompareOldResizeToNewResize
--- FAIL: TestCompareOldResizeToNewResize (2.54s)
	resize_test.go:377: *image.Gray PSNR +Inf
	resize_test.go:377: *image.Gray16 PSNR +Inf
	resize_test.go:377: *image.NRGBA PSNR +Inf
	resize_test.go:377: *image.NRGBA64 PSNR +Inf
	resize_test.go:377: *image.Paletted PSNR +Inf
	resize_test.go:377: *image.RGBA PSNR +Inf
	resize_test.go:377: *image.RGBA64 PSNR +Inf
	resize_test.go:377: *image.YCbCr PSNR 59.1024
	resize_test.go:382: *image.YCbCr not the same 16350 pixels
different 14.78%
	resize_test.go:377: *image.YCbCr PSNR 62.6523
	resize_test.go:377: *image.YCbCr PSNR 62.7010
	resize_test.go:377: *image.YCbCr PSNR 59.1396
	resize_test.go:382: *image.YCbCr not the same 16225 pixels
different 14.67%
	resize_test.go:377: *image.YCbCr PSNR 59.0844
	resize_test.go:382: *image.YCbCr not the same 16294 pixels
different 14.73%
	resize_test.go:377: *image.YCbCr PSNR 59.0534
	resize_test.go:382: *image.YCbCr not the same 16413 pixels
different 14.84%

Change-Id: Ia8c578a53416ec0f1cac1477a1a68acfede84b24
2015-09-05 00:59:50 +02:00
mpl 45c77f8379 vendor: golang.org/x/image/draw
At rev b3d8467d91f6ab3c9240e1c1e98309baf9ba6343

For rescaling YCbCr images (next commits).

Change-Id: I5e6169ddd9cc2b1b933d9482adfbec08c7e378d9
2015-09-05 00:48:20 +02:00
mpl 14c87ca673 dock.go: build windows tarball too
Change-Id: I0b0f60828949fd321f99fc12eeef5d8e22d3cbc1
2015-08-25 19:26:55 +02:00
Brad Fitzpatrick 467aa73750 Merge "Address TODO by moving CAMLI_DEBUG checks into env" 2015-08-25 15:55:38 +00:00
Mathieu Lonjaret 91c0467302 Merge "osutil,deploy: on GCE, deploy with enough scope to log on GCL" 2015-08-25 15:10:13 +00:00
mpl 9c0f51b041 osutil,deploy: on GCE, deploy with enough scope to log on GCL
Otherwise, if scope is missing, warn about it.

Change-Id: If840c4f5783708dd5693993ca39b10fd2ad5442e
2015-08-25 17:08:18 +02:00
Gina White 56bb5d1a38 Address TODO by moving CAMLI_DEBUG checks into env
I also wonder if we want to take a more comprehensive approach to
environment variables, perhaps populating a struct at startup that other
code can consult later.  But it might be too soon for that kind of thing
in this project.

Change-Id: I65a34622bf906c1256ceb357ba983bc5acd6b887
2015-08-25 07:22:14 -07:00
mpl 82c6feb61a UI/upload: detect when permanode already exists
When uploading a file, we were already checking if the contents and file
blob already existed, and acted smartly accordingly. However, we were
still always creating a new permanode (and camliContent claim) for that
file.

This CL addresses that last point.

Fixes #622

Change-Id: Ifb5c8846e20b6684d25a7749c64b09904e07bb6f
2015-08-25 01:11:18 +02:00
mpl 432abe24ec deploy/gce: update coreos image
Change-Id: I8a876ec31ab2360b74ca644e88f605536a6a7867
2015-08-24 23:28:18 +02:00
mpl 21a584022f pkg/client: be stricter when rewriting URLs
url.Parse in Go 1.5 now fails with the scheme://IPv6:/foo form (trailing
colon). But it still works when the hostname is an actual hostname, or
an IPv4, which seems inconsistent.
This CL therefore not only accepts this new failure (which comes with Go
1.5) but also considers any host with a trailing colon as an invalid URL
and refuses to rewrite it.

There probably are other places in Camlistore where we should the same.

See https://github.com/golang/go/issues/12200

Change-Id: Ib9ea95a71013b5b53f2fd99415015ec916bb4d9d
2015-08-24 18:46:08 +02:00
Patrick Mezard 16dedde9f0 Update build instructions wrt Go 1.5 requirement
Fixes #636

Change-Id: I4380702c74e62c5b4ce8d7269a597af892bc311c
2015-08-23 16:32:21 +02:00
mpl b118fc23fb devcam hook: no import path checking in pre-commit because Go 1.5
We won't be rewriting the import paths of our third-parties anymore
since we use the new vendor mechanism that comes with Go 1.5. Hence, no
need to check for those rewrites anymore.

Change-Id: Ib9557b60c077190bfd5a6db95ad582f153aa4a68
2015-08-21 19:57:09 +02:00
mpl b49c8b94de buildbot: switch to Go 1.5
Change-Id: I1b97aa44157064a64baec8f2d3f22376c9438d21
2015-08-21 19:27:52 +02:00
mpl 8ea07d33d2 devcam server: preset CAMLI_LEVELDB_ENABLED to false
Change-Id: Id35fc6f965186b4d2f1a2d427d2e5506a98cce1f
2015-08-21 18:35:30 +02:00
mpl be3ea3fe01 images/resize: add YCbCr 4:1:1 and 4:1:0 samples
Also fixed a typo and left TODOs.

Related: issue #635

Change-Id: I6797094c3eaeb26a2d9397c1174c2548fad7d312
2015-08-21 18:17:01 +02:00