forked from exadel-inc/CompreFace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request exadel-inc#973 from exadel-inc/EFRS-1344-cf-to-ama…
…rketplace Publish CompreFace VM image to Azure Marketplace
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
name: (Azure) Сompreface AIB image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version (e.g., 1.0.0) | ||
required: true | ||
env: | ||
RESOURCE_GROUP_NAME: compreFaceGallery-RG | ||
MANAGED_IDENTITY: compreFace-SP | ||
GALLERY_NAME: compreFaceGallery | ||
IMAGE_NAME: compreFace | ||
VERSION: ${{ github.event.inputs.version }} | ||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Login via Az module | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{secrets.AZURE_CREDENTIALS}} | ||
|
||
- name: Build custom VM image | ||
id: imageBuilder | ||
uses: azure/build-vm-image@v0 | ||
with: | ||
resource-group-name: "${{ env.RESOURCE_GROUP_NAME }}" | ||
managed-identity: "${{ env.MANAGED_IDENTITY }}" | ||
location: 'eastus2' | ||
source-os-type: 'linux' | ||
source-image-type: 'PlatformImage' | ||
source-image: Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest | ||
vm-size: 'Standard_B2s' | ||
dist-type: 'SharedImageGallery' | ||
dist-resource-id: "/subscriptions/${{secrets.AZURE_SUBSCRIPTION_ID}}/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/providers/Microsoft.Compute/galleries/${{ env.GALLERY_NAME }}/images/${{ env.IMAGE_NAME }}/versions/${VERSION}" #Replace with the resource id of your shared image gallery's image definition | ||
dist-location: 'eastus2' | ||
customizer-script: | | ||
apt update | ||
apt upgrade -y | ||
apt install -y docker.io unzip | ||
docker version | ||
curl -L 'https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)' -o /usr/local/bin/docker-compose | ||
chmod +x /usr/local/bin/docker-compose | ||
docker-compose version | ||
wget -q -O tmp.zip "https://github.com/exadel-inc/CompreFace/releases/download/v${{ env.VERSION }}/CompreFace_${{ env.VERSION }}.zip" && unzip tmp.zip && rm tmp.zip | ||
chmod 666 /var/run/docker.sock | ||
docker-compose pull --quiet | ||
docker-compose up -d | ||
/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync |