Skip to content

Commit

Permalink
changes for including arm64 binaries (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubramanianaks authored Nov 7, 2023
1 parent 65a0527 commit 10a361c
Show file tree
Hide file tree
Showing 34 changed files with 1,252 additions and 117 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/acr-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: build and push to acr
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to build'
required: true
default: 'development'
type: choice
options:
- development
- staging
- prod
jobs:
docker:
strategy:
matrix:
include:
- components: devhostagent
imageName: lpkremoteagent
- components: devhostagent.restorationjob
imageName: lpkrestorationjob
- components: routingmanager
imageName: routingmanager
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ vars.ACR_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Set telemetry variables
shell: bash
run: |
if [ $GITHUB_REF == "refs/heads/main" ]; then
echo "##vso[task.setvariable variable=TelemetryType]TELEMETRY_PRODUCTION"
else
echo "##vso[task.setvariable variable=TelemetryType]TELEMETRY_DEVELOPMENT"
fi
- name: Set image tags
shell: bash
id: version
run: |
chmod +x ./deployment/settings/setenvironmentvariables.sh
`./deployment/settings/setenvironmentvariables.sh deployment/settings/services/imagetag.setting`
printenv | grep "MINDARO"
if [ ${{ matrix.components}} == "devhostagent" ]; then
echo "tag=$MINDARO_DEVHOSTAGENT_TAG" >> $GITHUB_ENV
elif [ ${{ matrix.components}} == "devhostagent.restorationjob" ]; then
echo "tag=$MINDARO_DEVHOSTAGENT_RESTORATIONJOB_TAG" >> $GITHUB_ENV
else
echo "tag=$MINDARO_ROUTINGMANAGER_TAG" >> $GITHUB_ENV
fi
- name: Build and push for ${{ matrix.components }}
uses: docker/build-push-action@v5
with:
file: src/${{ matrix.components }}/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ vars.ACR_REGISTRY }}/${{ matrix.imageName }}:${{ env.tag }}
48 changes: 48 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PR build pipeline
on: [workflow_dispatch]

