Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit b2713d8

Browse files
authored
Updates for release
2 parents c8c3e49 + dc205ce commit b2713d8

File tree

4 files changed

+157
-61
lines changed

4 files changed

+157
-61
lines changed

NOTICE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# NOTICES AND INFORMATION
2+
**Do Not Translate or Localize**
3+
4+
This software incorporates material from third parties. Microsoft makes certain open source code available at [https://3rdpartysource.microsoft.com](https://3rdpartysource.microsoft.com), or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to:
5+
6+
Source Code Compliance Team
7+
Microsoft Corporation
8+
One Microsoft Way
9+
Redmond, WA 98052
10+
USA
11+
12+
Notwithstanding any other terms, you may reverse engineer this software to the extent required to debug changes to any libraries licensed under the GNU Lesser General Public License.
13+
14+
---
15+
16+
## Component: **bgzip.exe**
17+
**Source:** https://www.htslib.org/doc/bgzip.html
18+
**License:** [MIT License](https://opensource.org/licenses/MIT)
19+
20+
---
21+
22+
## Component: **bwalib.lib** (BWA)
23+
**Source:** https://github.com/lh3/bwa
24+
**License:**
25+
- [GNU General Public License v3.0 (GPL-3.0)](https://www.gnu.org/licenses/gpl-3.0.html)
26+
- [MIT License (for components)](https://opensource.org/licenses/MIT)
27+
28+
---
29+
30+
## Component: **tabix.exe**
31+
**Source:** https://www.htslib.org/doc/tabix.html
32+
**License:**
33+
- [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
34+
- [MIT License (for components)](https://opensource.org/licenses/MIT)
35+
36+
---
37+
38+
## Component: **zulu8.84.0.15-ca-jdk8.0.442-win_x64.msi**
39+
**Source:** https://www.azul.com/downloads/?package=jdk#zulu
40+
**License:** [GPL v2 with Classpath Exception](https://openjdk.org/legal/gplv2+ce.html)
41+
42+
---
43+
44+
## Component: **gatk-package-distribution-3.5.jar**
45+
**Source:** https://gatk.broadinstitute.org/hc/en-us/articles/360045763652
46+
**License:** [GATK-Protected License (Broad Institute Terms)](https://gatk.broadinstitute.org/hc/en-us/articles/360045763652)
47+
48+
---

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ We recommend new and existing customers use the latest Microsoft OSS solutions i
55
- [Cromwell on Azure](https://github.com/microsoft/CromwellOnAzure)
66
- [GA4GH TES on Azure](https://github.com/microsoft/ga4gh-tes)
77

8-
# Update 1/23/2025
9-
10-
`msgen.ps1` and `run-on-azure-vm.sh` are now code-complete for the release of the binary executables, except, the actual binaries have not been released yet, pending completion of internal reviews. Thus, the `msgen.ps1` script will fail when it attempts to download it. We will update this README when the binaries are available for download. Instructions are avaialble here: https://github.com/microsoft/msgen/wiki
8+
Instructions are available here: https://github.com/microsoft/msgen/wiki
119

1210
---
1311

src/msgen.ps1

Lines changed: 92 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ param (
44
[string]$outputUrlPrefix,
55
[string]$identityResourceId,
66

7-
# Optional parameters for deleting the VM's resource group on completion
7+
# Optional parameters
8+
[string]$msgenDownloadUrl = "https://datasetmsgen.blob.core.windows.net/dataset/msgen-oss/msgen-oss.zip",
9+
10+
# Optional parameters for deleting the VM's resource group on completion
811
[string]$subscriptionId = $null,
912
[string]$resourceGroupName = $null,
1013
[string]$vmName = $null
@@ -13,12 +16,23 @@ param (
1316
$ErrorActionPreference = "Stop"
1417

1518
$azCopyDownloadUrl = "https://aka.ms/downloadazcopy-v10-windows"
16-
$azCopyInstallDir = "C:\azcopy"
17-
$tempDir = "D:\temp"
18-
$msgenDownloadUrl = "https://datasetmsgen.blob.core.windows.net/dataset/msgen-oss/msgen-oss.zip"
19+
$azCopyInstallDir = "C:\azcopy"
20+
$tempDir = $env:TEMP
1921
$hg38m1xUrl = "https://datasetmsgen.blob.core.windows.net/dataset/hg38m1x/*"
2022
$hg38m1xIdxUrl = "https://datasetmsgen.blob.core.windows.net/dataset/hg38m1x.idx/*"
2123
$logsZipPath = "$tempDir\logs\logs.zip"
24+
$dotnetRuntimeUrl = "https://builds.dotnet.microsoft.com/dotnet/Runtime/9.0.6/dotnet-runtime-9.0.6-win-x64.exe"
25+
$dotnetRuntimeInstallerPath = "$tempDir\dotnet-runtime-9.0.6-win-x64.exe"
26+
$javaInstallerBinaryName = "zulu8.84.0.15-ca-jdk8.0.442-win_x64.msi"
27+
$javaInstallerPath = "$tempDir\$javaInstallerBinaryName"
28+
$javaDownloadUrl = "https://cdn.azul.com/zulu/bin/zulu8.84.0.15-ca-jdk8.0.442-win_x64.msi"
29+
$defaultJavaPath = "C:\java\bin\java.exe"
30+
31+
# Function to check if .NET 9 Runtime is installed
32+
function Is-DotNet9Installed {
33+
$runtimes = & dotnet --list-runtimes 2>$null
34+
return $runtimes -match "9\."
35+
}
2236

2337
try {
2438
# Create directories if they don't exist
@@ -61,18 +75,52 @@ try {
6175
# Download input files
6276
Write-Host "Authenticating AZCOPY with the user-assigned managed identity..."
6377
& "$azCopyInstallDir\azcopy.exe" login --identity --identity-resource-id $identityResourceId
78+
6479

6580
Write-Host "Downloading input files..."
6681
& "$azCopyInstallDir\azcopy.exe" cp $inputUrl1 "$tempDir\inputs"
6782
if (![string]::IsNullOrEmpty($inputUrl2)) {
6883
& "$azCopyInstallDir\azcopy.exe" cp $inputUrl2 "$tempDir\inputs"
6984
}
7085

86+
if (!(Test-Path $defaultJavaPath)) {
87+
Write-Host "Java not found, downloading installer..."
88+
(New-Object Net.WebClient).DownloadFile($javaDownloadUrl, $javaInstallerPath)
89+
Write-Host "Installing Java..."
90+
Start-Process -FilePath "msiexec.exe" -ArgumentList "/quiet /i `"$javaInstallerPath`" INSTALLDIR=C:\java\" -Wait
91+
if ($LASTEXITCODE -ne 0) { throw "Java installation failed. Exit code: $LASTEXITCODE" }
92+
Write-Host "Java installed successfully."
93+
} else {
94+
Write-Host "Java is already installed."
95+
}
96+
97+
7198
# Download and unzip msgen-oss
7299
Write-Host "Downloading msgen-oss..."
73100
& "$azCopyInstallDir\azcopy.exe" cp $msgenDownloadUrl "$tempDir" --recursive
74101
Expand-Archive -Path "$tempDir\msgen-oss.zip" -DestinationPath "$tempDir\msgen" -Force
75102

103+
# Download needed dotnet version
104+
if (Is-DotNet9Installed) {
105+
Write-Host ".NET 9 runtime is already installed." -ForegroundColor Green
106+
} else {
107+
Write-Host ".NET 9 runtime not found. Installing..." -ForegroundColor Yellow
108+
Invoke-WebRequest -Uri $dotnetRuntimeUrl -OutFile $dotnetRuntimeInstallerPath
109+
110+
# Install silently (no UI)
111+
Start-Process -FilePath $dotnetRuntimeInstallerPath -ArgumentList "/install", "/quiet", "/norestart" -Wait
112+
113+
# Clean up
114+
Remove-Item $dotnetRuntimeInstallerPath
115+
116+
# Confirm installation
117+
if (Is-DotNet9Installed) {
118+
Write-Host ".NET 9 runtime was successfully installed." -ForegroundColor Green
119+
} else {
120+
Write-Host "Installation failed or .NET 9 runtime not detected." -ForegroundColor Red
121+
}
122+
}
123+
76124
# Run msgen-oss
77125
Write-Host "Running msgen-oss..."
78126
& "$tempDir\msgen\msgen-oss.exe" $tempDir "$tempDir\inputs" "$tempDir\outputs" "$tempDir\logs" "$tempDir\resources" "R=hg38m1x;GERC=GVCF;BGZIP=True"
@@ -104,53 +152,54 @@ try {
104152

105153
Write-Host "Completed genomics successfully."
106154

107-
# Delete VM resouce group if set
108-
if ($subscriptionId -ne $null -and $resourceGroupName -ne $null -and $vmName -ne $null) {
109-
Write-Host "Deleting this VM now..."
155+
} catch {
156+
Write-Host "An error occurred: $($_.Exception.Message)"
157+
exit 1
158+
}
110159

111-
Write-Host "Installing Azure CLI..."
160+
# Delete VM resouce group if set
161+
if ($subscriptionId -ne $null -and $resourceGroupName -ne $null -and $vmName -ne $null) {
162+
Write-Host "Deleting this VM now..."
112163

113-
# Azure CLI MSI installer URL
114-
$azureCliInstallerUrl = "https://aka.ms/installazurecliwindows"
115-
$installerPath = "$env:TEMP\AzureCLIInstaller.msi"
164+
Write-Host "Installing Azure CLI..."
116165

117-
# Download Azure CLI installer using WebClient
118-
Write-Host "Downloading Azure CLI installer from $azureCliInstallerUrl..."
119-
$webClient = New-Object System.Net.WebClient
120-
$webClient.DownloadFile($azureCliInstallerUrl, $installerPath)
166+
# Azure CLI MSI installer URL
167+
$azureCliInstallerUrl = "https://aka.ms/installazurecliwindows"
168+
$installerPath = "$env:TEMP\AzureCLIInstaller.msi"
121169

122-
# Install Azure CLI silently
123-
Write-Host "Installing Azure CLI..."
124-
Start-Process -FilePath "msiexec.exe" -ArgumentList "/I `"$installerPath`" /quiet /norestart" -Wait
170+
# Download Azure CLI installer using WebClient
171+
Write-Host "Downloading Azure CLI installer from $azureCliInstallerUrl..."
172+
$webClient = New-Object System.Net.WebClient
173+
$webClient.DownloadFile($azureCliInstallerUrl, $installerPath)
125174

126-
# Cleanup the installer
127-
Remove-Item -Path $installerPath -Force
128-
Write-Host "Azure CLI installed successfully."
175+
# Install Azure CLI silently
176+
Write-Host "Installing Azure CLI..."
177+
Start-Process -FilePath "msiexec.exe" -ArgumentList "/I `"$installerPath`" /quiet /norestart" -Wait
129178

130-
# Add Azure CLI to PATH
131-
$azPath = "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
132-
if (-not ($env:PATH -like "*$azPath*")) {
133-
$env:PATH += ";$azPath"
134-
}
179+
# Cleanup the installer
180+
Remove-Item -Path $installerPath -Force
181+
Write-Host "Azure CLI installed successfully."
135182

136-
# Step 2: Authenticate using User Assigned Managed Identity (UAMI)
137-
Write-Host "Authenticating using User Assigned Managed Identity..."
138-
$loginResult = az login --identity --username $identityResourceId --query '[0].id' -o tsv
183+
# Add Azure CLI to PATH
184+
$azPath = "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
185+
if (-not ($env:PATH -like "*$azPath*")) {
186+
$env:PATH += ";$azPath"
187+
}
139188

140-
if ($LASTEXITCODE -ne 0) {
141-
Write-Host "Failed to authenticate with the User Assigned Managed Identity. Exiting..."
142-
exit 1
143-
}
144-
Write-Host "Authentication successful."
189+
# Step 2: Authenticate using User Assigned Managed Identity (UAMI)
190+
Write-Host "Authenticating using User Assigned Managed Identity..."
191+
$loginResult = az login --identity --resource-id $identityResourceId --query '[0].id' -o tsv
145192

146-
az account set --subscription $subscriptionId
193+
if ($LASTEXITCODE -ne 0) {
194+
Write-Host "Failed to authenticate with the User Assigned Managed Identity. Exiting..."
195+
exit 1
196+
}
197+
Write-Host "Authentication successful."
147198

148-
Write-Host "Deleting the VM's resource group..."
149-
az group delete --name $resourceGroupName --yes --no-wait
199+
az account set --subscription $subscriptionId
150200

151-
Write-Host "VM resource group deletion initiated. Everything complete."
152-
}
153-
} catch {
154-
Write-Host "An error occurred: $($_.Exception.Message)"
155-
exit 1
156-
}
201+
Write-Host "Deleting the VM's resource group..."
202+
az group delete --name $resourceGroupName --yes --no-wait
203+
204+
Write-Host "VM resource group deletion initiated. Everything complete."
205+
}

src/run-on-azure-vm.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/bin/bash
22
set -e
33

4-
AZURE_LOCATION="${1:-westus}"
5-
STEM_NAME="${2:-msgen2025}"
6-
RESOURCE_GROUP="${3:-${STEM_NAME}-vm}"
7-
IDENTITY_RESOURCE_GROUP="${4:-${STEM_NAME}-identity}"
8-
IDENTITY_NAME="${5:-${STEM_NAME}-identity}"
9-
VM_SIZE="${6:-Standard_D64d_v5}"
10-
INPUT_URL1="${7}"
11-
INPUT_URL2="${8}"
12-
OUTPUT_URL_PREFIX="${9}"
4+
INPUT_URL1="${1}"
5+
INPUT_URL2="${2}"
6+
OUTPUT_URL_PREFIX="${3}"
7+
AZURE_LOCATION="${4:-westus2}"
8+
STEM_NAME="${5:-msgen2025}"
9+
RESOURCE_GROUP="${6:-${STEM_NAME}-vm}"
10+
IDENTITY_RESOURCE_GROUP="${7:-${STEM_NAME}-identity}"
11+
IDENTITY_NAME="${8:-${STEM_NAME}-identity}"
12+
VM_SIZE="${9:-Standard_D64d_v5}"
1313

1414
VM_NAME="${STEM_NAME}-vm"
1515
ADMIN_USERNAME="azureuser"
1616
PASSWORD="$(< /dev/urandom tr -dc 'A-Za-z0-9' | head -c 16)!"
1717
SCRIPT_URL="https://raw.githubusercontent.com/microsoft/msgen/refs/heads/main/src/msgen.ps1"
18-
19-
SUBSCRIPTION_ID=$(az account show --query id -o tsv)
18+
MSGEN_BINARIES_URL="https://datasetmsgen.blob.core.windows.net/dataset/msgen-oss/msgen-oss.zip"
19+
SUBSCRIPTION_ID=$(az account show --query id -o tsv | tr -d '\r')
2020

2121
cleanup() {
2222
read -p "Do you want to delete the resource group '$RESOURCE_GROUP'? (y/n): " CONFIRM
@@ -51,10 +51,10 @@ else
5151
echo "Managed identity $IDENTITY_NAME already exists. Skipping creation."
5252
fi
5353

54-
IDENTITY_ID=$(az identity show --name "$IDENTITY_NAME" --resource-group "$IDENTITY_RESOURCE_GROUP" --query id -o tsv)
54+
IDENTITY_ID=$(az identity show --name "$IDENTITY_NAME" --resource-group "$IDENTITY_RESOURCE_GROUP" --query id -o tsv | tr -d '\r')
5555

5656
echo "Assigning Contributor role to the managed identity for the resource group $RESOURCE_GROUP..."
57-
IDENTITY_OBJECT_ID=$(az identity show --name "$IDENTITY_NAME" --resource-group "$IDENTITY_RESOURCE_GROUP" --query principalId -o tsv)
57+
IDENTITY_OBJECT_ID=$(az identity show --name "$IDENTITY_NAME" --resource-group "$IDENTITY_RESOURCE_GROUP" --query principalId -o tsv | tr -d '\r')
5858

5959
# Assign the Contributor role using the object ID and specifying the principal type
6060
az role assignment create \
@@ -70,7 +70,7 @@ LATEST_IMAGE=$(az vm image list \
7070
--sku 2022-datacenter-azure-edition \
7171
--architecture x64 \
7272
--all \
73-
--query "[?offer=='WindowsServer' && sku=='2022-datacenter-azure-edition'].{Version: version, URN: urn} | sort_by(@, &Version)[-1].URN" -o tsv)
73+
--query "[?offer=='WindowsServer' && sku=='2022-datacenter-azure-edition'].{Version: version, URN: urn} | sort_by(@, &Version)[-1].URN" -o tsv | tr -d '\r')
7474
echo "Selected image: $LATEST_IMAGE"
7575

7676
echo "Creating virtual machine $VM_NAME in resource group $RESOURCE_GROUP..."
@@ -86,7 +86,7 @@ az vm create \
8686
--enable-vtpm
8787

8888

89-
VM_ID=$(az vm show --name "$VM_NAME" --resource-group "$RESOURCE_GROUP" --query id -o tsv)
89+
VM_ID=$(az vm show --name "$VM_NAME" --resource-group "$RESOURCE_GROUP" --query id -o tsv | tr -d '\r')
9090
echo "Assigning managed identity $IDENTITY_NAME to virtual machine $VM_NAME..."
9191
az vm identity assign --identities "$IDENTITY_ID" --ids "$VM_ID"
9292

@@ -105,6 +105,7 @@ if [[ -n "$INPUT_URL2" ]]; then
105105
fi
106106
COMMAND_TO_EXECUTE+=" -outputUrlPrefix $OUTPUT_URL_PREFIX"
107107
COMMAND_TO_EXECUTE+=" -identityResourceId $IDENTITY_ID"
108+
COMMAND_TO_EXECUTE+=" -msgenDownloadUrl $MSGEN_BINARIES_URL"
108109
COMMAND_TO_EXECUTE+=" -subscriptionId $SUBSCRIPTION_ID"
109110
COMMAND_TO_EXECUTE+=" -resourceGroupName $RESOURCE_GROUP"
110111
COMMAND_TO_EXECUTE+=" -vmName $VM_NAME"

0 commit comments

Comments
 (0)