Projeto do Agent Contas ORACLE
This commit is contained in:
132
azure-pipelines/dev.yaml
Normal file
132
azure-pipelines/dev.yaml
Normal file
@@ -0,0 +1,132 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- develop
|
||||
|
||||
pool:
|
||||
name: Azure Pipelines
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: Data_Science_AI_ML/template-yaml-devops-mlops
|
||||
ref: master
|
||||
|
||||
name: 0.0.$(Rev:r)
|
||||
|
||||
variables:
|
||||
- template: oke_agents_atendimento/variables.yaml@templates
|
||||
- group: tim-ai-contas-agnt-dev-fqa
|
||||
- group: sa-timsa-it-agnt-ai-atendimento-cicd-dev-auth-token
|
||||
- name: imageRepository
|
||||
value: '$(ociRegistry)/$(OCI_NAMESPACE)/agnt-ai-atendimento/dev/agnt-ai-atendimento-contas'
|
||||
- name: K8S_NAMESPACE
|
||||
value: 'agnt-ai-atendimento-contas'
|
||||
- name: DNS
|
||||
value: agt-ai-atendimento-contas-dev.internal.timbrasil.com.br
|
||||
- name: IP_ADB
|
||||
value: "10.152.100.72"
|
||||
- name: HOST_ADB_1
|
||||
value: "cxprbmua.adb.sa-saopaulo-1.oraclecloud.com"
|
||||
- name: HOST_ADB_2
|
||||
value: "cxprbmua.adb.sa-saopaulo-1.oraclecloudapps.com"
|
||||
|
||||
stages:
|
||||
|
||||
# - stage: DevTest
|
||||
# displayName: 'Test Dev'
|
||||
# jobs:
|
||||
# - job: Test
|
||||
# pool:
|
||||
# name: oci-kubernetes
|
||||
# steps:
|
||||
# - template: templates/replay-dev.yaml
|
||||
|
||||
- stage: DevBuild
|
||||
# dependsOn: DevTest
|
||||
displayName: 'Build & Push (DEV)'
|
||||
jobs:
|
||||
- job: Build
|
||||
steps:
|
||||
- template: oke_agents_atendimento/certs_add.yaml@templates
|
||||
|
||||
- script: |
|
||||
echo "$(auth-token)" | docker login $(ociRegistry) -u "$(OCI_NAMESPACE)/$(SA_NAME)" --password-stdin
|
||||
displayName: 'Login to OCI Registry'
|
||||
|
||||
- task: Docker@2
|
||||
displayName: 'Build the image'
|
||||
inputs:
|
||||
command: 'build'
|
||||
repository: $(imageRepository)
|
||||
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
|
||||
arguments: '--build-arg UV_INDEX_TIMBRASIL_USERNAME=XGH --build-arg UV_INDEX_TIMBRASIL_PASSWORD=$(System.AccessToken)'
|
||||
tags: |
|
||||
$(Build.BuildNumber)
|
||||
|
||||
- script: |
|
||||
docker push $(imageRepository):$(Build.BuildNumber)
|
||||
displayName: 'Push image to OCI Registry'
|
||||
|
||||
- stage: DevDeploy
|
||||
dependsOn: DevBuild
|
||||
condition: succeeded()
|
||||
displayName: 'Deploy to OKE (DEV)'
|
||||
jobs:
|
||||
- job: deployb8s
|
||||
pool:
|
||||
name: oci-kubernetes
|
||||
variables:
|
||||
IMAGE_REPOSITORY: '$(imageRepository)'
|
||||
IMAGE_TAG: '$(Build.BuildNumber)'
|
||||
APP_NAME: '$(Build.Repository.Name)'
|
||||
OCI_CLI_CONFIG_FILE: '$(Pipeline.Workspace)/oci_config'
|
||||
IP_CLUSTER_AI: '10.152.97.126'
|
||||
HOSTNAME_CLUSTER_AI: 'pegruagntaiatenddev.pe.inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com'
|
||||
|
||||
steps:
|
||||
- template: oke_agents_atendimento/autenticacao_kubernetes_v2.yaml@templates
|
||||
|
||||
- template: oke_agents_atendimento/sa_gcp_secret.yaml@templates
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
envsubst < k8s/secrets.yaml | kubectl apply -n $(K8S_NAMESPACE) -f -
|
||||
|
||||
displayName: 'Apply application secrets'
|
||||
env:
|
||||
TIM_BLOQUEIO_AUTH: $(TIM_BLOQUEIO_AUTH)
|
||||
TIM_CANCELAMENTO_AUTH: $(TIM_CANCELAMENTO_AUTH)
|
||||
TIM_COMPLETE_INVOICES_AUTH: $(TIM_COMPLETE_INVOICES_AUTH)
|
||||
TIM_CONSULTA_AUTH: $(TIM_CONSULTA_AUTH)
|
||||
TIM_CONTRATO_AUTH: $(TIM_CONTRATO_AUTH)
|
||||
TIM_PROFILE_BILL_AUTH: $(TIM_PROFILE_BILL_AUTH)
|
||||
TIM_PROFILE_FULL_AUTH: $(TIM_PROFILE_FULL_AUTH)
|
||||
TIM_PROTOCOL_AUTH: $(TIM_PROTOCOL_AUTH)
|
||||
TIM_SERVICE_REQUEST_STATUS_AUTH: $(TIM_SERVICE_REQUEST_STATUS_AUTH)
|
||||
TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY: $(TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY_DEV)
|
||||
TIM_TRACKING_ACTIVITIES_AUTH: $(TIM_TRACKING_ACTIVITIES_AUTH)
|
||||
TIM_SMS_AUTH: $(TIM_SMS_AUTH)
|
||||
TIM_INVOICE_RECOVER_AUTH: $(TIM_INVOICE_RECOVER_AUTH)
|
||||
TIM_VAS_HISTORY_AUTH: $(TIM_VAS_HISTORY_AUTH)
|
||||
TIM_OBSERVABILITY_ENCRYPTION_KEY: $(TIM_OBSERVABILITY_ENCRYPTION_KEY)
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
kubectl create secret generic ${APP_NAME}-api-secrets-extras \
|
||||
--from-literal=TIM_RAG_DB_PASSWORD="${TIM_RAG_DB_PASSWORD}" \
|
||||
-n $(K8S_NAMESPACE) \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
displayName: 'Secrets with special characters'
|
||||
env:
|
||||
TIM_RAG_DB_PASSWORD: $(TIM_RAG_DB_PASSWORD)
|
||||
|
||||
- template: oke_agents_atendimento/apply_env_as_configmap.yaml@templates
|
||||
|
||||
- template: oke_agents_atendimento/helm_deploy.yaml@templates
|
||||
parameters:
|
||||
timeout: '180s'
|
||||
132
azure-pipelines/fqa.yaml
Normal file
132
azure-pipelines/fqa.yaml
Normal file
@@ -0,0 +1,132 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- fqa
|
||||
|
||||
pool:
|
||||
name: Azure Pipelines
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: Data_Science_AI_ML/template-yaml-devops-mlops
|
||||
ref: master
|
||||
|
||||
name: 0.1.$(Rev:r)
|
||||
|
||||
variables:
|
||||
- template: oke_agents_atendimento/variables.yaml@templates
|
||||
- group: tim-ai-contas-agnt-dev-fqa
|
||||
- group: sa-timsa-it-agnt-ai-atendimento-cicd-fqa-auth-token
|
||||
- name: imageRepository
|
||||
value: '$(ociRegistry)/$(OCI_NAMESPACE)/agnt-ai-atendimento/fqa/agnt-ai-atendimento-contas'
|
||||
- name: K8S_NAMESPACE
|
||||
value: 'agnt-ai-atendimento-contas'
|
||||
- name: DNS
|
||||
value: agt-ai-atendimento-contas-fqa.internal.timbrasil.com.br
|
||||
- name: IP_ADB
|
||||
value: "10.152.101.173"
|
||||
- name: HOST_ADB_1
|
||||
value: "vkmt14dd.adb.sa-saopaulo-1.oraclecloud.com"
|
||||
- name: HOST_ADB_2
|
||||
value: "vkmt14dd.adb.sa-saopaulo-1.oraclecloudapps.com"
|
||||
|
||||
stages:
|
||||
- stage: FqaBuild
|
||||
displayName: 'Build & Push (FQA)'
|
||||
jobs:
|
||||
- job: Build
|
||||
steps:
|
||||
- template: oke_agents_atendimento/certs_add.yaml@templates
|
||||
- script: |
|
||||
echo "$(auth-token)" | docker login $(ociRegistry) -u "$(OCI_NAMESPACE)/$(SA_NAME)" --password-stdin
|
||||
displayName: 'Login to OCI Registry'
|
||||
|
||||
- task: Docker@2
|
||||
displayName: 'Build the image'
|
||||
inputs:
|
||||
command: 'build'
|
||||
repository: $(imageRepository)
|
||||
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
|
||||
arguments: '--build-arg UV_INDEX_TIMBRASIL_USERNAME=XGH --build-arg UV_INDEX_TIMBRASIL_PASSWORD=$(System.AccessToken)'
|
||||
tags: |
|
||||
$(Build.BuildNumber)
|
||||
|
||||
- script: |
|
||||
docker push $(imageRepository):$(Build.BuildNumber)
|
||||
displayName: 'Push image to OCI Registry'
|
||||
|
||||
- stage: FqaDeploy
|
||||
dependsOn: FqaBuild
|
||||
condition: succeeded()
|
||||
displayName: 'Deploy to OKE (FQA)'
|
||||
jobs:
|
||||
- job: deployb8s
|
||||
pool:
|
||||
name: oci-kubernetes
|
||||
variables:
|
||||
IMAGE_REPOSITORY: '$(imageRepository)'
|
||||
IMAGE_TAG: '$(Build.BuildNumber)'
|
||||
APP_NAME: '$(Build.Repository.Name)'
|
||||
OCI_CLI_CONFIG_FILE: '$(Pipeline.Workspace)/oci_config'
|
||||
IP_CLUSTER_AI: '10.152.97.126'
|
||||
HOSTNAME_CLUSTER_AI: 'pegruagntaiatenddev.pe.inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com'
|
||||
|
||||
steps:
|
||||
- task: DownloadSecureFile@1
|
||||
name: appOciPemKey
|
||||
displayName: 'Download OCI PEM Key for App Container'
|
||||
inputs:
|
||||
secureFile: 'sa-agnt-ai-atendimento-contas-fqa-key'
|
||||
|
||||
- template: oke_agents_atendimento/adicionando_secret_ai.yaml@templates
|
||||
parameters:
|
||||
configFilePath: 'k8s/artefatos_k8s/oracle_config_ai_fqa'
|
||||
|
||||
- template: oke_agents_atendimento/autenticacao_kubernetes_v2.yaml@templates
|
||||
|
||||
- template: oke_agents_atendimento/sa_gcp_secret.yaml@templates
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
envsubst < k8s/secrets.yaml | kubectl apply -n $(K8S_NAMESPACE) -f -
|
||||
|
||||
displayName: 'Apply application secrets'
|
||||
env:
|
||||
TIM_BLOQUEIO_AUTH: $(TIM_BLOQUEIO_AUTH)
|
||||
TIM_CANCELAMENTO_AUTH: $(TIM_CANCELAMENTO_AUTH)
|
||||
TIM_COMPLETE_INVOICES_AUTH: $(TIM_COMPLETE_INVOICES_AUTH)
|
||||
TIM_CONSULTA_AUTH: $(TIM_CONSULTA_AUTH)
|
||||
TIM_CONTRATO_AUTH: $(TIM_CONTRATO_AUTH)
|
||||
TIM_PROFILE_BILL_AUTH: $(TIM_PROFILE_BILL_AUTH)
|
||||
TIM_PROFILE_FULL_AUTH: $(TIM_PROFILE_FULL_AUTH)
|
||||
TIM_PROTOCOL_AUTH: $(TIM_PROTOCOL_AUTH)
|
||||
TIM_SERVICE_REQUEST_STATUS_AUTH: $(TIM_SERVICE_REQUEST_STATUS_AUTH)
|
||||
TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY: $(TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY_FQA)
|
||||
TIM_TRACKING_ACTIVITIES_AUTH: $(TIM_TRACKING_ACTIVITIES_AUTH)
|
||||
TIM_SMS_AUTH: $(TIM_SMS_AUTH)
|
||||
TIM_INVOICE_RECOVER_AUTH: $(TIM_INVOICE_RECOVER_AUTH)
|
||||
TIM_VAS_HISTORY_AUTH: $(TIM_VAS_HISTORY_AUTH)
|
||||
TIM_OBSERVABILITY_ENCRYPTION_KEY: $(TIM_OBSERVABILITY_ENCRYPTION_KEY)
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
kubectl create secret generic ${APP_NAME}-api-secrets-extras \
|
||||
--from-literal=TIM_RAG_DB_PASSWORD="${TIM_RAG_DB_PASSWORD}" \
|
||||
-n $(K8S_NAMESPACE) \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
displayName: 'Secrets with special characters'
|
||||
env:
|
||||
TIM_RAG_DB_PASSWORD: $(TIM_RAG_DB_PASSWORD)
|
||||
|
||||
- template: oke_agents_atendimento/apply_env_as_configmap.yaml@templates
|
||||
parameters:
|
||||
envFile: '.env.kube.fqa'
|
||||
|
||||
- template: oke_agents_atendimento/helm_deploy.yaml@templates
|
||||
parameters:
|
||||
timeout: '180s'
|
||||
157
azure-pipelines/prod.yaml
Normal file
157
azure-pipelines/prod.yaml
Normal file
@@ -0,0 +1,157 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
|
||||
pool:
|
||||
name: Azure Pipelines
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: templates
|
||||
type: git
|
||||
name: Data_Science_AI_ML/template-yaml-devops-mlops
|
||||
ref: master
|
||||
- repository: TEMPLATES_CICD
|
||||
type: git
|
||||
name: TEMPLATES_CICD/TEMPLATES_CICD
|
||||
ref: main
|
||||
|
||||
name: 0.1.$(Rev:r)
|
||||
|
||||
variables:
|
||||
- template: oke_agents_atendimento/variables.yaml@templates
|
||||
# Criar valor abaixo:
|
||||
- group: tim-ai-contas-agnt-prd
|
||||
- group: sa-timsa-it-agnt-ai-atendimento-cicd-prd-auth-token
|
||||
- name: imageRepository
|
||||
value: '$(ociRegistry)/$(OCI_NAMESPACE)/agnt-ai-atendimento/prd/agnt-ai-atendimento-contas'
|
||||
- name: K8S_NAMESPACE
|
||||
value: 'agnt-ai-atendimento-contas'
|
||||
# Confirmar dns
|
||||
- name: DNS
|
||||
value: agt-ai-atendimento-contas.internal.timbrasil.com.br
|
||||
# Vai precisar do IP DO adb?
|
||||
- name: IP_ADB
|
||||
value: 10.152.92.58
|
||||
# adb_host_1
|
||||
- name: HOST_ADB_1
|
||||
value: "raico8g3.adb.sa-saopaulo-1.oraclecloud.com"
|
||||
# adb_host_2
|
||||
- name: HOST_ADB_2
|
||||
value: "raico8g3.adb.sa-saopaulo-1.oraclecloudapps.com"
|
||||
- name: IP_LANGFUSE
|
||||
value: 10.152.6.254
|
||||
- name: DNS_LANGFUSE
|
||||
value: agt-ai-atendimento-langfuse.internal.timbrasil.com.br
|
||||
- name: IP_CLUSTER_AI
|
||||
value: 10.152.88.246
|
||||
- name: HOSTNAME_CLUSTER_AI
|
||||
value: pegruagnt001prd.pe.inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com
|
||||
|
||||
stages:
|
||||
- stage: PrdBuild
|
||||
displayName: 'Build & Push (PRD)'
|
||||
jobs:
|
||||
- job: Build
|
||||
steps:
|
||||
- template: oke_agents_atendimento/certs_add.yaml@templates
|
||||
- script: |
|
||||
echo "$(auth-token)" | docker login $(ociRegistry) -u "$(OCI_NAMESPACE)/$(SA_NAME)" --password-stdin
|
||||
displayName: 'Login to OCI Registry'
|
||||
|
||||
- task: Docker@2
|
||||
displayName: 'Build the image'
|
||||
inputs:
|
||||
command: 'build'
|
||||
repository: $(imageRepository)
|
||||
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
|
||||
arguments: '--build-arg UV_INDEX_TIMBRASIL_USERNAME=XGH --build-arg UV_INDEX_TIMBRASIL_PASSWORD=$(System.AccessToken)'
|
||||
tags: |
|
||||
$(Build.BuildNumber)
|
||||
|
||||
- script: |
|
||||
docker push $(imageRepository):$(Build.BuildNumber)
|
||||
displayName: 'Push image to OCI Registry'
|
||||
|
||||
- stage: PrdDeploy
|
||||
dependsOn: PrdBuild
|
||||
condition: succeeded()
|
||||
displayName: 'Deploy to OKE (PRD)'
|
||||
jobs:
|
||||
- deployment: deployb8s
|
||||
displayName: 'Deploy Application'
|
||||
environment: 'agents_pnc_producao'
|
||||
pool:
|
||||
name: oci-kubernetes
|
||||
variables:
|
||||
IMAGE_REPOSITORY: '$(imageRepository)'
|
||||
IMAGE_TAG: '$(Build.BuildNumber)'
|
||||
APP_NAME: '$(Build.Repository.Name)'
|
||||
strategy:
|
||||
runOnce:
|
||||
deploy:
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- template: oke_agents_atendimento/autenticacao_kubernetes_v2.yaml@templates
|
||||
|
||||
- template: oke_agents_atendimento/sa_gcp_secret.yaml@templates
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
envsubst < k8s/secrets_prod.yaml | kubectl apply -n $(K8S_NAMESPACE) -f -
|
||||
|
||||
displayName: 'Apply application secrets'
|
||||
env:
|
||||
TIM_BLOQUEIO_AUTH: $(TIM_BLOQUEIO_AUTH)
|
||||
TIM_CANCELAMENTO_AUTH: $(TIM_CANCELAMENTO_AUTH)
|
||||
TIM_COMPLETE_INVOICES_AUTH: $(TIM_COMPLETE_INVOICES_AUTH)
|
||||
TIM_CONSULTA_AUTH: $(TIM_CONSULTA_AUTH)
|
||||
TIM_CONTRATO_AUTH: $(TIM_CONTRATO_AUTH)
|
||||
TIM_PROFILE_BILL_AUTH: $(TIM_PROFILE_BILL_AUTH)
|
||||
TIM_PROFILE_FULL_AUTH: $(TIM_PROFILE_FULL_AUTH)
|
||||
TIM_PROTOCOL_AUTH: $(TIM_PROTOCOL_AUTH)
|
||||
TIM_SERVICE_REQUEST_STATUS_AUTH: $(TIM_SERVICE_REQUEST_STATUS_AUTH)
|
||||
TIM_LLM_GATEWAY_LANGFUSE_PUBLIC_KEY: "${TIM_LLM_GATEWAY_LANGFUSE_PUBLIC_KEY}"
|
||||
TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY: $(TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY)
|
||||
TIM_TRACKING_ACTIVITIES_AUTH: $(TIM_TRACKING_ACTIVITIES_AUTH)
|
||||
TIM_SMS_AUTH: $(TIM_SMS_AUTH)
|
||||
SMS_BARCODE_AUTH: $(SMS_BARCODE_AUTH)
|
||||
TIM_CUSTOMER_CONTESTATION_AUTH: $(TIM_CUSTOMER_CONTESTATION_AUTH)
|
||||
TIM_DIVERGENCIA_AUTH: $(TIM_DIVERGENCIA_AUTH)
|
||||
TIM_INVOICE_RECOVER_AUTH: $(TIM_INVOICE_RECOVER_AUTH)
|
||||
TIM_RAG_DB_USER: $(TIM_RAG_DB_USER)
|
||||
MONGODB_CONNECTION_STRING: $(MONGODB_CONNECTION_STRING)
|
||||
TIM_VAS_HISTORY_AUTH: $(TIM_VAS_HISTORY_AUTH)
|
||||
TIM_OBSERVABILITY_ENCRYPTION_KEY: $(TIM_OBSERVABILITY_ENCRYPTION_KEY)
|
||||
|
||||
- script: |
|
||||
set -eo pipefail
|
||||
|
||||
kubectl create secret generic ${APP_NAME}-api-secrets-extras \
|
||||
--from-literal=TIM_RAG_DB_PASSWORD="${TIM_RAG_DB_PASSWORD}" \
|
||||
-n $(K8S_NAMESPACE) \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
displayName: 'Secrets with special characters'
|
||||
env:
|
||||
TIM_RAG_DB_PASSWORD: $(TIM_RAG_DB_PASSWORD)
|
||||
|
||||
- template: oke_agents_atendimento/apply_env_as_configmap.yaml@templates
|
||||
parameters:
|
||||
envFile: '.env.kube.prd'
|
||||
|
||||
- template: oke_agents_atendimento/helm_deploy.yaml@templates
|
||||
parameters:
|
||||
FilePathK8sManifest: 'k8s/deployment_prd.yaml'
|
||||
timeout: '180s'
|
||||
|
||||
# - stage: CreateWIT
|
||||
# displayName: 'Create WIT Entrega (Manual)'
|
||||
# dependsOn: []
|
||||
# jobs:
|
||||
# - template: wi_entrega/wi_entrega.yaml@templates
|
||||
# parameters:
|
||||
# environmentName: 'WI_entrega'
|
||||
114
azure-pipelines/templates/replay-dev.yaml
Normal file
114
azure-pipelines/templates/replay-dev.yaml
Normal file
@@ -0,0 +1,114 @@
|
||||
parameters:
|
||||
- name: envFile
|
||||
type: string
|
||||
default: '.env.kube.dev'
|
||||
- name: ociConfigFile
|
||||
type: string
|
||||
default: 'k8s/artefatos_k8s/oracle_config_ai'
|
||||
- name: ociKeySecureFile
|
||||
type: string
|
||||
default: 'sa-agnt-ai-atendimento-contas-dev-key'
|
||||
- name: startupTimeout
|
||||
type: string
|
||||
default: '300'
|
||||
- name: stateDbCheckTimeout
|
||||
type: string
|
||||
default: '180'
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "##vso[task.prependpath]$HOME/.local/bin"
|
||||
displayName: 'instalando uv'
|
||||
|
||||
- task: DownloadSecureFile@1
|
||||
name: replayOciPemKey
|
||||
displayName: 'Download OCI PEM Key'
|
||||
inputs:
|
||||
secureFile: ${{ parameters.ociKeySecureFile }}
|
||||
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
|
||||
sudo yum install -y gcc-c++
|
||||
|
||||
echo "10.153.35.23 agt-ai-atendimento-langfuse-dev.internal.timbrasil.com.br" | sudo tee -a /etc/hosts
|
||||
echo "10.152.97.126 pegruagntaiatenddev.pe.inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com" | sudo tee -a /etc/hosts
|
||||
echo "10.151.3.100 pmidfqa.internal.timbrasil.com.br" | sudo tee -a /etc/hosts
|
||||
echo "$(IP_ADB) $(HOST_ADB_1)" | sudo tee -a /etc/hosts
|
||||
echo "$(IP_ADB) $(HOST_ADB_2)" | sudo tee -a /etc/hosts
|
||||
|
||||
OCI_DIR="$(Agent.TempDirectory)/replay-oci"
|
||||
mkdir -p "$OCI_DIR"
|
||||
cp "${{ parameters.ociConfigFile }}" "$OCI_DIR/config"
|
||||
cp "$(replayOciPemKey.secureFilePath)" "$OCI_DIR/key.pem"
|
||||
chmod 600 "$OCI_DIR/key.pem"
|
||||
|
||||
REPLAY_OUT="$(Build.ArtifactStagingDirectory)/replay"
|
||||
mkdir -p "$REPLAY_OUT"
|
||||
|
||||
uv sync --dev
|
||||
|
||||
export TIM_LLM_OCI_AUTH_FILE_LOCATION="$OCI_DIR/config"
|
||||
export TIM_RAG_OCI_AUTH_FILE_LOCATION="$OCI_DIR/config"
|
||||
export TIM_RAG_OCI_USE_OKE_WORKLOAD_IDENTITY=false
|
||||
export TIM_OCI_KEY_FILE="$OCI_DIR/key.pem"
|
||||
|
||||
echo "[replay] checando acesso ao banco state Oracle"
|
||||
timeout "${{ parameters.stateDbCheckTimeout }}s" \
|
||||
uv run python -m automated_conversation_test.state_db_check \
|
||||
--env-file "${{ parameters.envFile }}" \
|
||||
--tcp-timeout 10 \
|
||||
| tee "$REPLAY_OUT/state-db-check.log"
|
||||
|
||||
uv run python -m automated_conversation_test.replay_blackbox \
|
||||
--env-file "${{ parameters.envFile }}" \
|
||||
--scenarios automated_conversation_test/scenarios \
|
||||
--out "$REPLAY_OUT" \
|
||||
--judge-mode hybrid \
|
||||
--startup-timeout "${{ parameters.startupTimeout }}" \
|
||||
--timeout 180
|
||||
|
||||
displayName: 'Run conversation replay natively (DEV)'
|
||||
env:
|
||||
UV_INDEX_TIMBRASIL_USERNAME: XGH
|
||||
UV_INDEX_TIMBRASIL_PASSWORD: $(System.AccessToken)
|
||||
TIM_BLOQUEIO_AUTH: $(TIM_BLOQUEIO_AUTH)
|
||||
TIM_CANCELAMENTO_AUTH: $(TIM_CANCELAMENTO_AUTH)
|
||||
TIM_COMPLETE_INVOICES_AUTH: $(TIM_COMPLETE_INVOICES_AUTH)
|
||||
TIM_CONSULTA_AUTH: $(TIM_CONSULTA_AUTH)
|
||||
TIM_CONTRATO_AUTH: $(TIM_CONTRATO_AUTH)
|
||||
TIM_PROFILE_BILL_AUTH: $(TIM_PROFILE_BILL_AUTH)
|
||||
TIM_PROTOCOL_AUTH: $(TIM_PROTOCOL_AUTH)
|
||||
TIM_SERVICE_REQUEST_STATUS_AUTH: $(TIM_SERVICE_REQUEST_STATUS_AUTH)
|
||||
TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY: $(TIM_LLM_GATEWAY_LANGFUSE_SECRET_KEY_DEV)
|
||||
TIM_TRACKING_ACTIVITIES_AUTH: $(TIM_TRACKING_ACTIVITIES_AUTH)
|
||||
TIM_SMS_AUTH: $(TIM_SMS_AUTH)
|
||||
TIM_RAG_DB_PASSWORD: $(TIM_RAG_DB_PASSWORD)
|
||||
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
mkdir -p "$(Build.ArtifactStagingDirectory)/replay"
|
||||
displayName: 'Ensure replay output directory'
|
||||
condition: always()
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish replay test results'
|
||||
condition: always()
|
||||
inputs:
|
||||
testResultsFormat: 'JUnit'
|
||||
testResultsFiles: '**/junit.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/replay'
|
||||
testRunTitle: 'Conversation replay DEV'
|
||||
failTaskOnFailedTests: false
|
||||
failTaskOnMissingTestResultsFile: false
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Publish replay artifacts'
|
||||
condition: always()
|
||||
inputs:
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)/replay'
|
||||
artifact: 'conversation-replay-dev'
|
||||
publishLocation: 'pipeline'
|
||||
Reference in New Issue
Block a user