Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat/enterprise: make per-subscription model allowlists no-op#62912

Merged
bobheadxi merged 1 commit into
mainfrom
05-24-feat_enterprise_remove_per-subscription_model_allowlisting
Jun 5, 2024
Merged

feat/enterprise: make per-subscription model allowlists no-op#62912
bobheadxi merged 1 commit into
mainfrom
05-24-feat_enterprise_remove_per-subscription_model_allowlisting

Conversation

@bobheadxi

@bobheadxi bobheadxi commented May 24, 2024

Copy link
Copy Markdown
Member

With #62911, per-enterprise-subscription model allowlists are no longer respected, so we can safely update the UI to remove mentions of allowlists, and also update our various allowlist-evaluation mechanisms in licensing and GraphQL resolvers to just provide a wildcard allowlist instead. It's not strictly required, but will make how the model allowlists work more clearer/explicit.

Because we have a planned migration for all this state to Enterprise Portal, we're not making any database changes.

Part of https://linear.app/sourcegraph/issue/CORE-135

Context

In https://sourcegraph.slack.com/archives/C05SZB829D0/p1715638980052279 we shared a decision we landed on as part of #62263:

Ignoring (then removing) per-subscription model allowlists: As part of the API discussions, we've also surfaced some opportunities for improvements - to make it easier to roll out new models to Enterprise, we're not including per-subscription model allowlists in the new API, and as part of the Cody Gateway migration (by end-of-June), we will update Cody Gateway to stop enforcing per-subscription model allowlists. Cody Gateway will still retain a Cody-Gateway-wide model allowlist. @chrsmith is working on a broader design here and will have more to share on this later.

This means there is one less thing for us to migrate as part of https://github.com/sourcegraph/sourcegraph/pull/62934, and avoids the need to add an API field that will be removed shortly post-migration.

As part of this, rolling out new models to Enterprise customers no longer require additional code/override changes.

Test plan

Various tests pass.

Visual inspection of sg start dotcom:

  • Before: image
  • After:image

bobheadxi commented May 24, 2024

Copy link
Copy Markdown
Member Author

@bobheadxi bobheadxi marked this pull request as ready for review May 24, 2024 19:04
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from ad9b434 to 2d2cec8 Compare May 24, 2024 20:11
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 54b4786 to be29330 Compare May 24, 2024 20:11
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 2d2cec8 to 865bcbb Compare May 24, 2024 20:12
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch 2 times, most recently from 8600e2e to b866fc0 Compare May 24, 2024 20:34

@unknwon unknwon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#full-stack

@bobheadxi

Copy link
Copy Markdown
Member Author

#full-stack

Took me upwards of 10 minutes to figure out how to make this table wide...

@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 865bcbb to 6f25b31 Compare May 24, 2024 20:59
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch 2 times, most recently from 10d9883 to c094403 Compare May 24, 2024 21:00
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from d6833b1 to 89698d3 Compare May 27, 2024 22:08
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from c094403 to 574c6dd Compare May 27, 2024 22:08
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 89698d3 to 59c6c38 Compare May 28, 2024 19:39
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 574c6dd to b009ebf Compare May 28, 2024 19:39
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 59c6c38 to 8dd9355 Compare May 29, 2024 03:44
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from b009ebf to 8a8a014 Compare May 29, 2024 04:04
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 07ec794 to 11c24ec Compare May 29, 2024 04:07
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 8a8a014 to d037994 Compare May 29, 2024 04:08
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 11c24ec to 5cb1349 Compare May 29, 2024 04:09
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from d037994 to c51a0a1 Compare May 29, 2024 04:09
@bobheadxi bobheadxi requested a review from a team May 29, 2024 04:22
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 5cb1349 to 34f986e Compare May 30, 2024 03:45
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from c51a0a1 to 9e06881 Compare May 30, 2024 03:45
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 34f986e to 48ee023 Compare May 30, 2024 18:07
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 9e06881 to 80516f2 Compare May 30, 2024 18:07
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 48ee023 to 856b01b Compare May 31, 2024 16:32
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 80516f2 to 429b01e Compare May 31, 2024 16:33
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 856b01b to 1a0d695 Compare May 31, 2024 20:09
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 429b01e to 1cc223e Compare May 31, 2024 20:09
@graphite-app

graphite-app Bot commented Jun 3, 2024

Copy link
Copy Markdown

(Notifying @sourcegraph/source of a change that affects gitserver)

