Skip to content

Commit

Permalink
schema: Drop requirement on ostree transaction commit metadata
Browse files Browse the repository at this point in the history
Things like `ostree-content-bytes-written` shouldn't be a hard
requirement because they're really just transient information.

Something changed recently for me such that rpm-ostree went into
the "repository is on netfs" mode which disables the transaction
commit, which in turn drops this metadata.  And then without
that metadata various cosa operations were dying messily
for no reason.

We should really take a harder look at the schema and what's
required.

But dropping these keys gets me `cosa meta --print-value ref`
working again.
  • Loading branch information
cgwalters authored and openshift-merge-robot committed Mar 11, 2021
1 parent 45585d3 commit 802edf6
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 84 deletions.
42 changes: 0 additions & 42 deletions docs/gangplank/api-cosa.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,7 @@ var generatedSchemaJSON = `{
"buildid",
"name",
"ostree-commit",
"ostree-content-bytes-written",
"ostree-content-checksum",
"ostree-n-cache-hits",
"ostree-n-content-total",
"ostree-n-content-written",
"ostree-n-metadata-total",
"ostree-n-metadata-written",
"ostree-timestamp",
"ostree-version",
"rpm-ostree-inputhash",
Expand Down Expand Up @@ -609,49 +603,19 @@ var generatedSchemaJSON = `{
"default":"",
"minLength": 64
},
"ostree-content-bytes-written": {
"$id":"#/properties/ostree-content-bytes-written",
"type":"integer",
"title":"ostree-content-bytes-written",
"default": 0
},
"ostree-content-checksum": {
"$id":"#/properties/ostree-content-checksum",
"type":"string",
"title":"ostree-content-checksum",
"default":"",
"minLength": 64
},
"ostree-n-cache-hits": {
"$id":"#/properties/ostree-n-cache-hits",
"type":"integer",
"title":"ostree-n-cache-hits",
"default": 0
},
"ostree-n-content-total": {
"$id":"#/properties/ostree-n-content-total",
"type":"integer",
"title":"ostree-n-content-total",
"default": 0
},
"ostree-n-content-written": {
"$id":"#/properties/ostree-n-content-written",
"type":"integer",
"title":"ostree-n-content-written",
"default": 0
},
"ostree-n-metadata-total": {
"$id":"#/properties/ostree-n-metadata-total",
"type":"integer",
"title":"ostree-n-metadata-total",
"default": 0
},
"ostree-n-metadata-written": {
"$id":"#/properties/ostree-n-metadata-written",
"type":"integer",
"title":"ostree-n-metadata-written",
"default": 0
},
"ostree-timestamp": {
"$id":"#/properties/ostree-timestamp",
"type":"string",
Expand Down Expand Up @@ -904,13 +868,7 @@ type Build struct {
Name string `json:"name"`
Oscontainer *Image `json:"oscontainer,omitempty"`
OstreeCommit string `json:"ostree-commit"`
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
OstreeContentChecksum string `json:"ostree-content-checksum"`
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
OstreeNContentTotal int `json:"ostree-n-content-total"`
OstreeNContentWritten int `json:"ostree-n-content-written"`
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
OstreeTimestamp string `json:"ostree-timestamp"`
OstreeVersion string `json:"ostree-version"`
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions fixtures/fcos.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"ref": "fedora/x86_64/coreos/testing-devel",
"ostree-n-metadata-total": 9137,
"ostree-n-metadata-written": 21,
"ostree-n-content-total": 4774,
"ostree-n-content-written": 24,
"ostree-n-cache-hits": 15605,
"ostree-content-bytes-written": 76970521,
"ostree-commit": "981ddd48f99d8d30caa85c81e02ab4f0d20b957f031db81b7bccfe8f54b679ce",
"ostree-content-checksum": "a2ba5f894b56613d92f236ffc98719b18a6838081c24dd33f04fce3bdf366d82",
"ostree-version": "31.20200310.20.0",
Expand Down
6 changes: 0 additions & 6 deletions fixtures/rhcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,7 @@
"image": "registry.svc.ci.openshift.org/rhcos-devel/machine-os-content"
},
"ostree-commit": "9665ab0cfd4a995cf70f1a3bb678d3515a03f7d3b5bb87d723ba06c26f0daa6e",
"ostree-content-bytes-written": 156269945,
"ostree-content-checksum": "e02647edba305ad68e2c7c5bb3a2c7765eb4ea6aadd1ebf8e538e459ebf99ed7",
"ostree-n-cache-hits": 19185,
"ostree-n-content-total": 3688,
"ostree-n-content-written": 1210,
"ostree-n-metadata-total": 9225,
"ostree-n-metadata-written": 3015,
"ostree-timestamp": "2020-01-15T19:31:31Z",
"ostree-version": "44devel.81.202001151926.0",
"pkgdiff": [
Expand Down
6 changes: 0 additions & 6 deletions gangplank/cosa/schema_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,7 @@ var generatedSchemaJSON = `{
"buildid",
"name",
"ostree-commit",
"ostree-content-bytes-written",
"ostree-content-checksum",
"ostree-n-cache-hits",
"ostree-n-content-total",
"ostree-n-content-written",
"ostree-n-metadata-total",
"ostree-n-metadata-written",
"ostree-timestamp",
"ostree-version",
"rpm-ostree-inputhash",
Expand Down
6 changes: 0 additions & 6 deletions gangplank/cosa/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ type Build struct {
Name string `json:"name"`
Oscontainer *Image `json:"oscontainer,omitempty"`
OstreeCommit string `json:"ostree-commit"`
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
OstreeContentChecksum string `json:"ostree-content-checksum"`
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
OstreeNContentTotal int `json:"ostree-n-content-total"`
OstreeNContentWritten int `json:"ostree-n-content-written"`
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
OstreeTimestamp string `json:"ostree-timestamp"`
OstreeVersion string `json:"ostree-version"`
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`
Expand Down
12 changes: 6 additions & 6 deletions mantle/cosa/cosa_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ type Build struct {
Name string `json:"name"`
Oscontainer *Image `json:"oscontainer,omitempty"`
OstreeCommit string `json:"ostree-commit"`
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
OstreeContentBytesWritten int `json:"ostree-content-bytes-written,omitempty"`
OstreeContentChecksum string `json:"ostree-content-checksum"`
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
OstreeNContentTotal int `json:"ostree-n-content-total"`
OstreeNContentWritten int `json:"ostree-n-content-written"`
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
OstreeNCacheHits int `json:"ostree-n-cache-hits,omitempty"`
OstreeNContentTotal int `json:"ostree-n-content-total,omitempty"`
OstreeNContentWritten int `json:"ostree-n-content-written,omitempty"`
OstreeNMetadataTotal int `json:"ostree-n-metadata-total,omitempty"`
OstreeNMetadataWritten int `json:"ostree-n-metadata-written,omitempty"`
OstreeTimestamp string `json:"ostree-timestamp"`
OstreeVersion string `json:"ostree-version"`
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions mantle/cosa/schema_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,7 @@ var generatedSchemaJSON = `{
"buildid",
"name",
"ostree-commit",
"ostree-content-bytes-written",
"ostree-content-checksum",
"ostree-n-cache-hits",
"ostree-n-content-total",
"ostree-n-content-written",
"ostree-n-metadata-total",
"ostree-n-metadata-written",
"ostree-timestamp",
"ostree-version",
"rpm-ostree-inputhash",
Expand Down
6 changes: 0 additions & 6 deletions src/schema/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,7 @@
"buildid",
"name",
"ostree-commit",
"ostree-content-bytes-written",
"ostree-content-checksum",
"ostree-n-cache-hits",
"ostree-n-content-total",
"ostree-n-content-written",
"ostree-n-metadata-total",
"ostree-n-metadata-written",
"ostree-timestamp",
"ostree-version",
"rpm-ostree-inputhash",
Expand Down

0 comments on commit 802edf6

Please sign in to comment.