Commit graph

1462 commits

Author SHA1 Message Date
Stephen J Day
fc7b47cdae Port client to use URLBuilder to create urls
This change ports the client use the URLBuilder to create urls. Without this,
it produces broken urls for certain use cases. The client has also been updated
to no longer use the size argument to complete blob uploads. Much of this work
has been done after testing with the staging registry instance.
2014-12-12 19:09:26 -08:00
Stephen J Day
a4f42b8eea Relax requirement for size argument during blob upload
During client implementation, it was found that requiring the size argument
made client implementation more complex. The original benefit of the size
argument was to provide an additional check alongside of tarsum to validate
incoming data. For the purposes of the registry, it has been determined that
tarsum should be enough to validate incoming content.

At this time, the size check is optional but we may consider removing it
completely.
2014-12-12 19:08:50 -08:00
Stephen Day
8fd47c1c18 Merge pull request #849 from BrianBland/ng-error-reporting
Adds bugsnag and newrelic metrics and error reporting
2014-12-12 18:29:25 -08:00
Brian Bland
cd057fd120 Updates configuration tests for bugsnag and newrelic params 2014-12-12 18:05:37 -08:00
Brian Bland
43a50b5e82 Adds bugsnag and newrelic metrics and error reporting
Configuration variables are added under the REGISTRY_REPORTING
namespace, for example REGISTRY_REPORTING_BUGSNAG_APIKEY
2014-12-12 17:49:06 -08:00
Olivier Gambier
d726630ad0 Merge pull request #846 from stevvooe/next-generation
Consolidate routes and error codes into v2 package
2014-12-12 17:17:24 -08:00
Stephen J Day
3916938481 Add tests for URLBuilder 2014-12-12 15:48:41 -08:00
Stephen J Day
bb300231d0 Allow variadic url values for BuildBlobUploadURL
URL values may be required to complete an upload in a single POST request,
which may include digest and size. This is not implemented in the server side,
yet, but is part of the HTTP API specification.
2014-12-12 15:36:16 -08:00
Stephen J Day
d08f0edcf1 Migrate references to consolidated v2 package
Routes and errors are now all referenced from a single v2 package. This
packages exports are acceptable for use in the server side as well as
integration into docker core.
2014-12-12 15:36:15 -08:00
Stephen J Day
5abfc91021 Merge errors and urls package into unified v2 package
To provide a single package with v2 API definitions, the locked down portions
of the API have been merged into a single package. References to exported items
will appear as v2.XXX, indicating their origin. The definitions in this package
will soon be locked down for change, acceppting only additions that will not
change protocol behavior.
2014-12-12 15:36:15 -08:00
Stephen J Day
92dca269f0 Change errors export from Descriptors to ErrorDescriptors 2014-12-12 15:36:15 -08:00
Stephen J Day
e14e5d14b1 Correct documentation errors in urls package 2014-12-12 15:36:15 -08:00
Stephen J Day
83f882b427 Migrate webapp to use exported urls.URLBuilder package 2014-12-12 15:36:15 -08:00
Stephen J Day
9b872ca150 Prepare urls.URLBuilder package for export
The URLBuilder is now exported with documentation for its behavior. Its a light
wrapper around gorilla mux that avoids one having to remember exact arguments
take by each route.
2014-12-12 15:36:15 -08:00
Stephen J Day
e5b6da80d0 Move urls.go into urls package 2014-12-12 15:36:15 -08:00
Stephen J Day
5b13e95511 Porting registry to use urls package
This simply moves the registry app to be using the urls package and its
exported route names. This supports locking down exported route definitions for
use in client packages.
2014-12-12 15:36:15 -08:00
Stephen J Day
da19114d1a Prepare urls package for exports
The route definition files have been prepared for export with documentation.
Consts have been updated and tests are now passing for the urls package.
2014-12-12 15:36:15 -08:00
Stephen J Day
c78d173cf7 Move routes to urls package
To lock down V2 api routing, we are moving it to a separate package, with an
exported router creation function and route names. Updates will follow to
prepare the package for export.
2014-12-12 15:36:15 -08:00
Stephen Day
47324d0398 Merge pull request #844 from BrianBland/ng-storagedriver-tests
Enforces a path format for storage drivers
2014-12-11 20:14:50 -08:00
Brian Bland
5fbf08bab5 Adds tests for storage driver handling of valid and invalid paths 2014-12-11 14:54:04 -08:00
Brian Bland
8a1889efeb Enforces a path format for storage drivers (#819)
Requires all paths in the inmemory and filesystem drivers to begin with
a slash, and then contain only valid path components (2+ alphanumeric
characters with optional period, hyphen, and underscore separators)
delimited by slashes.

Also updates the storage driver test suites to construct paths of this
format, and causes the suite to abort if files are not cleaned up after
the test run.
2014-12-11 14:19:41 -08:00
Olivier Gambier
18ace1f454 Merge pull request #842 from stevvooe/next-generation
Pluralize API methods and add the base endpoint to support API checks
2014-12-11 01:47:21 -08:00
Stephen J Day
76929fb63f Implement V2 API base endpoint
This implements a base endpoint that will respond with a 200 OK and an empty
json response. Such an endpoint can be used as to ping the v2 service or as an
endpoint to check authorization status.
2014-12-10 22:43:45 -08:00
Stephen J Day
2a16a2ff6a Pluralize route API paths
During the specification period, it was suggested that pluralized object names
are more idiomatic in APIs than singular. This changeset simply adopts that
preference for the API going forward. The client has been updated to remain
compatible.
2014-12-10 22:29:58 -08:00
Olivier Gambier
3bbc8ce3c2 Fix address 2014-12-10 17:59:13 -08:00
Stephen Day
a1f74a783a Merge pull request #840 from BrianBland/ng-storagedriver-tests
Increases stress test factor of TestConcurrentFileStreams
2014-12-10 17:38:51 -08:00
Olivier Gambier
500d11564b Merge pull request #841 from stevvooe/next-generation
Export error descriptors and provide tool generate markdown table
2014-12-10 16:54:15 -08:00
Stephen J Day
b721b0a15c Export error descriptors and provide tool generate markdown table
To support accurate specification generation, this changeset includes a quick
and dirty tool to generate a markdown table of error codes generated by the
registry API. Equivalent supports for routes will likely follow.

Exported descriptors could be used to generate other documentation, as well.
2014-12-10 16:41:43 -08:00
Brian Bland
f57e544919 Increases stress test factor of TestConcurrentFileStreams
Also makes this test respect the Short flag, reducing the number of
threads by a factor of 4 and space usage by a factor of 16

Note: this test is probably unreasonable to run on the inmemory driver
without the Short flag
2014-12-10 16:20:14 -08:00
Olivier Gambier
91cea1aa16 Merge pull request #839 from stevvooe/next-generation
Initial Dockerfile for running registry
2014-12-10 16:01:02 -08:00
Stephen J Day
87c10960d2 Initial Dockerfile for running registry 2014-12-10 15:57:41 -08:00
Olivier Gambier
e1e026418c Merge pull request #838 from BrianBland/ng-circle
Re-enables "go vet" in circle.yml
2014-12-10 15:34:15 -08:00
Brian Bland
d9c2203f9f Re-enables "go vet" in circle.yml 2014-12-10 15:27:19 -08:00
Olivier Gambier
c7dc83442b Merge pull request #835 from stevvooe/next-generation
Lock down HTTP API error codes
2014-12-10 13:23:06 -08:00
Stephen J Day
7b56d10076 Lock down HTTP API error codes
This commit locks down the set of http error codes that will be part of the
inital V2 specification, proposed in docker/docker#9015. The naming order has
been slightly changed and there are few tweaks to ensure all conditions are
captured but this will be set the docker core will be impleemnted against.

To support this, the errors have been moved into an api/errors package. A new
type, ErrorDescriptor, has been defined to centralize the code, message and
definitions used with each type. The information therein can be used to
generate documentation and response code mappings (yet to come...).

In addition to the refactoring that came along with this change, several tests
have been added to ensure serialization round trips are reliable. This allows
better support for using these error types on the client and server side. This
is coupled with some tweaks in the client code to fix issues with error
reporting.

Other fixes in the client include moving client-specific errors out of the base
package and ensuring that we have correct parameters for finishing uploads.
2014-12-10 11:49:04 -08:00
Stephen J Day
33d89b4bca Disabling go vet until we get bug fixed 2014-12-10 11:41:49 -08:00
Stephen Day
0317f17c41 Merge pull request #837 from BrianBland/ng-storagedriver-tests
Various storagedriver test additions/improvements
2014-12-10 11:28:39 -08:00
Brian Bland
8a555bbb5f Attempts to fix go vet for circle 2014-12-10 11:12:47 -08:00
Brian Bland
9297693675 Improves storagedriver concurrency testing
Creates trees instead of flat files for TestConcurrentFileStreams

Adds TestConcurrentStreamReads, which writes a large file (smaller in
Short mode), and then ensures that several concurrent readers properly
read their portions of the file with random offsets
2014-12-10 10:57:47 -08:00
Brian Bland
cb25cc65bf Fixes storagedriver Stat test
Checks Stat on the directory before creating the file to make sure that
it does not exist
Properly cleans up after the test.
2014-12-10 10:55:33 -08:00
Brian Bland
14a072cd5f Improves storagedriver tests for Move command semantics
Ensures that Move will properly overwrite the file at the destination
location.
Also checks that Move of a nonexistent source file will NOT delete the
file at the destination.
2014-12-10 10:53:51 -08:00
Brian Bland
bbf288a808 Adds another error test case for reading nonexistent files 2014-12-10 10:51:07 -08:00
Olivier Gambier
8dcec82212 Update LICENSE 2014-12-10 10:10:20 -08:00
Stephen Day
12326f7090 Merge pull request #834 from stevvooe/next-generation
Implement tags HTTP API handler
2014-12-09 21:02:59 -08:00
Stephen Day
043c81bea2 Merge pull request #832 from BrianBland/ng-storagedriver-tests
Updates storagedriver tests to better test directory trees
2014-12-09 21:01:40 -08:00
Brian Bland
d375e264e1 Makes circle.yml run tests with the "-test.short" flag
This is due to longer tests which require more storage/memory than is
granted to us by the circle test runner vms.
2014-12-09 18:04:05 -08:00
Brian Bland
94052ea213 Fixes normalization of inmemory file paths
A normalized path always begins with "/" and never has a trailing slash
unless it is the root directory.
2014-12-09 17:20:10 -08:00
Stephen J Day
722ca35841 Test Tags HTTP API methods during manifest upload 2014-12-09 15:36:26 -08:00
Stephen J Day
10e5276c0e Add error code for unknown repository 2014-12-09 14:19:38 -08:00
Stephen J Day
33b2b80a8c Remove errant log message 2014-12-09 14:19:07 -08:00