From fd62ffec4f87b36b22c22bf5e9ed27c354cc60ab Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev Date: Tue, 17 Nov 2020 12:36:10 +0700 Subject: [PATCH 1/5] remove gcc workaround --- images/macos/provision/core/gcc.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/images/macos/provision/core/gcc.sh b/images/macos/provision/core/gcc.sh index 1bac167e3..fefe20fd6 100644 --- a/images/macos/provision/core/gcc.sh +++ b/images/macos/provision/core/gcc.sh @@ -4,16 +4,4 @@ echo "Installing GCC@8 using homebrew..." brew install gcc@8 echo "Installing GCC@9 using homebrew..." -brew install gcc@9 - -# Known issue with brew that prevent installation of multiple formulas -# https://github.com/Homebrew/brew/issues/9100 -echo "Applying workaround for the GCC" -cellarPath=$(brew --cellar gcc@8) -gccVersion=$(ls $cellarPath | head -n1) -fullCellarPath=$cellarPath/$gccVersion -ln -s $fullCellarPath/bin/c++-8 /usr/local/bin/c++-8 -ln -s $fullCellarPath/bin/cpp-8 /usr/local/bin/cpp-8 -ln -s $fullCellarPath/bin/g++-8 /usr/local/bin/g++-8 -ln -s $fullCellarPath/bin/gcc-8 /usr/local/bin/gcc-8 -ln -s $fullCellarPath/bin/gfortran-8 /usr/local/bin/gfortran-8 \ No newline at end of file +brew install gcc@9 \ No newline at end of file From a454d66e7f151fe9bf577240f66ebd81899d546e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Tue, 17 Nov 2020 10:18:27 +0300 Subject: [PATCH 2/5] [Ubuntu] Add MS SQL Tools version (#2046) * Add MS SQL Tools version * Minor fix * Move MS SQL tools installation to separated file * Minor fix * accept yula --- .../SoftwareReport.Databases.psm1 | 19 +++++++++++++++++-- .../SoftwareReport.Generator.ps1 | 1 + .../scripts/installers/mssql-cmd-tools.sh | 18 ++++++++++++++++++ images/linux/scripts/installers/mysql.sh | 5 ----- images/linux/ubuntu1604.json | 1 + images/linux/ubuntu1804.json | 1 + images/linux/ubuntu2004.json | 1 + 7 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 images/linux/scripts/installers/mssql-cmd-tools.sh diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 index 973257b10..450bcfeb2 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 @@ -18,18 +18,33 @@ function Get-MySQLVersion { return "MySQL $mySQLVersion" } +function Get-SQLCmdVersion { + $sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1 + return "sqlcmd $sqlcmdVersion" +} + function Build-MySQLSection { $output = "" $output += New-MDHeader "MySQL" -Level 4 $output += New-MDList -Style Unordered -Lines @( (Get-MySQLVersion ), - "MySQL Server (user:root password:root)", - "MS SQL Server Client Tools" + "MySQL Server (user:root password:root)" ) $output += New-MDCode -Lines @( "MySQL service is disabled by default. Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'" ) + return $output +} + +function Build-MSSQLToolsSection { + $output = "" + + $output += New-MDHeader "MS SQL Server Client Tools" -Level 4 + $output += New-MDList -Style Unordered -Lines @( + (Get-SQLCmdVersion) + ) + return $output } \ No newline at end of file diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 9cf57034a..4230ea835 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -215,6 +215,7 @@ $markdown += New-MDList -Style Unordered -Lines @( ) $markdown += Build-MySQLSection +$markdown += Build-MSSQLToolsSection $markdown += New-MDHeader "Cached Tools" -Level 3 $markdown += Build-CachedToolsSection diff --git a/images/linux/scripts/installers/mssql-cmd-tools.sh b/images/linux/scripts/installers/mssql-cmd-tools.sh new file mode 100644 index 000000000..3177dd38b --- /dev/null +++ b/images/linux/scripts/installers/mssql-cmd-tools.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e +################################################################################ +## File: mssql-cmd-tools.sh +## Desc: Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017) +################################################################################ + +export ACCEPT_EULA=Y + +apt-get update +apt-get install -y mssql-tools unixodbc-dev +apt-get -f install +ln -s /opt/mssql-tools/bin/* /usr/local/bin/ + +echo "Testing to make sure that script performed as expected, and basic scenarios work" +if ! command -v sqlcmd; then + echo "sqlcmd was not installed" + exit 1 +fi \ No newline at end of file diff --git a/images/linux/scripts/installers/mysql.sh b/images/linux/scripts/installers/mysql.sh index 9abb97931..778294777 100644 --- a/images/linux/scripts/installers/mysql.sh +++ b/images/linux/scripts/installers/mysql.sh @@ -31,11 +31,6 @@ apt-get install -y mysql-server #Install MySQL Dev tools apt install libmysqlclient-dev -y -# Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017) -apt-get install -y mssql-tools unixodbc-dev -apt-get -f install -ln -s /opt/mssql-tools/bin/* /usr/local/bin/ - # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" if ! command -v mysql; then diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 6168f4bf8..d96118dbd 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -190,6 +190,7 @@ "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", + "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", "{{template_dir}}/scripts/installers/oras-cli.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 6fc3f813f..417856881 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -193,6 +193,7 @@ "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", + "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index bde4024c0..fb44a04fb 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -203,6 +203,7 @@ "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", + "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", "{{template_dir}}/scripts/installers/bazel.sh", From 7dae76249bba63fe289d9e4d97b9542fa6a4f784 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Tue, 17 Nov 2020 10:20:55 +0300 Subject: [PATCH 3/5] [ubuntu][windows] Remove announcements from generation (#2063) --- .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 7 ------- images/linux/ubuntu1604.json | 6 ++---- images/linux/ubuntu1804.json | 6 ++---- images/linux/ubuntu2004.json | 6 ++---- images/win/announcements.md | 3 --- .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 7 ------- images/win/windows2016.json | 6 ++---- images/win/windows2019.json | 6 ++---- 8 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 images/win/announcements.md diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 4230ea835..a67a56bd4 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -21,13 +21,6 @@ Restore-UserOwner $markdown = "" -if ($env:ANNOUNCEMENTS) { - $markdown += $env:ANNOUNCEMENTS - $markdown += New-MDNewLine - $markdown += "***" - $markdown += New-MDNewLine -} - $OSName = Get-OSName $markdown += New-MDHeader "$OSName" -Level 1 diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index d96118dbd..a6bb1f428 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -21,8 +21,7 @@ "image_version": "dev", "image_os": "ubuntu16", "github_feed_token": null, - "run_validation_diskspace": "false", - "announcements": "{{env `ANNOUNCEMENTS`}}" + "run_validation_diskspace": "false" }, "sensitive-variables": [ "client_secret", @@ -313,8 +312,7 @@ ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", - "ANNOUNCEMENTS={{user `announcements`}}" + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" ] }, { diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 417856881..97237827f 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -21,8 +21,7 @@ "image_version": "dev", "image_os": "ubuntu18", "github_feed_token": null, - "run_validation_diskspace": "false", - "announcements": "{{env `ANNOUNCEMENTS`}}" + "run_validation_diskspace": "false" }, "sensitive-variables": [ "client_secret", @@ -317,8 +316,7 @@ ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", - "ANNOUNCEMENTS={{user `announcements`}}" + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" ] }, { diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index fb44a04fb..2866181f0 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -23,8 +23,7 @@ "github_feed_token": null, "run_validation_diskspace": "false", "go_default": "1.14", - "go_versions": "1.14", - "announcements": "{{env `ANNOUNCEMENTS`}}" + "go_versions": "1.14" }, "sensitive-variables": [ "client_secret", @@ -327,8 +326,7 @@ ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}", - "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", - "ANNOUNCEMENTS={{user `announcements`}}" + "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}" ] }, { diff --git a/images/win/announcements.md b/images/win/announcements.md deleted file mode 100644 index 7b462ebc8..000000000 --- a/images/win/announcements.md +++ /dev/null @@ -1,3 +0,0 @@ -| Announcements | -|:-:| -| [Replace SVN (1.8.17) by TortoiseSVN (1.14.x) on Windows images](https://github.com/actions/virtual-environments/issues/1318) | diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 91c19dc6f..9439c1ed0 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -10,13 +10,6 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.VisualStudio.psm1") -Disa $markdown = "" -if ($env:ANNOUNCEMENTS) { - $markdown += $env:ANNOUNCEMENTS - $markdown += New-MDNewLine - $markdown += "***" - $markdown += New-MDNewLine -} - $OSName = Get-OSName $markdown += New-MDHeader "$OSName" -Level 1 diff --git a/images/win/windows2016.json b/images/win/windows2016.json index 13cdc4a76..70828402e 100644 --- a/images/win/windows2016.json +++ b/images/win/windows2016.json @@ -26,8 +26,7 @@ "capture_name_prefix": "packer", "image_version": "dev", "image_os": "win16", - "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", - "announcements": "{{env `ANNOUNCEMENTS`}}" + "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}" }, "sensitive-variables": [ "install_password", @@ -362,8 +361,7 @@ "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" ], "environment_vars": [ - "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", - "ANNOUNCEMENTS={{user `announcements`}}" + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ] }, { diff --git a/images/win/windows2019.json b/images/win/windows2019.json index f2c230bf7..c791b2c07 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -26,8 +26,7 @@ "capture_name_prefix": "packer", "image_version": "dev", "image_os": "win19", - "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}", - "announcements": "{{env `ANNOUNCEMENTS`}}" + "github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}" }, "sensitive-variables": [ "install_password", @@ -360,8 +359,7 @@ "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" ], "environment_vars": [ - "TOOLSET_JSON_PATH={{user `toolset_json_path`}}", - "ANNOUNCEMENTS={{user `announcements`}}" + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" ] }, { From d79dfb95aac78e71c7d71511988bb71214fd3add Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Tue, 17 Nov 2020 13:03:23 +0500 Subject: [PATCH 4/5] [ubuntu] Limit apt sources to the actual architectures (#2021) * limit apt sources to the actual architectures * Move the modification from its own file to base/apt.sh * Add comment --- images/linux/scripts/base/apt.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/images/linux/scripts/base/apt.sh b/images/linux/scripts/base/apt.sh index ccb1c3b00..35bc92da0 100644 --- a/images/linux/scripts/base/apt.sh +++ b/images/linux/scripts/base/apt.sh @@ -23,7 +23,16 @@ apt-get remove unattended-upgrades # Install aria2 and jq apt-get install aria2 apt-get install jq + # Use apt-fast for parallel downloads add-apt-repository -y ppa:apt-fast/stable + +# Need to limit arch for default apt repos due to +# https://github.com/actions/virtual-environments/issues/1961 +sed -i'' -E 's/^deb http:\/\/(azure.archive|security).ubuntu.com/deb [arch=amd64,i386] http:\/\/\1.ubuntu.com/' /etc/apt/sources.list + +echo 'APT sources limited to the actual architectures' +cat /etc/apt/sources.list + apt-get update apt-get install apt-fast From d3f2f21627edba85481e80359ec3cf353a5138b0 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Tue, 17 Nov 2020 13:04:34 +0500 Subject: [PATCH 5/5] [ubuntu] Add Az Module (#2061) --- images/linux/toolsets/toolset-2004.json | 1 + 1 file changed, 1 insertion(+) diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index b4c17da09..e96240fd2 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -73,6 +73,7 @@ { "name": "az", "versions": [ + "3.8.0", "4.8.0" ] }