actions / runner-images

GitHub Actions runner images
MIT License
9.17k stars 2.84k forks source link

Update/Add LocalDB to be SQL 2022 #9661

Closed markalroberts closed 1 month ago

markalroberts commented 1 month ago

Tool name

SQL Server LocalDB

Tool license

Free/Dev

Add or update?

Desired version

2022

Approximate size

No response

Brief description of tool

No response

URL for tool's homepage

No response

Provide a basic test case to validate the tool's functionality.

No response

Platforms where you need the tool

Runner images where you need the tool

Can this tool be installed during the build?

https://stackoverflow.com/a/78038720/187030

- powershell: |
    Write-Host "================ Download SQL2022 installer==============="
    mkdir SQL2022
    $url = "https://go.microsoft.com/fwlink/?linkid=2215160"
    $outputFilePath = "$(System.DefaultWorkingDirectory)\SQL2022\SQL2022-SSEI-Expr.exe"
    Invoke-WebRequest -Uri $url -OutFile $outputFilePath
    tree $(System.DefaultWorkingDirectory) /F /A

    Write-Host "================Download and extract SqlLocalDB.MSI from installation media==============="
    & "$(System.DefaultWorkingDirectory)\SQL2022\SQL2022-SSEI-Expr.exe" /Action=Download /MediaType=LocalDB /Quiet /MEDIAPATH=$(System.DefaultWorkingDirectory)\SQL2022
    Start-Sleep -s 60.00 # Wait for the downlaoding to complete
    tree $(System.DefaultWorkingDirectory) /F /A

    Write-Host "================Run the SqlLocalDB.MSI installer non-interactively=============="
    msiexec.exe /qb /i $(System.DefaultWorkingDirectory)\SQL2022\en-US\SqlLocalDB.msi IAcceptSqlLocalDBLicenseTerms=YES
    Start-Sleep -s 60.00 # Wait for the installation to complete

    Write-Host "================Check SQLLocalDB verion and SQL Server installation path again==============="
    sqllocaldb versions
    sqllocaldb info
    tree "C:\Program Files\Microsoft SQL Server\" /F /A
  displayName: Install SQllocalDb for SQL Server 2022

Tool installation time in runtime

20 seconds

Are you willing to submit a PR?

Potentially yes, but not sure if the script above is the right approach - seems like it should be related to upgrading the VS 2022 local db runtime support?

erik-bershel commented 1 month ago

Hey @markalroberts! Thank you for your interest for the project. Unfortunately, at the moment we are trying to make the images as light as possible and trying to avoid installing programs and packages that can be easily and quickly added at runtime. I'm forced to refuse to add this package due to maintenance concerns and runtime installation simplicity.

markalroberts commented 1 month ago

Thanks for the info @erik-bershel ... shame.... main reason we were against doing this as a custom install task was the extra ~20seconds it takes to download and install. Is there a way we can reuse/snapshot the customised version of a vmImage do you know, or will we just have to take this hit each time?

erik-bershel commented 1 month ago

Is there a way we can reuse/snapshot the customised version of a vmImage do you know, or will we just have to take this hit each time?

Only self-hosted agents came to my mind.

iernie commented 2 weeks ago

@erik-bershel How exactly can you do this runtime? I'm having issues installing SQL 2022 in a github actions task.