|
| 1 | +# Nebius Provider Scripts |
| 2 | + |
| 3 | +This directory contains utility scripts for testing and enumerating Nebius cloud resources. All scripts are implemented as Go test files with the `scripts` build tag. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Export your Nebius credentials as environment variables: |
| 8 | + |
| 9 | +```bash |
| 10 | +export NEBIUS_SERVICE_ACCOUNT_JSON='/path/to/service-account.json' |
| 11 | +export NEBIUS_TENANT_ID='tenant-e00xxx' |
| 12 | +export NEBIUS_LOCATION='eu-north1' # Optional, defaults to eu-north1 |
| 13 | +``` |
| 14 | + |
| 15 | +## Instance Type Enumeration |
| 16 | + |
| 17 | +### Enumerate All Regions |
| 18 | + |
| 19 | +Lists all instance types across all Nebius regions with GPU type breakdowns: |
| 20 | + |
| 21 | +```bash |
| 22 | +cd v1/providers/nebius |
| 23 | +go test -tags scripts -v -run Test_EnumerateInstanceTypes ./scripts/ |
| 24 | +``` |
| 25 | + |
| 26 | +**Output:** |
| 27 | +- Console summary with region-by-region GPU counts |
| 28 | +- JSON file: `instance_types_all_regions.json` |
| 29 | + |
| 30 | +### Enumerate Single Region |
| 31 | + |
| 32 | +Lists instance types for a specific region with detailed specifications: |
| 33 | + |
| 34 | +```bash |
| 35 | +export NEBIUS_LOCATION='eu-north1' |
| 36 | +go test -tags scripts -v -run Test_EnumerateInstanceTypesSingleRegion ./scripts/ |
| 37 | +``` |
| 38 | + |
| 39 | +**Output:** |
| 40 | +- Console summary categorized by CPU/GPU types |
| 41 | +- JSON file: `instance_types_eu-north1.json` |
| 42 | + |
| 43 | +### GPU Types Only |
| 44 | + |
| 45 | +Displays only GPU instance types in a formatted table: |
| 46 | + |
| 47 | +```bash |
| 48 | +export NEBIUS_LOCATION='eu-north1' |
| 49 | +go test -tags scripts -v -run Test_EnumerateGPUTypes ./scripts/ |
| 50 | +``` |
| 51 | + |
| 52 | +**Example Output:** |
| 53 | +``` |
| 54 | +ID GPU Type Count vCPUs RAM (GB) VRAM/GPU (GB) |
| 55 | +------------------------------------------------------------------------------------------------------------------------ |
| 56 | +nebius-eu-north1-l40s-1gpu-16vcpu-96gb L40S 1 16 96 48 |
| 57 | +nebius-eu-north1-l40s-4gpu-128vcpu-768gb L40S 4 128 768 48 |
| 58 | +nebius-eu-north1-h100-8gpu-128vcpu-1600gb H100 8 128 1600 80 |
| 59 | +``` |
| 60 | + |
| 61 | +## Image Enumeration |
| 62 | + |
| 63 | +### Enumerate Images (Single Region) |
| 64 | + |
| 65 | +Lists all available images in a specific region: |
| 66 | + |
| 67 | +```bash |
| 68 | +export NEBIUS_LOCATION='eu-north1' |
| 69 | +go test -tags scripts -v -run Test_EnumerateImages ./scripts/ |
| 70 | +``` |
| 71 | + |
| 72 | +**Output:** |
| 73 | +- Console summary organized by OS |
| 74 | +- JSON file: `images_eu-north1.json` |
| 75 | + |
| 76 | +### Enumerate Images (All Regions) |
| 77 | + |
| 78 | +Lists images across all Nebius regions: |
| 79 | + |
| 80 | +```bash |
| 81 | +go test -tags scripts -v -run Test_EnumerateImagesAllRegions ./scripts/ |
| 82 | +``` |
| 83 | + |
| 84 | +**Output:** |
| 85 | +- Console summary with image counts per region |
| 86 | +- JSON file: `images_all_regions.json` |
| 87 | + |
| 88 | +### Filter GPU-Optimized Images |
| 89 | + |
| 90 | +Shows only images suitable for GPU instances (CUDA, ML, etc.): |
| 91 | + |
| 92 | +```bash |
| 93 | +export NEBIUS_LOCATION='eu-north1' |
| 94 | +go test -tags scripts -v -run Test_FilterGPUImages ./scripts/ |
| 95 | +``` |
| 96 | + |
| 97 | +## VPC and Kubernetes Scripts |
| 98 | + |
| 99 | +### Create VPC |
| 100 | + |
| 101 | +Creates a test VPC with public/private subnets: |
| 102 | + |
| 103 | +```bash |
| 104 | +go test -tags scripts -v -run TestCreateVPC ./scripts/ |
| 105 | +``` |
| 106 | + |
| 107 | +### Create Kubernetes Cluster |
| 108 | + |
| 109 | +Creates a Kubernetes cluster with VPC: |
| 110 | + |
| 111 | +```bash |
| 112 | +go test -tags scripts -v -run Test_CreateVPCAndCluster ./scripts/ |
| 113 | +``` |
| 114 | + |
| 115 | +## Running All Scripts |
| 116 | + |
| 117 | +To run all enumeration scripts at once: |
| 118 | + |
| 119 | +```bash |
| 120 | +go test -tags scripts -v ./scripts/ |
| 121 | +``` |
| 122 | + |
| 123 | +## Output Files |
| 124 | + |
| 125 | +Scripts generate JSON files in the current directory: |
| 126 | +- `instance_types_all_regions.json` - All instance types across regions |
| 127 | +- `instance_types_<region>.json` - Instance types for specific region |
| 128 | +- `images_all_regions.json` - All images across regions |
| 129 | +- `images_<region>.json` - Images for specific region |
| 130 | + |
| 131 | +## Tips |
| 132 | + |
| 133 | +### Pretty Print JSON Output |
| 134 | + |
| 135 | +```bash |
| 136 | +cat instance_types_eu-north1.json | jq '.' |
| 137 | +``` |
| 138 | + |
| 139 | +### Filter JSON Results |
| 140 | + |
| 141 | +```bash |
| 142 | +# Show only L40S instance types |
| 143 | +cat instance_types_eu-north1.json | jq '.[] | select(.supported_gpus[0].type == "L40S")' |
| 144 | + |
| 145 | +# Show instance types with pricing |
| 146 | +cat instance_types_eu-north1.json | jq '.[] | select(.price != null) | {id, price}' |
| 147 | + |
| 148 | +# Count GPU types |
| 149 | +cat instance_types_all_regions.json | jq -r '.[].supported_gpus[0].type' | sort | uniq -c |
| 150 | +``` |
| 151 | + |
| 152 | +### Redirect Output to File |
| 153 | + |
| 154 | +```bash |
| 155 | +go test -tags scripts -v -run Test_EnumerateGPUTypes ./scripts/ > gpu_types_output.txt 2>&1 |
| 156 | +``` |
| 157 | + |
| 158 | +## Integration with Testing Guide |
| 159 | + |
| 160 | +These scripts complement the integration tests documented in [`NEBIUS_TESTING_GUIDE.md`](../NEBIUS_TESTING_GUIDE.md). Use them for: |
| 161 | +- Discovery: Finding available instance types and regions |
| 162 | +- Validation: Verifying quota and availability |
| 163 | +- Development: Testing new features with real Nebius resources |
0 commit comments