You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reviewers: # Include a comment about what domain expertise a reviewer is expected to bring and what area of the enhancement you expect them to focus on. For example: - "@networkguru, for networking aspects, please look at IP bootstrapping aspect"
7
-
- TBD
7
+
- @spadgett, for OCP console
8
+
- @jhadvig, for OCP console
9
+
- @TheRealJon, for OCP console
10
+
- @joelanford, for OLM
11
+
- @eggfoobar, for SNO
12
+
- @csrwng, for Hypershift
8
13
approvers: # A single approver is preferred, the role of the approver is to raise important questions, help ensure the enhancement receives reviews from all applicable areas/SMEs, and determine when consensus is achieved such that the EP can move forward to implementation. Having multiple approvers makes it difficult to determine who is responsible for the actual approval.
9
-
- TBD
14
+
- @spadgett
10
15
api-approvers: # In case of new or modified APIs or API extensions (CRDs, aggregated apiservers, webhooks, finalizers). If there is no API change, use "None"
11
-
- TBD
16
+
- None
12
17
creation-date: 2025-01-30
13
-
last-updated: 2025-01-30
18
+
last-updated: 2025-02-11
14
19
tracking-link: # link to the tracking ticket (for example: Jira Feature or Epic ticket) that corresponds to this enhancement
15
20
- https://issues.redhat.com/browse/OPRUN-3688
16
21
see-also:
@@ -46,13 +51,15 @@ See ../README.md for background behind these instructions.
46
51
Start by filling out the header with the metadata for this enhancement.
47
52
-->
48
53
49
-
# catalogd-query-api
54
+
# catalogd-console-api
50
55
51
56
## Summary
52
57
53
58
Catalogd currently supports an HTTPS endpoint to access file-based catalog (FBC) contents
54
-
but the endpoint provides complete catalog content in a single transaction.
55
-
We would like to introduce a new HTTPS endpoint to provide more fine-grained access to
59
+
but the endpoint provides complete catalog content in a single transaction. In performance testing with
60
+
proof of concept OCP console work, it proves insufficiently responsive and requires user-agent-side results
61
+
caching of large amounts of catalog data.
62
+
We would like to introduce a new HTTPS endpoint to provide more fine-grained and lower-latency access to
56
63
catalog contents.
57
64
58
65
<!--
@@ -72,7 +79,7 @@ This section is for explicitly listing the motivation, goals and non-goals of
72
79
this proposal. Describe why the change is important and the benefits to users.
73
80
-->
74
81
75
-
The existing `/api/v1/all` endpoint returns the entire FBC, which the clients then need
82
+
The existing `/api/v1/all` endpoint returns the entire FBC, which console or other clients then need
76
83
to process in order to retrieve relevant information. This is very inefficient for
77
84
accesses which can be satisfied by a much smaller record set.
Requiring clients to retrieve the full catalog can also result in a 4-10 second delay _per catalog_ even under optimal network conditions.
94
+
Requiring OCP console to make the full catalog available to users incurs a 4-10 second delay _per catalog_ even
95
+
under optimal network conditions, plus large local cache coherency challenges to avoid additional retrievals to
96
+
fulfill further use-cases as a user makes progress towards selecting content to install.
88
97
89
98
90
99
### User Stories
91
100
92
-
* As a catalog client, I want to be able to pose space-efficient catalog queries
101
+
* As a console user, I would like to be able to discover available packages for installation.
102
+
* As a console user, I would like to be able to request only catalog context relevant to a specific package.
103
+
* As a console user, I would like to be able to discover available package updates.
104
+
* As a console user, I would like to be able to view details for a specific channel for a package.
105
+
* As a console user, I would like to be able to discover all bundle versions associated with a package
106
+
(and optionally a specific channel).
107
+
* As a console user, I would like to be able to view details for a specific bundle version.
108
+
93
109
94
110
### Goals
95
111
96
-
* Provide an HTTPS endpoint which fulfills targeted catalog queries with a minimum record set.
112
+
* Provide an HTTPS catalog content discovery endpoint which fulfills targeted catalog queries with a minimum record set.
97
113
98
114
<!--
99
115
Summarize the specific goals of the proposal. How will we know that
@@ -119,7 +135,9 @@ enhancement.
119
135
120
136
## Proposal
121
137
122
-
This proposal introduces an additional HTTPS endpoint to an existing catalogd API. The existing HTTPS "all" endpoint will remain as a default option; the user will be able to enable this new capability via a feature gate.
138
+
This proposal introduces an additional HTTPS endpoint to an existing catalogd API.
139
+
The existing HTTPS "all" endpoint will remain as a default option; the user will be
140
+
able to enable this new capability via a feature gate.
123
141
124
142
<!--
125
143
This section should explain what the proposal actually is. Enumerate
@@ -137,7 +155,12 @@ the document.
137
155
138
156
### Workflow Description
139
157
140
-
To serve curated data from the FBC, a new HTTPS endpoint will be exposed by the existing service under the base URL as detailed in `API Specification`. The new endpoint will be derived from `.status.urls.base` following the pattern `/api/v1/query?[...parameters]` and will accept parameters which correspond to any of the fields of the `declcfg.Meta` catalog [atomic type](https://github.com/operator-framework/operator-registry/blob/e15668c933c03e229b6c80025fdadb040ab834e0/alpha/declcfg/declcfg.go#L111):
158
+
To serve curated data from the FBC, a new HTTPS endpoint will be exposed by
159
+
the existing service under the base URL as detailed in `API Specification`.
160
+
The new endpoint will be derived from `.status.urls.base` following the pattern
161
+
`/api/v1/metas?[...parameters]` and will accept parameters which correspond to
@@ -147,7 +170,8 @@ To serve curated data from the FBC, a new HTTPS endpoint will be exposed by the
147
170
}
148
171
```
149
172
Query parameters will be logically ANDed and used to restrict response scope.
150
-
This API will be conditionally enabled by an upstream `APIV1QueryEndpoint` feature gate as part of a downstream `NewOLM{suffix}` style OCP TP feature gate, and will be disabled by default.
173
+
This API will be conditionally enabled by an upstream `APIV1MetasEndpoint`
174
+
feature gate as part of a downstream `NewOLM{suffix}` style feature gate.
151
175
152
176
<!--
153
177
Explain how the user will use the feature. Be detailed and explicit.
@@ -209,24 +233,24 @@ info:
209
233
version: 1.0.0
210
234
description: ""
211
235
paths:
212
-
/{baseURL}/api/v1/query:
236
+
/{baseURL}/api/v1/metas:
213
237
get:
214
238
parameters:
215
239
- name: name
216
240
description: query by declcfg.Meta.name
217
241
schema:
218
242
type: string
219
-
in: query
243
+
in: metas
220
244
- name: package
221
245
description: query by declcfg.Meta.package
222
246
schema:
223
247
type: string
224
-
in: query
248
+
in: metas
225
249
- name: schema
226
250
description: query by declcfg.Meta.schema
227
251
schema:
228
252
type: string
229
-
in: query
253
+
in: metas
230
254
responses:
231
255
"200":
232
256
headers:
@@ -306,16 +330,31 @@ how the code will be rewritten in the enhancement.
306
330
307
331
### Caching Considerations
308
332
309
-
This proposal indends to provide RFC7234 caching compliance through support for `Last-Modified` and `If-Modified-Since` directives. Clients can use these headers to avoid re-downloading unchanged data.
333
+
This proposal indends to provide RFC7234 caching compliance through support for `Last-Modified` and
334
+
`If-Modified-Since`directives. Clients can use these headers to avoid re-downloading unchanged data.
310
335
The server will respond with 304 Not Changed if the catalog metadata is unchanged.
311
336
312
337
Clients are also encouraged to implement local caching for frequently queried metadata.
or Hypershift [SLOs](https://hypershift-docs.netlify.app/reference/slos/) where the primary consideration is memory uses in the 10s of MiB, not 100s.
314
348
315
349
### Risks and Mitigations
316
350
317
-
Depending on the implementation of this proposal, exercise of this endpoint could function as an I/O multiplier which could starve other clients which are dependent on the same API.
318
-
The first iteration of this endpoint will not attempt to mitigate denial-of-service attempts via rate-limiting or other resource consumption constraints.
351
+
Depending on the implementation of this proposal, exercise of this endpoint could function as an
352
+
I/O multiplier which could starve other clients which are dependent on the same API.
353
+
The first iteration of this endpoint will not attempt to mitigate denial-of-service attempts via
354
+
rate-limiting or other resource consumption constraints.
355
+
356
+
The proposal does not include any provision for authentication/authorization, since there are no
357
+
current use-cases which require it.
319
358
320
359
<!--
321
360
What are the risks of this proposal and how do we mitigate. Think broadly. For
@@ -331,11 +370,32 @@ Consider including folks that also work outside your immediate sub-project.
331
370
332
371
### Drawbacks
333
372
334
-
Given the highly-variable nature of responses based on unbound combinations of schema/name/package, any server-side caching will be problematic if not completely impractical. Read: computationally and/or storage expensive.
373
+
#### Caching
374
+
Given the highly-variable nature of responses based on unbound combinations of schema/name/package,
375
+
any server-side caching will be problematic if not completely impractical. Read: computationally and/or
376
+
storage expensive.
377
+
378
+
For example, response for `metas?schema=olm.package&name=foo` and `metas?schema=olm.package&name=bar`
379
+
represent disjoint sets, and the server would have to either ignore `If-Modified-Since` directives
380
+
in client requests or rely on their veracity uncritically.
381
+
382
+
Further, if the underlying implementation relies on anything other than a dictionary of cached requests
383
+
(¶meters) to dictate date-relevant responses (for e.g. relying on the catalog unpack time),
384
+
then any server-side caching would be erroneous.
385
+
386
+
The existing `all` endpoint also incentivizes clients to conserve resources via local cache to avoid making
387
+
many (potentially duplicate) requests. However, the OCP console proof of concept
388
+
required what was deemed an unsupportable amount of code and complexity to cache, decompose, and render the
389
+
complete FBC.
335
390
336
-
For example, response for `query?schema=olm.package&name=foo` and `query?schema=olm.package&name=bar` represent disjoint sets, and the server would have to either ignore `If-Modified-Since` directives in client requests or rely on their veracity uncritically.
391
+
#### Complexity
392
+
Server implementation is much more complex and resource intensive due to the need to index catalog
393
+
content and serve variable requests.
394
+
395
+
#### Completeness
396
+
The previous `all` endpoint always returns valid FBC. The new service cannot make that promise,
397
+
so clients could make incorrect assumptions about the suitability of results. See Open Questions.
337
398
338
-
Further, if the underlying implementation relies on anything other than a dictionary of cached requests (¶meters) to dictate date-relevant responses (for e.g. relying on the catalog unpack time), then any server-side caching would be erroneous.
339
399
340
400
<!--
341
401
The idea is to find the best form of an argument why this enhancement should
@@ -357,18 +417,18 @@ to implement the design. For instance,
357
417
> 1. This requires exposing previously private resources which contain sensitive
358
418
information. Can we do this?
359
419
-->
360
-
> 1. If a query comes in with `/api/v1/query?package=foo`, should we include the blob with schema: `olm.package` and name: `foo`?
420
+
> 1. If a query comes in with `/api/v1/metas?package=foo`, should we include the blob with schema: `olm.package` and name: `foo`?
361
421
362
-
We feel that it is incorrect for the query service endpoint to mutate the data model (specifically, to create a synthetic package attribute for the `olm.package` schema). To access all the data modeled for an installable package, separate queries need to be made for the package-level metadata (`schema=olm.package&name=foo`) versus the channel/bundle-level metadata (`package=foo`).
422
+
We feel that it is incorrect for the metas service endpoint to mutate the data model (specifically, to create a synthetic package attribute for the `olm.package` schema). To access all the data modeled for an installable package, separate queries need to be made for the package-level metadata (`schema=olm.package&name=foo`) versus the channel/bundle-level metadata (`package=foo`).
363
423
364
-
> 2. What guarantees do we make about the response bodies of all and query?
365
-
> - all and query return a stream of valid FBC blobs
424
+
> 2. What guarantees do we make about the response bodies of `all` and `metas`?
425
+
> - `all` and `metas` return a stream of valid FBC blobs
366
426
> - Does catalogd make any guarantee that all passes opm validate-style validation?
367
-
> - We definitely can't guarantee that query responses pass opm validate-style validation.
427
+
> - We definitely can't guarantee that `metas` responses pass opm validate-style validation.
368
428
> - Do we need to clarify that it is up to clients to verify semantic validity if they need it? Are we comfortable putting that burden on clients?
369
429
370
430
`all`responses will preserve existing validity of the catalog data both from an installably-complete perspective (can be used as an installation reference) as well as syntactically valid perspective (opm validate).
371
-
`query`responses will be valid `declcfg.Meta` elements and make no promise that the response may be installably-complete (in the sense that the response itself could be used as a fully-intact catalog) or syntactically valid.
431
+
`metas`responses will be valid `declcfg.Meta` elements and make no promise that the response may be installably-complete (in the sense that the response itself could be used as a fully-intact catalog) or syntactically valid.
372
432
373
433
## Test Plan
374
434
@@ -390,6 +450,23 @@ expectations).
390
450
## Graduation Criteria
391
451
392
452
**Note:** *Section not required until targeted at a release.*
453
+
454
+
### Tech Preview
455
+
- Initial implementation is protected by the default-disabled feature gate `APIV1MetasEndpoint`.
456
+
- Sufficient test coverage
457
+
- Feedback from OCP Console team.
458
+
- e2e feature tests are enabled for TPNU clusters.
459
+
- origin tests demonstrating endpoint inaccessibility in non-TPNU clusters
460
+
- resource benchmarking
461
+
462
+
### Tech Preview --> GA
463
+
- announce deprecation schedule for `all` endpoint.
464
+
- feature gate moves to default-enabled
465
+
- collect test data for coverage / reliability
466
+
467
+
### GA --> Maturity
468
+
- remove feature gate
469
+
393
470
<!--
394
471
Define graduation milestones.
395
472
@@ -563,18 +640,26 @@ Describe how to
563
640
564
641
- Do nothing
565
642
566
-
This option would require clients to query the entirety of the data (~21 MB for operatorhubio catalog) and parse the response to retrieve relevant information every time the client needs the data. Even if clients’ implement some form of caching, the first query the client does to catalogd server is still the dealbreaker. In a highly resource constrained environment (e.g. clusters in Edge devices), this basically translates to a chokepoint for the clients to get started.
643
+
This option would require clients to query the entirety of the data (~21 MB for operatorhubio
644
+
catalog) and parse the response to retrieve relevant information every time the client
645
+
needs the data. Even if clients’ implement some form of caching, the first query the client
646
+
does to catalogd server is still the dealbreaker. In a highly resource constrained environment
647
+
(e.g. clusters in Edge devices), this basically translates to a chokepoint for the clients to get started.
567
648
568
649
- A “path hierarchy” based construction of API endpoints to expose filtered FBC metadata
569
650
570
-
The alternative to exposing a single, parameterized query endpoint is exposing many, “path hierarchy” based API endpoints. Eg:
651
+
The alternative to exposing a single, parameterized query endpoint is exposing many, “path
This interface creates a new API on top of the existing FBC structure. It also increases the number of discoverable endpoints by clients, with the scope for an unsustainable expansion of the API surface area in the future.
657
+
This interface creates a new API on top of the existing FBC structure. It also increases
658
+
the number of discoverable endpoints by clients, with the scope for an unsustainable
659
+
expansion of the API surface area in the future.
576
660
577
-
The main approach proposed in this document instead uses the already existing “FBC API”, with a clean API surface area
661
+
The main approach proposed in this document instead uses the already existing “FBC API”, with
0 commit comments