Commit Graph

2342 Commits

Author SHA1 Message Date
mpl 3dbaa49395 vendor: go4.org/oauthutil
Previously pkg/oauthutil

Imported from go4.org at rev
3970dd22c0e7e2397304ad626a20b72f8db41b58

Change-Id: Iffb751d03af9bc0c3008e5cd3833ed42fba0bdb1
2015-11-27 00:31:40 +01:00
mpl 40c0d80b07 vendor: go4.org/wkfs
Previously pkg/wkfs

Copied from go4.org at rev 3970dd22c0e7e2397304ad626a20b72f8db41b58

Note that pkg/wkfs/gcs has not been moved yet (for dependencies
reasons).

Change-Id: I737e88a360bccfc643e1fa43541f65f2384c3157
2015-11-27 00:23:03 +01:00
Mathieu Lonjaret 6ffc170d7d Merge "pkg/images/resize: disable TestCompareResizeToHalveInplace for now" 2015-11-26 16:16:35 +00:00
mpl 997d400cbd pkg/images/resize: disable TestCompareResizeToHalveInplace for now
It's more important for now to be able to monitor for other failures in
the Camlistore repo than leaving this test on.

After having looked into the issue, I know a little more but not enough
for a definitive conclusion or fix.
It's all added as comments so we don't start from scratch again later.

Also, to make up for the loss of this test, I'm adding two other tests,
TestCompareOriginalToHalveInPlace, and TestCompareOriginalToResized,
that are similar enough to catch other problems in the same context I
believe.

Context: issue #635

Change-Id: I80a30f544fb9ab2e7c69118ef8509d3d687c2d27
2015-11-26 16:59:52 +01:00
mpl 1e2a306e8d vendor: add go4.org/cloud, update google.golang.org/api, and golang.org/x/net/context
Import go4.org/cloud/cloudlaunch and go4.org/cloud/gceutil, which were
previously in pkg/cloudlaunch, at rev
2c497a8c195996d6c48402c150da4919c1d99f33

