mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-06-06 23:34:53 +00:00
This commit introduces the necessary files and documentation to enable deployment of the Wan video generation application to Google Cloud Platform. Key additions: - Dockerfile: Defines the container image, using an NVIDIA PyTorch base image and including special handling for flash-attn installation. It allows for configurable Gradio application startup. - cloudbuild.yaml: Provides a Google Cloud Build configuration to automate the Docker image build and push process to Google Artifact Registry. - DEPLOY_GCLOUD.md: A comprehensive guide detailing the steps to: - Set up prerequisites on GCP. - Configure and run Cloud Build. - Deploy the container to Cloud Run (with CPU and GPU options). - Deploy the container to Vertex AI Endpoints. - Troubleshoot common issues and select appropriate machine resources. These changes aim to simplify and standardize the deployment process on Google Cloud, addressing potential issues related to dependencies and environment configuration.
44 lines
2.0 KiB
YAML
44 lines
2.0 KiB
YAML
steps:
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
args: [
|
|
'build',
|
|
'-t',
|
|
'${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:${COMMIT_SHA}',
|
|
'-t',
|
|
'${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest',
|
|
'.'
|
|
]
|
|
id: 'Build Docker image'
|
|
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
args: ['push', '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:${COMMIT_SHA}']
|
|
id: 'Push image to Artifact Registry (tagged with commit SHA)'
|
|
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
args: ['push', '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest']
|
|
id: 'Push image to Artifact Registry (tagged as latest)'
|
|
|
|
# Substitutions (users should replace these with their actual values or set them during build trigger)
|
|
# _REGION: The region of your Artifact Registry repository (e.g., us-central1)
|
|
# _REPOSITORY: The name of your Artifact Registry repository (e.g., my-app-repo)
|
|
# _IMAGE_NAME: The name for your Docker image (e.g., wan-video-generator)
|
|
|
|
# Default values for substitutions (can be overridden)
|
|
substitutions:
|
|
_REGION: 'us-central1' # Replace with your Artifact Registry region
|
|
_REPOSITORY: 'my-app-images' # Replace with your Artifact Registry repository name
|
|
_IMAGE_NAME: 'wan-video-service' # Replace with your desired image name
|
|
|
|
# Optional: specify image to be pushed to Artifact Registry
|
|
# This allows the image to be displayed in the build summary in Google Cloud Console
|
|
images:
|
|
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:${COMMIT_SHA}'
|
|
- '${_REGION}-docker.pkg.dev/${PROJECT_ID}/${_REPOSITORY}/${_IMAGE_NAME}:latest'
|
|
|
|
options:
|
|
logging: CLOUD_LOGGING_ONLY
|
|
# Optional: Specify machine type for faster builds (e.g., for GPU builds if needed by Dockerfile)
|
|
# machineType: 'E2_HIGHCPU_8' # or 'N1_HIGHCPU_32'
|
|
# For GPU builds during the Docker build process (if Dockerfile uses GPU):
|
|
# machineType: 'N1_HIGHCPU_8_CLOUD_GPU_P100_1' # Example, check available types
|