diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 56e4bd3c48af925bb5b4f2359db36e27e381b5ca..b617e1b77f5bd3a50eb3273a24f0f85c6319cb31 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -305,6 +305,22 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.8 alias: zoekt-ci-image +.ai-gateway-variables: + variables: + AIGW_AUTH__BYPASS_EXTERNAL: True + AIGW_VERTEX_TEXT_MODEL__PROJECT: $VERTEX_AI_PROJECT + AIGW_VERTEX_TEXT_MODEL__JSON_KEY: $VERTEX_AI_CREDENTIALS + AIGW_FASTAPI__DOCS_URL: "/docs" + AIGW_FASTAPI__OPENAPI_URL: "/openapi.json" + AIGW_FASTAPI__API_PORT: 5052 + ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY_FOR_SERVICE + # CI_DEBUG_SERVICES: "true" # Enable this variable when you debug ai-gateway boot failure. + +.ai-gateway-services: + services: + - name: registry.gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/model-gateway:latest + alias: ai-gateway + .use-pg13: extends: - .pg-base-variables @@ -359,9 +375,11 @@ extends: - .use-pg14 - .zoekt-variables + - .ai-gateway-variables services: - !reference [.db-services-with-auto-explain, services] - !reference [.es7-services, services] + - !reference [.ai-gateway-services, services] .use-pg15-es7-ee: extends: diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 1e92858c2b650f09667c3b68bbdbcceaecd216f0..71704a6fd666dfd5201230bd578c50a7bd99c967 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -653,6 +653,7 @@ rspec-ee:predictive:trigger: - .rspec-ee-base-pg14 variables: REAL_AI_REQUEST: "true" + AI_GATEWAY_URL: http://ai-gateway:5052 rspec-ee unit gitlab-duo-chat-zeroshot pg14: extends: diff --git a/ee/spec/lib/gitlab/llm/chain/agents/zero_shot/qa_evaluation_spec.rb b/ee/spec/lib/gitlab/llm/chain/agents/zero_shot/qa_evaluation_spec.rb index 5b955b45cdfa08a6224bd52fc1371a158525e79b..e2b017ccc2356696ea0841d8444a5526bf50ab1d 100644 --- a/ee/spec/lib/gitlab/llm/chain/agents/zero_shot/qa_evaluation_spec.rb +++ b/ee/spec/lib/gitlab/llm/chain/agents/zero_shot/qa_evaluation_spec.rb @@ -41,12 +41,6 @@ stub_default_url_options(host: "gitlab.com", protocol: "https") stub_ee_application_setting(should_check_namespace_plan: true) stub_licensed_features(ai_chat: true, epics: true) - # TODO: We can't run this QA spec with AI Gateway because the service is not available in test jobs. - # See https://gitlab.com/gitlab-org/gitlab/-/issues/434445 for more information. - stub_feature_flags(gitlab_duo_chat_requests_to_ai_gateway: false) - # TODO: Claude 3 only works with AI Gateway, which supports the Anthropic - # Messages API - stub_feature_flags(ai_claude_3_sonnet: false) end shared_examples 'the questions are correctly answered' do diff --git a/ee/spec/lib/gitlab/llm/completions/chat_real_requests_spec.rb b/ee/spec/lib/gitlab/llm/completions/chat_real_requests_spec.rb index aa5339425065c1bd3e48b7ac9ea9f535a77f1dc0..6a967b717430b6c9ab2ee076f54c7cefbd82b4a5 100644 --- a/ee/spec/lib/gitlab/llm/completions/chat_real_requests_spec.rb +++ b/ee/spec/lib/gitlab/llm/completions/chat_real_requests_spec.rb @@ -37,9 +37,6 @@ end before do - # TODO: We can't run this QA spec with AI Gateway because the service is not available in test jobs. - # See https://gitlab.com/gitlab-org/gitlab/-/issues/434445 for more information. - stub_feature_flags(gitlab_duo_chat_requests_to_ai_gateway: false) stub_licensed_features(ai_chat: true, epics: true) stub_ee_application_setting(should_check_namespace_plan: true)