Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
enable configuring proxy VM sku (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Aug 23, 2021
1 parent d1f58e6 commit 2a2844a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 12 additions & 1 deletion docs/webhook_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ Each event will be submitted via HTTP POST to the user provided URL.
"allow_pool_management": true,
"allowed_aad_tenants": [
"00000000-0000-0000-0000-000000000000"
]
],
"proxy_vm_sku": "Standard_B2s"
}
}
```
Expand Down Expand Up @@ -676,6 +677,11 @@ Each event will be submitted via HTTP POST to the user provided URL.
},
"title": "Allowed Aad Tenants",
"type": "array"
},
"proxy_vm_sku": {
"default": "Standard_B2s",
"title": "Proxy Vm Sku",
"type": "string"
}
},
"required": [
Expand Down Expand Up @@ -5621,6 +5627,11 @@ Each event will be submitted via HTTP POST to the user provided URL.
},
"title": "Allowed Aad Tenants",
"type": "array"
},
"proxy_vm_sku": {
"default": "Standard_B2s",
"title": "Proxy Vm Sku",
"type": "string"
}
},
"required": [
Expand Down
5 changes: 3 additions & 2 deletions src/api-service/__app__/onefuzzlib/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
from .azure.queue import get_queue_sas
from .azure.storage import StorageType
from .azure.vm import VM
from .config import InstanceConfig
from .events import send_event
from .extension import proxy_manager_extensions
from .orm import ORMMixin, QueryFilter
from .proxy_forward import ProxyForward

PROXY_SKU = "Standard_B2s"
PROXY_IMAGE = "Canonical:UbuntuServer:18.04-LTS:latest"
PROXY_LOG_PREFIX = "scaleset-proxy: "
PROXY_LIFESPAN = datetime.timedelta(days=7)
Expand Down Expand Up @@ -69,10 +69,11 @@ def key_fields(cls) -> Tuple[str, Optional[str]]:
return ("region", "proxy_id")

def get_vm(self) -> VM:
sku = InstanceConfig.fetch().proxy_vm_sku
vm = VM(
name="proxy-%s" % base58.b58encode(self.proxy_id.bytes).decode(),
region=self.region,
sku=PROXY_SKU,
sku=sku,
image=PROXY_IMAGE,
auth=self.auth,
)
Expand Down
1 change: 1 addition & 0 deletions src/pytypes/onefuzztypes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ class InstanceConfig(BaseModel):
# if set, only admins can manage pools or scalesets
allow_pool_management: bool = Field(default=True)

proxy_vm_sku: str = Field(default="Standard_B2s")
allowed_aad_tenants: List[UUID]

def update(self, config: "InstanceConfig") -> None:
Expand Down

0 comments on commit 2a2844a

Please sign in to comment.