Introduce SSOT/maintained setup process for Duo feature enablements
Problem
Currently, the instructions to set up AI locally involve running a script that is in a private snippet. This snippet frequently gets out of date.
The snippet also does not set up any data required to actually use the AI features locally, such as code or merge request reviews, which means that it is up to the developer to figure out how to generate that data in order to test the features.
Making it easier to test AI features locally will help the AI framework team with their goal of making it easier for other teams to add AI-related features.
Suggested solution
The gitlab
project has an established pattern of using seed-fu
for seed data. We can use seeds to automate some of this using seed data. In general, GitLab should probably make greater use of seed data.
Elements to consider for the seed script:
- Ideally, the seed script could be idempotent so it could be updated and re-run over time. But this is not necessarily a requirement.
- Needs to create a Group with proper license (Ultimate) to use all AI features
- Should enable all AI-related feature flags
- Should generate data to make it easy to test AI features. For example, the project should have code so we can use "explain this code" and a vulnerability so we can use "explain this vulnerability" etc.
- Perhaps the seeds should raise if the person does not have all required LLMs configured locally?
I started work on this in a branch but it was taking a bit so I decided to just push what I have and open an issue before investing too much more time on this.
Proposal
- Add scripts in GDK to ease the setup process for enabling Duo features.
- Add scripts for generating fixtures, such as group, project and code that where we can easily test the Duo features. This could be part of the GDK setup script or seed-fu.
The other considerations:
-
Application settings => check_namespace_plan
set to true -
Group => set on ultimate plan -
Namespace settings for said group: experiment_features_enabled
set to true -
feature flags enabled: list is here: &10524 -
Vertex embeddings populated: https://docs.gitlab.com/ee/development/ai_features/index.html#vertexai-embeddings -
user that uses chat needs to be a member of that group (works for root) -
reset cache for user to make sure the chat button is shown immediately: https://gitlab.com/gitlab-org/gitlab/-/blob/e73a8aaf48e6f347107a1dd05bb8d7ca67fc9bef/ee/app/models/ee/user.rb#L238-238