Skip to content

Commit

Permalink
Merge pull request exadel-inc#973 from exadel-inc/EFRS-1344-cf-to-ama…
Browse files Browse the repository at this point in the history
…rketplace

Publish CompreFace VM image to Azure Marketplace
  • Loading branch information
ashutau authored Nov 30, 2022
2 parents d84d783 + 76b6ae3 commit 70cd766
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/Azure-Compreface-AIB-image.yml
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

0 comments on commit 70cd766

Please sign in to comment.