Because the version on go4.org was updated to use the latest
google.golang.org/api/* , we also update our
vendor/google.golang.org/api/* to rev
030d584ade5f79aa2ed0ce067e8f7da50c9a10d5

This in turns requires to add vendor/golang.org/x/net/context/ctxhttp
(and update vendor/golang.org/x/net/context/) to rev
4f2fc6c1e69d41baf187332ee08fbd2b296f21ed

Also adding vendor/google.golang.org/api/gensupport for the same reason.

Change-Id: I9d6c3059626f7ecc0fbf2df0415043a464d27caa
2015-11-25 19:29:46 +01:00
mpl 8d76f0563b vendor: go4.org/syncutil/singleflight
Previously pkg/singleflight

Imported from github.com/camlistore/go4/ at rev
039bcc4ca7e407e5611cbdf15a1f208be0bceda0

Also reimport vendor/go4.org/syncutil because some of it got split into
github.com/camlistore/go4/syncutil/syncdebug

Change-Id: Iaf48de71928d17e0410442ea6f5bef7262ba60d2
2015-11-24 17:28:28 +01:00
mpl fd2d58e61b vendor: go4.org/net/throttle
Previously known as pkg/throttle

Imported from github.com/camlistore/go4 at rev
4d87fc99168459b13e7c78086d210cf11474ade2

Change-Id: I21298db0790b2cf125efb612befd7dfb24780861
2015-11-24 16:27:11 +01:00
Brad Fitzpatrick 9868aa0f8d Remove httputil.CloseBody relic. 2015-11-23 19:02:10 -08:00
Mathieu Lonjaret fe71c93af6 Merge "pkg/images/resize: fix filenames in tests" 2015-11-23 16:07:27 +00:00
mpl 12eddf9c19 vendor: go4.org/strutil go4.org/syncutil
They were internal packages (under pkg), which we are now moving to
go4.org, so we in turn need to vendor them in now.

Change-Id: I92224f731404d0bd4ca1c57492bed37cb3367ed4
2015-11-21 00:21:20 +01:00
mpl be155b4503 pkg/images/resize: fix filenames in tests
Setting the filename from the type, after resizing, does not work anymore
after fc890a65cd , because resized images
are now always RGBA, since we're using xdraw.

Change-Id: I561f43a3ebe9cb3e1d7404295635899ab6b62e7a
2015-11-20 21:43:12 +01:00
mpl 8a10bb52e0 pkg/server/status: link to GCL logs on GCE
Fixes issue #592

Change-Id: Ife405816ee42902258c93eac917a6ff5bada4138
2015-11-20 01:26:12 +01:00
Mathieu Lonjaret 64a8d7d26b Merge "pkg/index/sqlite: add build tag for test" 2015-11-19 14:40:10 +00:00
mpl 0fe6be3a47 pkg/serverinit: fix diskpacked test
Because I broke it with 7cb8884f00

Change-Id: I39e72d5093c26ed71f5c9076487837b0395b9e73
2015-11-18 23:57:13 +01:00
mpl 59e30b9433 pkg/index/sqlite: add build tag for test
so we don't get a failed test when we're not running with
--tags=with_sqlite

Change-Id: I2de4c21b4f3ee673132f56b12c2dfff8272d5d79
2015-11-18 23:17:20 +01:00
mpl d3e4a01b4f pkg/deploy/gce: rm debugging handler
I broke it recently by removing gce.DevHandler and I don't think it's of
any use anymore nowadays.

Change-Id: I8d9ff85c980999bc5fb61ea08e1fce2cd4b7bea9
2015-11-18 18:49:34 +01:00
mpl 775da29abe pkg/deploy/gce: always use latest stable CoreOS
Added pkg/cloudlaunch/gceutil package.

Fixes issue #649

Change-Id: I47830489b29de9c555b4706fe387be08e3f57e16
2015-11-18 00:17:33 +01:00
mpl 621388f0bf camweb: send deploy handler logs to GCLogging as well
When logging to Google Cloud Logging, make sure the deploy handler logs
are written there too.

We tag them with the from:camli-gce-launcher label.

Change-Id: I4dab010009f98efd2aeba7c57dc4ab3ca6a566b3
2015-11-16 23:40:05 +01:00
mpl a2aee25cfb website: update (camlistored) deployer to run on GCE
Change-Id: I205c6df51e8d8c4bcf2710fc9da1db68419fc2df
2015-11-13 17:41:46 +01:00
Brad Fitzpatrick afd28ae279 website: name the demo blobserver container, kill on start-up 2015-11-11 14:45:50 +00:00
Brad Fitzpatrick 96dc004af7 website: run on GCE under CoreOS. Containerize demo blob server. 2015-11-11 12:58:01 +00:00
Brad Fitzpatrick b4ef019bc2 website: now runs on GCE/coreos with cloudlaunch 2015-11-10 12:10:16 +00:00
Brad Fitzpatrick 785b6ce1c2 cloudlaunch: automatically use the latest CoreOS stable image 2015-11-08 20:38:27 +00:00
Brad Fitzpatrick 3a473f32d3 cloudlaunch: upload binary, create instance 2015-11-08 20:29:04 +00:00
mpl f2c8ae1fcb pkg/cloudlaunch: added latestStableCoreOSImage
To get the latest stable CoreOS image URL for GCE.

Change-Id: I608b4c8d6d1628046cf5f03440afcf158a3ee609
2015-11-08 20:03:25 +01:00
Brad Fitzpatrick 7578502c33 Start of a new cloudlaunch package, to be used by the website first. 2015-11-08 16:49:59 +01:00
mpl 2e34259de8 vendor: update http2
Replaced github.com/bradfitz/http2 with the latest golang.org/x/net/http2
and updated the following dependencies:

golang.org/x/net @ a179abb31d787abdb406d922dff79635a8d784a4
golang.org/x/oauth2 @ 038cb4adce85ed41e285c2e7cc6221a92bfa44aa
google.golang.org/grpc @ 1684e4a49ba8e6c88a8628b26395f310a1e3d99f

Change-Id: Ic8f294f22a4ec7f7ee513fd1eb29a0b72ac41886
2015-11-08 11:52:24 +01:00
Mathieu Lonjaret 8efe27aa58 Merge "pkg/serverinit: use syndtr/goleveldb in default config" 2015-11-01 21:17:27 +00:00
mpl 7cb8884f00 pkg/serverinit: use sortedStorageAt for diskpacked
This makes diskpacked index type/location be set the same way it is done for
blobpacked, that is, its type will be the same as the camlistore index's
is. e.g. if the camli index is in MySQL, then the diskpacked index will
be another database in MySQL too.

Additionally, for added clarity wrt to the changes in
https://camlistore-review.googlesource.com/5496 , if we use a file based
indexer, the diskpacked index filename will now be
blobPath/diskpacked-index.kvtype (instead of blobPath/index.kvtype).

Change-Id: I7a9eb5c9caf07f62732ba2771308d351ec37b814
2015-10-31 00:01:38 +01:00
mpl 69fdcbb797 pkg/serverinit: use syndtr/goleveldb in default config
Because benchmarks from ./pkg/index/stress seem to show that levelDB
is more efficient than kvfile for us.

Also changed the filenames to index.kvtype, because the "camli-" prefix
is redundant, and because that's how we name the index files in the rest
of genconfig.go anyway.

Fixes issue #632

Change-Id: If663e94f2c24d646b994c39044eedc9b86327bf2
2015-10-30 23:58:03 +01:00
mpl a7ccb62bf6 vendor: mv github.com/hjfreyer/taglib-go from third_party
Also bump it at 0ef8bba9c41b66c12f60ce9833786838d2c2d3d8 to fix panic

Fixes #647

Change-Id: Ic348ef6a19446de6a027d93aab748224b5f46a1d
2015-10-27 23:18:07 +01:00
mpl d9d5088fbe pkg/server/sync: actually use runSync 1st arg
Change-Id: I9866b980595f72cdb1996fdd40c7195a7265d071
2015-10-26 19:18:01 +01:00
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
mpl c9e6ca58ef deploy/gce: use our own systemd-docker image
Fixes issue #646

Change-Id: I209132ec45cb433804b4cc86513aee252f17ea21
2015-10-19 22:27:54 +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
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 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
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
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
Brad Fitzpatrick 467aa73750 Merge "Address TODO by moving CAMLI_DEBUG checks into env" 2015-08-25 15:55:38 +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