@elaraai/e3-cloud-files 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,9 +18,11 @@ changed, the same way on a local repository and on a deployed workspace.
18
18
  first state, and in its history the seed names the file. A record's
19
19
  mutation may be fed by files: each new file is the mutation's one
20
20
  argument, applied once.
21
- - **Push from disk.** `e3-cloud files push` puts files from your machine
22
- into a source and takes them in, with your e3 login alone where the source
23
- is the deployment's own bucket.
21
+ - **Push from disk, or from a workspace.** `e3-cloud files push` puts files
22
+ from your machine into a source and takes them in, with your e3 login
23
+ alone where the source is the deployment's own bucket. A value an e3
24
+ workspace computes (`dataset:dev.customer_book`) pushes as the file of its
25
+ value would, with no file kept by hand, and the history names the dataset.
24
26
  - **Nothing polls.** A sync runs when someone asks for it, and reads only the
25
27
  files that changed since the last one.
26
28
 
@@ -154,14 +156,18 @@ export const customerCount = e3.task('customer_count', [customers], …);
154
156
  - **In its history** the seed reads as any commit, through the `files`
155
157
  channel: "Initialised from customers.beast2 (12,004 rows)", "Seeded again
156
158
  from customers.beast2 (12,100 rows)", on the record's page and in
157
- `e3-cloud records history`. A rollback to an earlier seed brings its state
158
- back, as to any commit.
159
+ `e3-cloud records history`; a file pushed from a dataset names it too,
160
+ with its value's hash ("…, from dev.customer_book at 3f9a2b1c4d5e"). A
161
+ rollback to an earlier seed brings its state back, as to any commit.
159
162
  - **A deploy that cannot keep the record** (its type changed) under
160
163
  `--schema reset` unassigns it: pending again, seeded by the next version's
161
164
  file once the new declarations are deployed.
162
165
  - The file is taken in as a typed input is (by pieces, resumable), then
163
166
  committed as a system commit with the file's key, ETag and SHA-256 as its
164
- arguments, under one hold of the repository's running work.
167
+ arguments (and, for a file pushed from a dataset, the dataset's path and
168
+ its value's hash after them), under one hold of the repository's running
169
+ work. The report numbers each seed among the record's: `$init #1`, then
170
+ `$seed #2`, and so on.
165
171
 
166
172
  ## A record fed through a mutation
167
173
 
@@ -226,8 +232,52 @@ Next: e3 dataflow run https://e3.example.com/repos/acme dev
226
232
  what is not there. `--dry-run` plans and puts nothing.
227
233
  - The output is a row per file: the file, its target and kind, its size,
228
234
  `put`, `unchanged` or `refused`, and what the sync did (`taken in` with
229
- the rows, `$init`/`$seed` or the mutation with its commit, `kept`, or the
230
- refusal). The command exits 1 when any file was refused or failed.
235
+ the rows, `$init #1` or `$seed #n` with the rows, the mutation with its
236
+ commit, `kept`, or the refusal). The command exits 1 when any file was
237
+ refused or failed.
238
+
239
+ ### A workspace's dataset
240
+
241
+ A value an e3 workspace computes (a task's output, an input or a record)
242
+ pushes as the file of its value would, with no file kept by hand: name it
243
+ `dataset:<workspace>.<name>` among the paths, in the repository `--from`
244
+ names. That is a local repository's path or a repository's URL, and
245
+ defaults as e3's own `[repo]` does (`$E3_REPO`, then `.`). Files,
246
+ directories and datasets mix in one push.
247
+
248
+ ```
249
+ $ e3-cloud files push https://e3.example.com/repos/acme dev dataset:dev.customers --from ./archive
250
+ upload s3://acme-files/acme/dev/
251
+ dataset:dev.customers (task output) → record:customers seed 3 MiB put $init #1 12,004 rows
252
+ ```
253
+
254
+ - **Matched by its name**: a dataset goes to the `file` or `latest`
255
+ mapping that fills the input or the record of its name
256
+ (`dataset:dev.customers` → `record:customers`), else `--as` names its
257
+ target, any `file` or `latest` mapping's (a mutation's too). It is put at
258
+ a `file` mapping's key, or under a `latest` mapping's prefix as
259
+ `<name>.beast2` (refused `not_latest` as a file is). A `folder` or a
260
+ `listing` takes no dataset: a dataset is one value.
261
+ - **Its bytes are its value's**, as `e3 dataset get -f beast2` writes it,
262
+ its header its declared type: read from the repository a segment at a
263
+ time, never held whole, and checked against the mapping's type before
264
+ anything is put (`type_mismatch`, naming both). They are read once to
265
+ measure them and again as they upload, and a dataset a run writes again in
266
+ between fails in its row, never put as something else: push it again.
267
+ - **The same stored value is `unchanged`**: nothing put, nothing downstream
268
+ runs. A dataset changed since (a run, a value set) is put and taken in by
269
+ the target's rules: a record seeded again while nothing has mutated it,
270
+ kept once something has, seeded over it on `--reset`.
271
+ - **Refused in its row**, the rest going on: a dataset that is unassigned (a
272
+ task output not produced since its workspace's last deploy, an input never
273
+ set, a record with no state yet), or one the workspace doesn't hold.
274
+ - **Named where it lands**: the object is put with metadata naming the
275
+ dataset and its value's hash (`e3-dataset`, `e3-dataset-hash`), and a
276
+ seed's or a feed's commit records them, so its history reads "Initialised
277
+ from customers.beast2 (12,004 rows), from dev.customers at 3f9a2b1c4d5e".
278
+ - A local repository works at either end: the push reads a local
279
+ repository's datasets through e3 on your machine, and a deployed one's
280
+ through its API with your e3 login.
231
281
 
232
282
  ## Making a beast2 file
233
283
 
@@ -236,7 +286,8 @@ A beast2 file already is an East value. The East SDK writes one from a value
236
286
  (`Beast2ElementWriter`, which the platform's own tests use for files of a
237
287
  gibibyte); east-py writes one from Python; `e3 convert` converts a file of
238
288
  another format; `e3 dataset get -f beast2` writes any dataset of a workspace
239
- as one. A typed mapping takes it as it stands, its header saying its type.
289
+ as one, though a push takes the dataset itself (A workspace's dataset,
290
+ above). A typed mapping takes it as it stands, its header saying its type.
240
291
 
241
292
  ## Decoding in a task
242
293
 
@@ -312,8 +363,8 @@ e3 dataflow run ./repo dev
312
363
  what a sync would take and takes nothing. A sync doesn't run the dataflow:
313
364
  `e3 dataflow run` does, and the sync prints the command when anything
314
365
  changed.
315
- - **`files push`** puts files from disk into a source and takes them in
316
- (Pushing files from disk, above).
366
+ - **`files push`** puts files from disk, and workspaces' datasets, into a
367
+ source and takes them in (Pushing files from disk, above).
317
368
  - **`files status`** shows each mapping with its shape, its type, the file
318
369
  it holds and the commit it made (or `pending` for a record not yet
319
370
  seeded), where each source is bound, and the last sync.
@@ -451,14 +502,20 @@ In `@elaraai/e3-cloud-types`, re-exported here:
451
502
  typed value taken (`FilesTakenType`: its rows), the commit a seed or feed
452
503
  made, and why a seed was kept or a feed waits.
453
504
  - `FilesStatusType` (each mapping with what it holds and whether its record
454
- is pending), `FilesProblemType`, the push's `FilesPushRequestType` and
455
- `FilesPushPlanType`.
456
- - Values stored by the first version (mappings by input, a refusal as one
457
- text) are read by their header's type and lifted
458
- (`@elaraai/e3-cloud-files/compat`): declarations, ledgers and reports a
459
- workspace stored before this version read as they were, and are written
460
- again in the current form on their next write. A local repository's state
461
- file says its version (`version: 2`).
505
+ is pending), `FilesProblemType`, the push's `FilesPushRequestType` (each
506
+ file's `FilesPushFileType`, with the dataset it is the value of, if one)
507
+ and `FilesPushPlanType`.
508
+ - `FilesSeedCommitType`: a seed's commit, `$init` or `$seed`, and its number
509
+ among the record's seeds, in a mapping's report.
510
+ - `FilesDatasetOriginType`: where a pushed file came from, a dataset's path
511
+ and its value's hash, as the object's metadata carries it
512
+ (`filesDatasetMetadata`, read back by `filesDatasetOriginOf`).
513
+ - Values stored by earlier versions (the first: mappings by input, a refusal
514
+ as one text; the second: a record's seeds not counted) are read by their
515
+ header's type and lifted (`@elaraai/e3-cloud-files/compat`):
516
+ declarations, ledgers and reports a workspace stored before this version
517
+ read as they were, and are written again in the current form on their next
518
+ write. A local repository's state file says its version (`version: 3`).
462
519
  - The inputs' types: `FilesFileType` (`Blob`), `FilesFolderType`
463
520
  (`Dict<String, Blob>`), `FilesListingType`.
464
521
 
@@ -471,7 +528,7 @@ In `@elaraai/e3-cloud-types`, re-exported here:
471
528
  | `@elaraai/e3-cloud-files/sync` | The sync (`syncFiles`) over what reads, writes and remembers, the push's plan (`planPush`), and the ports in memory for tests |
472
529
  | `@elaraai/e3-cloud-files/storage` | The sync's writer over an e3 store, and the cloud's over a staging (needs `@elaraai/e3-core`) |
473
530
  | `@elaraai/e3-cloud-files/s3` | The sync's reader of a bucket (needs `@aws-sdk/client-s3`) |
474
- | `@elaraai/e3-cloud-files/compat` | The first version's stored types, and their lift into the current ones |
531
+ | `@elaraai/e3-cloud-files/compat` | The earlier versions' stored types, and their lift into the current ones |
475
532
  | `@elaraai/e3-cloud-files/examples/*` | The worked examples (`orders`, `typed`) and the decoding examples (`decode`) |
476
533
 
477
534
  ## License