Documentation Index
Fetch the complete documentation index at: https://translations.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Self-Managed W&B Server 방식으로 배포하기로 했다면, W&B는 Azure에 플랫폼을 배포할 때 W&B Server Azure Terraform Module을 사용할 것을 권장합니다.
이 모듈에 대한 문서는 방대하며, 사용 가능한 모든 옵션을 포함합니다. 이 문서에서는 그중 일부 배포 옵션만 다룹니다.
시작하기 전에, Terraform의 State File을 저장하기 위해 Terraform에서 사용 가능한 remote backends 중 하나를 선택할 것을 권장합니다.
State File은 모든 컴포넌트를 다시 생성하지 않고도 배포에서 업그레이드를 롤아웃하거나 변경 사항을 적용하는 데 필요한 필수 리소스입니다.
Terraform Module은 다음과 같은 mandatory(필수) 컴포넌트를 배포합니다:
- Azure Resource Group
- Azure Virtual Network (VPC)
- Azure MySQL Fliexible Server
- Azure Storage Account & Blob Storage
- Azure Kubernetes Service
- Azure Application Gateway
추가 배포 옵션에는 다음과 같은 선택적 컴포넌트도 포함될 수 있습니다:
- Azure Cache for Redis
- Azure Event Grid
AzureRM provider를 구성하는 가장 간단한 방법은 Azure CLI를 사용하는 것입니다. 다만 자동화를 위해서는 Azure Service Principal을 사용하는 방법도 유용할 수 있습니다.
어떤 인증 방법을 사용하든, Terraform을 실행할 계정에는 Introduction 섹션에서 설명한 모든 컴포넌트를 생성할 수 있는 권한이 있어야 합니다.
이 문서에서 다루는 모든 배포 옵션에 공통적으로 적용되는 단계입니다.
-
개발 환경을 준비합니다.
- Terraform을 설치합니다.
- 사용될 코드를 포함하는 Git 저장소를 만드는 것을 권장하지만, 파일을 로컬에만 보관해도 됩니다.
-
terraform.tfvars 파일을 생성합니다 tvfars 파일의 내용은 설치 유형에 따라 커스터마이즈할 수 있지만, 최소 권장 내용은 아래 예시와 같습니다.
namespace = "wandb"
wandb_license = "xxxxxxxxxxyyyyyyyyyyyzzzzzzz"
subdomain = "wandb-aws"
domain_name = "wandb.ml"
location = "westeurope"
여기에서 정의한 변수들은 배포 전에 미리 결정해야 합니다. namespace 변수는 Terraform이 생성하는 모든 리소스 이름 앞에 붙는 문자열입니다.
subdomain과 domain의 조합은 W&B가 구성될 FQDN을 형성합니다. 위 예시에서 W&B FQDN은 wandb-aws.wandb.ml이 되며, 이 FQDN 레코드가 생성될 DNS zone_id가 됩니다.
-
versions.tf 파일을 생성합니다
이 파일에는 AWS에 W&B를 배포하는 데 필요한 Terraform 및 Terraform provider 버전이 포함됩니다.
terraform {
required_version = "~> 1.3"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.17"
}
}
}
AWS provider 구성을 위해 Terraform 공식 문서를 참고하십시오.
선택 사항이지만 강력히 권장되는 설정으로, 이 문서의 앞부분에서 언급한 remote backend configuration을 추가할 수 있습니다.
-
variables.tf 파일을 생성합니다. terraform.tfvars에서 설정한 각 옵션에 대해 Terraform은 해당 변수 선언을 필요로 합니다.
variable "namespace" {
type = string
description = "리소스 이름 접두어로 사용되는 문자열입니다."
}
variable "location" {
type = string
description = "Azure Resource Group 위치입니다."
}
variable "domain_name" {
type = string
description = "Weights & Biases UI에 접속하기 위한 도메인입니다."
}
variable "subdomain" {
type = string
default = null
description = "Weights & Biases UI에 접속하기 위한 서브도메인입니다. 기본값인 경우 Route53 Route에 레코드를 생성합니다."
}
variable "license" {
type = string
description = "사용자의 wandb/local 라이선스입니다."
}
다음은 모든 Mandatory 구성 요소를 생성하고 Kubernetes Cluster에 최신 버전의 W&B를 설치하는 가장 간단한 배포 옵션 구성입니다.
-
main.tf 생성
General Steps에서 파일을 만들었던 것과 같은 디렉터리에, 아래 내용을 포함한 main.tf 파일을 생성합니다:
provider "azurerm" {
features {}
}
provider "kubernetes" {
host = module.wandb.cluster_host
cluster_ca_certificate = base64decode(module.wandb.cluster_ca_certificate)
client_key = base64decode(module.wandb.cluster_client_key)
client_certificate = base64decode(module.wandb.cluster_client_certificate)
}
provider "helm" {
kubernetes {
host = module.wandb.cluster_host
cluster_ca_certificate = base64decode(module.wandb.cluster_ca_certificate)
client_key = base64decode(module.wandb.cluster_client_key)
client_certificate = base64decode(module.wandb.cluster_client_certificate)
}
}
# Spin up all required services
module "wandb" {
source = "wandb/wandb/azurerm"
version = "~> 1.2"
namespace = var.namespace
location = var.location
license = var.license
domain_name = var.domain_name
subdomain = var.subdomain
deletion_protection = false
tags = {
"Example" : "PublicDns"
}
}
output "address" {
value = module.wandb.address
}
output "url" {
value = module.wandb.url
}
-
W&B에 배포
W&B를 배포하려면 다음 명령을 실행하세요:
terraform init
terraform apply -var-file=terraform.tfvars
또 다른 배포 옵션으로 Redis를 사용하여 SQL 쿼리를 캐시하고 실험 메트릭을 로드할 때 애플리케이션 응답 속도를 높일 수 있습니다.
캐시를 활성화하려면 권장 배포에 사용했던 동일한 main.tf 파일에 create_redis = true 옵션을 추가해야 합니다.
# 필요한 모든 서비스 시작
module "wandb" {
source = "wandb/wandb/azurerm"
version = "~> 1.2"
namespace = var.namespace
location = var.location
license = var.license
domain_name = var.domain_name
subdomain = var.subdomain
create_redis = true # Redis 생성
[...]
배포 옵션 3은 외부 message broker를 활성화하는 것입니다. W&B에는 broker가 내장되어 있으므로 이는 선택 사항입니다. 이 옵션은 성능 향상을 제공하지 않습니다.
message broker 역할을 하는 Azure 리소스는 Azure Event Grid이며, 이를 활성화하려면 권장 배포에서 사용했던 동일한 main.tf에 use_internal_queue = false 옵션을 추가해야 합니다.
# 필요한 모든 서비스 시작
module "wandb" {
source = "wandb/wandb/azurerm"
version = "~> 1.2"
namespace = var.namespace
location = var.location
license = var.license
domain_name = var.domain_name
subdomain = var.subdomain
use_internal_queue = false # Azure Event Grid 활성화
[...]
}
세 가지 배포 옵션을 모두 조합해 하나의 파일에 모든 설정을 넣을 수도 있습니다.
Terraform Module은 표준 옵션 및 권장 배포에 설명된 최소 구성과 함께 조합해서 사용할 수 있는 여러 옵션을 제공합니다.