This repository contains an Azure Function that mirrors BOSH stemcells from bosh.io to an Azure Compute Gallery of your choice.
sequenceDiagram
participant User
participant StemcellMirror as StemcellMirror.run()
participant BoshIO as bosh.io
participant Storage as Azure Storage Account
participant Gallery as Azure Compute Gallery
User->>StemcellMirror: Invoke
StemcellMirror->>Gallery: gallery_image_version_exists?
alt VersionExists
StemcellMirror->>User: No new stemcell required
else NoVersionFound
StemcellMirror->>BoshIO: Download latest stemcell (tgz)
StemcellMirror->>StemcellMirror: Extract .vhd from tgz
StemcellMirror->>Storage: Upload root.vhd
StemcellMirror->>Gallery: check_or_create_gallery_image
StemcellMirror->>Gallery: create_gallery_image_version
end
StemcellMirror->>User: Completed stemcell check
- Get an Azure Subscription
- Log-in to your Azure subscription using
azd auth login
. - Run
azd up
to provision your infrastructure and deploy to Azure (or runazd provision
thenazd deploy
to accomplish the tasks separately).
-
Configure a Python virtual environment using
venv
or your tool of choice.python -m venv .venv source ./.venv/bin/activate
-
Install the required Python packages:
python -m pip install -r requirements.txt
-
Run the unit tests:
python -m unittest discover tests