jobs:
self-contained:
runs-on: windows-latest
strategy:
matrix:
mode: [osx-x64,linux-x64,win-x64,win-arm64,osx-arm64,linux-arm64]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.6
- name: Restore dependencies using Nuget
run: nuget restore src\client.sln -Verbosity Normal -NonInteractive -ConfigFile src/nuget.config
- name: dotnet Publish for ${{ matrix.mode }}
run: dotnet publish src\dsc\dsc.csproj -c Release -r ${{ matrix.mode }} --no-restore --self-contained true --verbosity normal
- name: Build endpointmanagerlauncher
if: ${{ matrix.mode == 'win-x64' || matrix.mode == 'win-arm64'}}
run: dotnet publish src\EndpointManagerLauncher\endpointmanagerlauncher.csproj -r ${{ matrix.mode }} -c Release --no-restore
- name: Run unit test cases
run: |
dotnet restore src\unittest.sln
dotnet test src\unittest.sln -c Release --no-restore --verbosity normal
non-self-contained:
runs-on: windows-latest
strategy:
matrix:
mode: [osx-x64,linux-x64,win-x64,win-arm64,osx-arm64,linux-arm64]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.6
- name: Restore dependencies using Nuget
run: nuget restore src\client.sln -Verbosity Normal -NonInteractive -ConfigFile src/nuget.config
- name: dotnet Publish for ${{ matrix.mode }}
run: dotnet publish src\dsc\dsc.csproj -c Release -r ${{ matrix.mode }} --no-restore --self-contained false --verbosity normal
- name: Build endpointmanagerlauncher
if: ${{ matrix.mode == 'win-x64' || matrix.mode == 'win-arm64'}}
run: dotnet publish src\EndpointManagerLauncher\endpointmanagerlauncher.csproj -r ${{ matrix.mode }} -c Release --no-restore
81 changes: 55 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
mode: [osx-x64,linux-x64,win-x64]
mode: [osx-x64,linux-x64,win-x64,win-arm64,osx-arm64,linux-arm64]
include:
- mode: osx-x64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/darwin/amd64/kubectl'
kubectlPath: 'osx\kubectl'
- mode: linux-x64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl'
kubectlPath: 'linux\kubectl'
- mode: win-x64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/windows/amd64/kubectl.exe'
kubectlPath: 'win\kubectl.exe'
- mode: win-arm64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/windows/arm64/kubectl.exe'
kubectlPath: 'win\kubectl.exe'
- mode: osx-arm64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/darwin/arm64/kubectl'
kubectlPath: 'osx\kubectl'
- mode: linux-arm64
kubectlUrl: 'https://dl.k8s.io/release/v1.27.3/bin/linux/arm64/kubectl'
kubectlPath: 'linux\kubectl'
steps:
- uses: actions/checkout@v3
- name: Setup .NET
Expand All @@ -20,41 +39,24 @@ jobs:
- name: dotnet Publish for ${{ matrix.mode }}
run: dotnet publish src\dsc\dsc.csproj -c Release -r ${{ matrix.mode }} --no-restore --self-contained true --verbosity normal
- name: Build endpointmanagerlauncher
run: dotnet publish src\EndpointManagerLauncher\endpointmanagerlauncher.csproj -r win-x64 -c Release --no-restore
if: ${{ matrix.mode == 'win-x64' || matrix.mode == 'win-arm64'}}
run: dotnet publish src\EndpointManagerLauncher\endpointmanagerlauncher.csproj -r ${{ matrix.mode }} -c Release --no-restore
- name: Copy endpointmanagerlauncher
uses: Azure/powershell@v1
if: ${{ matrix.mode == 'win-x64' }}
if: ${{ matrix.mode == 'win-x64' || matrix.mode == 'win-arm64'}}
with:
inlineScript: |
Copy-Item -Path ${{ github.workspace }}\src\EndpointManagerLauncher\bin\Release\net7.0\win-x64\publish\ -Destination ${{ github.workspace }}\src\dsc\bin\Release\net7.0\win-x64\publish\EndpointManagerLauncher -Recurse -Exclude **/*.pdb
Copy-Item -Path ${{ github.workspace }}\src\EndpointManagerLauncher\bin\Release\net7.0\${{ matrix.mode }}\publish\ -Destination ${{ github.workspace }}\src\dsc\bin\Release\net7.0\${{ matrix.mode }}\publish\EndpointManagerLauncher -Recurse -Exclude **/*.pdb
azPSVersion: '3.1.0'
- name: Download Kubectl
uses: Azure/powershell@v1
with:
inlineScript: |
if ('${{ matrix.mode }}' -eq 'win-x64') {
$url = 'https://storage.googleapis.com/kubernetes-release/release/v1.21.2/bin/windows/amd64/kubectl.exe'
$dir = 'win'
$file = 'kubectl.exe'
} elseif ('${{ matrix.mode }}' -eq 'osx-x64') {
$url = 'https://storage.googleapis.com/kubernetes-release/release/v1.21.2/bin/darwin/amd64/kubectl'
$dir = 'osx'
$file = 'kubectl'
} else {
$url = 'https://storage.googleapis.com/kubernetes-release/release/v1.21.2/bin/linux/amd64/kubectl'
$dir = 'linux'
$file = 'kubectl'
}
Write-Output "url is: "$url
Write-Output "directory is: "$dir
Write-Output "file is: "$file
New-Item -Path '${{ github.workspace }}\src\dsc\bin\Release\net7.0\${{ matrix.mode }}\publish\kubectl' -ItemType Directory
$filePath = '${{ github.workspace }}\src\dsc\bin\Release\net7.0\${{ matrix.mode }}\publish\kubectl\'+$dir
Write-Output "file path is: "$filePath
New-Item -Path $filePath -ItemType Directory
$fileName = $filePath + '\' + $file
Write-Output "file name is: "$fileName
curl.exe $url -o $fileName
$kubectlPath = '${{ github.workspace }}\src\dsc\bin\Release\net7.0\${{ matrix.mode }}\publish\kubectl\${{ matrix.kubectlPath }}'
$kubectlDir = Split-Path $kubectlPath
New-Item -Path $kubectlDir -ItemType Directory
curl.exe $url -o $kubectlPath
azPSVersion: '3.1.0'
- name: Create .Zip files (${{ matrix.mode }})
uses: TheDoctor0/zip-release@0.6.2
Expand Down Expand Up @@ -99,6 +101,15 @@ jobs:
asset_path: ${{ github.workspace }}/lpk-win-x64/lpk-win-x64.zip
asset_name: lpk-win.zip
asset_content_type: application/zip
- name: Upload Window ARM64 Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/lpk-win-arm64/lpk-win-arm64.zip
asset_name: lpk-win-arm64.zip
asset_content_type: application/zip
- name: Upload Linux Release Assets
uses: actions/upload-release-asset@v1
env:
Expand All @@ -108,6 +119,15 @@ jobs:
asset_path: ${{ github.workspace }}/lpk-linux-x64/lpk-linux-x64.zip
asset_name: lpk-linux.zip
asset_content_type: application/zip
- name: Upload Linux ARM64 Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/lpk-linux-arm64/lpk-linux-arm64.zip
asset_name: lpk-linux-arm64.zip
asset_content_type: application/zip
- name: Upload OSX Release Assets
uses: actions/upload-release-asset@v1
env:
Expand All @@ -117,3 +137,12 @@ jobs:
asset_path: ${{ github.workspace }}/lpk-osx-x64/lpk-osx-x64.zip
asset_name: lpk-osx.zip
asset_content_type: application/zip
- name: Upload OSX ARM64 Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/lpk-osx-arm64/lpk-osx-arm64.zip
asset_name: lpk-osx-arm64.zip
asset_content_type: application/zip
Loading

0 comments on commit 10a361c

Please sign in to comment.