Commit Graph

3318 Commits

Author SHA1 Message Date
Rafael Weinstein 3cea4e9216 Graphql empty collections and types (#3157)
We need to fully map the noms types into graphql even though the mapping isn't useful, otherwise the endpoint may die when attempting to create a schema for types that aren't mapped.
2017-02-07 13:30:48 -08:00
Rafael Weinstein 487e2c9b30 GraphQL cleanup (#3154) 2017-02-07 12:08:52 -08:00
Erik Arvidsson 27c539ebd4 Update to use eslint-config-noms@1.2.0 (#3151) 2017-02-07 09:57:27 -08:00
Rafael Weinstein 00d16999e0 Better naming for graphql fields (#3153) 2017-02-06 19:45:48 -08:00
Rafael Weinstein fff532beb3 Add experimental graphql support (#3146)
Included README.md describes initial features.

This patch includes a simple graphiql ui which is preconfigured to explore a noms/graphql endpoint
2017-02-06 19:28:54 -08:00
Mike Gray 466cab880f Remove unused samples (#3150) 2017-02-06 18:55:29 -08:00
Erik Arvidsson f40c941dc9 Update eslint-config-noms to enforce comma-spacing (#3149) 2017-02-06 17:08:58 -08:00
Erik Arvidsson 8378d4952e Jest (#3145)
This changes to use Jest. Benefits of jest is parallel tests and jest can run the minimal set of tests that are affected by a change (by looking at dependencies).

The main work was to disentangle our cyclic dependencies. To do this I had to remove some runtime assertions in encode value as well as expose the values of a struct without going through a struct mirror.
2017-02-06 15:13:53 -08:00
cmasone-attic ffa6de50a5 Funnel extract failure back to main goroutine (#3147)
Panics on background goroutines take down the server. This patch
hacks in a mechanism to pipe failures during NBS tableReader.extract
back to the main goroutine so the server doesn't die on this failure
and I can diagnose it.
2017-02-06 11:53:57 -08:00
cmasone-attic 8e40ee4959 First pass at compaction (#3143)
* First pass at compaction

The first cut at compaction blocks UpdateRoot() while it compacts n/2
tables down into a single, large table (where n == number of tables
named in the NBS manifest). It then attempts to update the manifest
with one referencing the compacted table, the novel tables from the
client, and the remaining upstream tables that were not compacted.

If the update fails, probably due to an optimistic lock failure, the
client drops the compacted table it just created, pulls in the tables
from the newly-discovered upstream manifest, and tries again.

Known flaws:
- may explode RAM (#3130)
- doesn't handle novel tables > max tables (#3142)
- may handle optimistic-lock-failures suboptimally (#3141)

Fixes #3132

Also, fixes #2944 because doing so simplifies some code.
2017-02-03 15:58:04 -08:00
Ben Kalman 1379fe7cb7 Pass fetch options through to updateRoot (#3140) 2017-01-31 17:24:33 -08:00
Erik Arvidsson 8b7c9742a4 Remove our custom copy-flow-files (#3139)
It was using a file watcher which was causing us to run out of inodes
on our Jenkins build. Instead, use flow-copy-source which does the
same copying without a file wathcer (we no longer used the --watch flag
anyway).
2017-01-31 14:46:32 -08:00
Ben Kalman b3f4981213 I am back (#3138) 2017-01-31 14:26:36 -08:00
Erik Arvidsson d74836984d yarn publish is broken (#3137) 2017-01-31 13:50:29 -08:00
Erik Arvidsson f66a0e8a89 Update to Flow 0.38 (#3136) 2017-01-31 13:39:31 -08:00
Ben Kalman aa583fa510 Guard JS http-batch-store accessing deleted chunk (#3134)
Workaround for https://github.com/attic-labs/noms/issues/3133.
2017-01-31 11:36:27 -08:00
Dan Willhite 10570f591e Fix print_diff when map is keyed by non-primitive (#3128) 2017-01-30 18:40:52 -08:00
Aaron Boodman 0b596da7be Add noms root command for getting and setting root of entire db (#2992)
* Add `noms root` command for getting and setting root of entire db

* fix missing import

* rebase, review feedback

* review feedback

* moar review
2017-01-30 17:34:06 -08:00
cmasone-attic 04eaf9d326 NBS dynamoManifest must perform a consistent read (#3129)
DynamoDB provides eventual read-after-write consistency, unless you
ask explicitly for strong consistency. When committing over HTTP, the
code writes a bunch of Values and then attempts to UpdateRoot to point
to one of those novel chunks. The UpdateRoot call _must_ see the
result of the prior WriteValue, or it may fail.

Fixes #3084
2017-01-30 14:53:09 -08:00
Erik Arvidsson b287ad9462 Update run_pr_builder.sh
Add `-v` again
2017-01-27 18:03:00 -08:00
Ben Kalman 8d0cd2c109 Noms JS version 69.3.0 (#3125) 2017-01-27 16:54:23 -08:00
Ben Kalman 3528196f53 Pass the fetchOptions to writeBatch in HttpBatchStore (#3124)
This allows JS to make authenticated writes to Noms.
2017-01-27 16:32:39 -08:00
Erik Arvidsson 04ecdaa311 Revert "Update run_pr_builder.sh" (#3119)
This reverts commit 6b5e8dad0d.

Still happening...
2017-01-27 10:18:46 -08:00
Erik Arvidsson 6b5e8dad0d Update run_pr_builder.sh
Testing again
2017-01-27 09:56:57 -08:00
Erik Arvidsson 59ecc40c6e publish-to-npm: Fix python call (#3117) 2017-01-26 11:58:32 -08:00
Erik Arvidsson 2ba3a3e129 Update publish-to-npm.py for yarn (#3116) 2017-01-26 11:18:40 -08:00
Erik Arvidsson 076b88134a Integration test: Just disable samples/js/fs
samples/js/fs fails with

```
+ go test -v github.com/attic-labs/noms/samples/js/fs
=== RUN   TestIntegration
== Calling npmInstall
yarn install v0.19.1
$ cp ../../../js/noms/.babelrc ../.eslintrc.js ../../../js/noms/.flowconfig .
[1/4] Resolving packages...
success Already up-to-date.
$ yarn run build
yarn run v0.19.1
$ BABEL_ENV=production babel -d dist src 
Build step 'Execute shell' marked build as failure
```

We also have:

```
+ ls -al /var/workspace/src/github.com/attic-labs/noms/samples/js/fs
total 124
drwxrwxrwx 3 112 116  4096 Jan 26 04:08 .
drwxrwxrwx 8 112 116  4096 Jan 26 04:08 ..
-rw-rw-rw- 1 112 116    59 Jan 26 04:08 .gitignore
-rw-rw-rw- 1 112 116   244 Jan 26 04:08 dummy.go
-rw-rw-rw- 1 112 116  1162 Jan 26 04:08 integration_test.go
-rw-rw-rw- 1 112 116   666 Jan 26 04:08 package.json
drwxrwxrwx 2 112 116  4096 Jan 26 04:08 src
-rw-rw-rw- 1 112 116    13 Jan 26 04:08 test-data.txt
-rw-rw-rw- 1 112 116 93335 Jan 26 04:08 yarn.lock
```

But it is not clear why this is different than the other samples.
2017-01-25 20:14:56 -08:00
Erik Arvidsson 361ae3a77e Integration test: Debugging... 2017-01-25 20:07:42 -08:00
Erik Arvidsson a1df010524 Integration tests: Output yarn to stdout/stderr (#3115) 2017-01-25 18:02:13 -08:00
Erik Arvidsson 6a800f6518 Integration test saga: Add -v to go test 2017-01-25 16:33:47 -08:00
Erik Arvidsson e6bc8c9054 Manually list the integration tests (#3114) 2017-01-25 15:55:56 -08:00
Erik Arvidsson c7db32037e Moar logging for integrations test (#3113) 2017-01-25 15:09:16 -08:00
Rafael Weinstein a34a444f42 Fix cache/value store caching (#3111)
* Fixes a long standing bug in which the RemoteBatchStore is accidentally caching all chunks
* ValueStore's value cache now stores `Promise<?Value>` so that concurrent `readValues` of the same value can share a single decoding
* Removes the debug-only chunk hash check which keeps tripping up perf investigations
2017-01-25 14:41:15 -08:00
Erik Arvidsson 9689248028 Add more logging info for test runners (#3112) 2017-01-25 13:49:14 -08:00
Rafael Weinstein edf8b55f26 dont use read ahead for map.first/last (#3110) 2017-01-24 13:12:09 -08:00
cmasone-attic e72ab4a097 NBS UpdateRoot() returns false when last != nbs.Root() (#3109)
This code initially panicked in this case, because there didn't used
to be a reasonable way that a caller might wind up trying to update
away from a Root that didn't match NomsBlockStore's internal
bookkeeping. Now, given the new Flush() behavior there is. So, just
return false and allow the caller to take appropriate action.

Towards #3089
2017-01-24 11:00:21 -08:00
Rafael Weinstein 85d43b2fcd Update README.md 2017-01-24 10:13:58 -08:00
Rafael Weinstein aaa66ea86f Update README.md 2017-01-23 16:24:43 -08:00
Aaron Boodman 7e5af655e7 bump version because of format version change (#3107) 2017-01-23 15:50:32 -08:00
Rafael Weinstein 08d9d5f4aa Introduce walk.WalkDifferentStructs (#3104)
This patch adds a static function which can walk graphs looking for (and diffing) two structs. It uses type information to avoid traversing sub-values which can't contain structs. It also uses a similar approach as sync to avoid visiting common sub-chunk-graphs.
2017-01-23 15:21:41 -08:00
Rafael Weinstein d890a35b92 Update README.md 2017-01-23 15:19:31 -08:00
Rafael Weinstein 77a24a0730 Update README.md 2017-01-23 15:17:58 -08:00
cmasone-attic cfa109f502 Switch Map/Set Diff to use top-down by default (#3106)
The only thing that wants what we used to call the "best" diff
algorithm is the command-line tools. Non-interactive programs all want
the algorithm that finishes up fastest, which is top-down.

Fixes https://github.com/attic-labs/attic/issues/627
2017-01-23 15:08:50 -08:00
Mike Gray c7ae4b31fe Fix warning of unmet peer dependency (#3105) 2017-01-23 17:39:46 -05:00
cmasone-attic d809bb2a09 Increase Chunk locality when writing Values through ValueStore (#3064)
Readahead + NBS benefit greatly when "related" Chunks are close to
each other. The current code did a good job of writing siblings in the
Chunk graph next to each other, but "cousins" (that is, children whose
parents are siblings) might wind up spread quite far apart.  This
patch makes WriteValue hold onto novel Chunks until it sees a
_grandparent_ come through the pipeline. All of that Chunk's queued
grandchildren will be Put at that time.

Additionally, ValueStore.Flush() now takes a Hash and flushes all
Chunks that are reachable from the Chunk with that Hash, as opposed
to simply flushing all Chunks to the BatchStore. This means that
there's now no supported way to write orphaned Chunks/Values to a
Database.

Fixes #3051


* More logging for TestStreamingMap2
2017-01-23 12:16:55 -08:00
cmasone-attic 6e72c137a2 Make database root a Map<String, Ref<Value>> (#3093)
Since the head of each dataset can have an arbitrarily complex
type, type accretion leads the Datasets map at the root of the
DB to become very large. This type info isn't really very useful
at that level either. So, get rid of it by making this map be
from String -> Ref<Value>.

Fixes #2869
2017-01-22 11:17:17 -08:00
Rafael Weinstein da22039017 add 1-year Cache-Contro: max-age to /getBlob/ urls (#3098) 2017-01-22 09:33:07 -08:00
Erik Arvidsson d4132e9e6c Use cp instead of ln (#3100) 2017-01-20 18:41:56 -08:00
cmasone-attic 5801bd9d2a Retry NomsBlockStore.Flush() with exponential backoff (#3094)
* Vendor in small backoff library

* Retry NomsBlockStore.Flush() with exponential backoff

Fixes #3089
2017-01-20 13:25:49 -08:00
Erik Arvidsson e90bfcbd2a Switch to Yarn (#3092)
brew install yarn
2017-01-20 11:42:32 -08:00