@graphite-app graphite-app Bot added the team/source Tickets under the purview of Source - the one Source to graph it all label Jun 3, 2024
Comment thread sg.config.yaml Fixed
Comment thread sg.config.yaml Fixed
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 1cc223e to 0b9a9bc Compare June 3, 2024 15:48
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 1a0d695 to 5a4282f Compare June 3, 2024 15:48
@bobheadxi bobheadxi removed the team/source Tickets under the purview of Source - the one Source to graph it all label Jun 3, 2024
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch from 5a4282f to 263bf4e Compare June 3, 2024 21:05
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 0b9a9bc to 783f3e2 Compare June 3, 2024 21:05
@bobheadxi bobheadxi force-pushed the 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists branch 2 times, most recently from c8fa856 to 0f8bfe4 Compare June 4, 2024 22:19
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 783f3e2 to 0abfa09 Compare June 4, 2024 22:19
Base automatically changed from 05-24-feat_cody-gateway_use_wildcard_for_enterprise_allowlists to main June 4, 2024 22:29
bobheadxi referenced this pull request Jun 4, 2024
This change makes Cody Gateway always apply a wildcard model allowlist,
irrespective of what the configured model allowlist is for an Enterprise
subscription is in dotcom (see #62909).

The next PR in the stack,
https://github.com/sourcegraph/sourcegraph/pull/62912, makes the GraphQL
queries return similar results, and removes model allowlists from the
subscription management UI.

Closes https://linear.app/sourcegraph/issue/CORE-135

### Context

In https://sourcegraph.slack.com/archives/C05SZB829D0/p1715638980052279
we shared a decision we landed on as part of #62263:

> Ignoring (then removing) per-subscription model allowlists: As part of
the API discussions, we've also surfaced some opportunities for
improvements - to make it easier to roll out new models to Enterprise,
we're not including per-subscription model allowlists in the new API,
and as part of the Cody Gateway migration (by end-of-June), we will
update Cody Gateway to stop enforcing per-subscription model allowlists.
Cody Gateway will still retain a Cody-Gateway-wide model allowlist.
[@chrsmith](https://sourcegraph.slack.com/team/U061QHKUBJ8) is working
on a broader design here and will have more to share on this later.

This means there is one less thing for us to migrate as part of
https://github.com/sourcegraph/sourcegraph/pull/62934, and avoids the
need to add an API field that will be removed shortly post-migration.

As part of this, rolling out new models to Enterprise customers no
longer require additional code/override changes.

## Test plan

Set up Cody Gateway locally as documented, then `sg start dotcom`. Set
up an enterprise subscription + license with a high seat count (for a
high quota), and force a Cody Gateway sync:

```
curl -v -H 'Authorization: bearer sekret' http://localhost:9992/-/actor/sync-all-sources
```

Verify we are using wildcard allowlist:

```sh
$ redis-cli -p 6379 get 'v2:product-subscriptions:v2:slk_...'
"{\"key\":\"slk_...\",\"id\":\"6ad033f4-c6da-43a9-95ef-f653bf59aaac\",\"name\":\"bobheadxi\",\"accessEnabled\":true,\"endpointAccess\":{\"/v1/attribution\":true},\"rateLimits\":{\"chat_completions\":{\"allowedModels\":[\"*\"],\"limit\":660,\"interval\":86400000000000,\"concurrentRequests\":330,\"concurrentRequestsInterval\":10000000000},\"code_completions\":{\"allowedModels\":[\"*\"],\"limit\":66000,\"interval\":86400000000000,\"concurrentRequests\":33000,\"concurrentRequestsInterval\":10000000000},\"embeddings\":{\"allowedModels\":[\"*\"],\"limit\":220000000,\"interval\":86400000000000,\"concurrentRequests\":110000000,\"concurrentRequestsInterval\":10000000000}},\"lastUpdated\":\"2024-05-24T20:28:58.283296Z\"}"
```

Using the local enterprise subscription's access token, we run the QA
test suite:

```sh
$ bazel test --runs_per_test=2 --test_output=all //cmd/cody-gateway/qa:qa_test --test_env=E2E_GATEWAY_ENDPOINT=http://localhost:9992 --test_env=E2E_GATEWAY_TOKEN=$TOKEN
INFO: Analyzed target //cmd/cody-gateway/qa:qa_test (0 packages loaded, 0 targets configured).
INFO: From Testing //cmd/cody-gateway/qa:qa_test (run 1 of 2):
==================== Test output for //cmd/cody-gateway/qa:qa_test (run 1 of 2):
PASS
================================================================================
INFO: From Testing //cmd/cody-gateway/qa:qa_test (run 2 of 2):
==================== Test output for //cmd/cody-gateway/qa:qa_test (run 2 of 2):
PASS
================================================================================
INFO: Found 1 test target...
Target //cmd/cody-gateway/qa:qa_test up-to-date:
  bazel-bin/cmd/cody-gateway/qa/qa_test_/qa_test
Aspect @@rules_rust//rust/private:clippy.bzl%rust_clippy_aspect of //cmd/cody-gateway/qa:qa_test up-to-date (nothing to build)
Aspect @@rules_rust//rust/private:rustfmt.bzl%rustfmt_aspect of //cmd/cody-gateway/qa:qa_test up-to-date (nothing to build)
INFO: Elapsed time: 13.653s, Critical Path: 13.38s
INFO: 7 processes: 1 internal, 6 darwin-sandbox.
INFO: Build completed successfully, 7 total actions
//cmd/cody-gateway/qa:qa_test                                            PASSED in 11.7s
  Stats over 2 runs: max = 11.7s, min = 11.7s, avg = 11.7s, dev = 0.0s

Executed 1 out of 1 test: 1 test passes.
```
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch 2 times, most recently from 887d476 to 87589d3 Compare June 5, 2024 00:29
@bobheadxi bobheadxi force-pushed the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch from 87589d3 to 1a54951 Compare June 5, 2024 16:58
@bobheadxi bobheadxi enabled auto-merge (squash) June 5, 2024 16:59
@bobheadxi bobheadxi merged commit b574300 into main Jun 5, 2024
@bobheadxi bobheadxi deleted the 05-24-feat_enterprise_remove_per-subscription_model_allowlisting branch June 5, 2024 17:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants