Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 053a055

Browse files
authored
update all feature scripts to support jammy (& update regression testing parameters) (#1464)
* test against jammy * update regression * conditionally install libssl3.0 or libssl1.1 depending on distro support (#1458) * bump ruby regression test to 3.1.2 * swap libssl condition check and friendlier error * even friendlier * update regression * add ssh group if it does not exist * install tigervnc-tools to get vncpasswd on new ubuntu versions, if needed (#1428) * test against a more meaningful oryx image * update powershell script dropping dependency missing in ubuntu 22.04
1 parent 983f5b0 commit 053a055

File tree

8 files changed

+65
-10
lines changed

8 files changed

+65
-10
lines changed

.github/workflows/script-library-pr-debian.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: "!contains(github.event.head_commit.message, 'Automated update') && !contains(github.event.head_commit.message, 'CI ignore')"
1414
strategy:
1515
matrix:
16-
os: ["debian:bullseye", "debian:buster", "ubuntu:focal", "ubuntu:bionic"] # TODO: Add "ubuntu:jammy"
16+
os: ["debian:bullseye", "debian:buster", "ubuntu:focal", "ubuntu:bionic", "ubuntu:jammy"]
1717
defaults: ["true", "false"]
1818
fail-fast: true
1919
runs-on: ubuntu-latest

.github/workflows/script-library.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: "!contains(github.event.head_commit.message, 'Automated update') && !contains(github.event.head_commit.message, 'CI ignore')"
1414
strategy:
1515
matrix:
16-
os: ["debian:bullseye", "debian:buster", "ubuntu:focal", "ubuntu:jammy", "ubuntu:bionic", alpine, rockylinux, "mcr.microsoft.com/oryx/build:github-actions-20210902.1"]
16+
os: ["debian:bullseye", "debian:buster", "ubuntu:focal", "ubuntu:jammy", "ubuntu:bionic", alpine, rockylinux, "mcr.microsoft.com/oryx/build:vso-focal-20220429.1"]
1717
defaults: ["true", "false"]
1818
fail-fast: false
1919
runs-on: ubuntu-latest

script-library/desktop-lite-debian.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ package_list="
5656
nano \
5757
locales"
5858

59+
# Packages to attempt to install if essential tools are missing (ie: vncpasswd).
60+
# This is useful, at least, for Ubuntu 22.04 (jammy)
61+
package_list_additional="
62+
tigervnc-tools"
63+
5964
set -e
6065

6166
if [ "$(id -u)" -ne 0 ]; then
@@ -164,6 +169,10 @@ check_packages() {
164169
fi
165170
}
166171

172+
##########################
173+
# Install starts here #
174+
##########################
175+
167176
# Ensure apt is in non-interactive to avoid prompts
168177
export DEBIAN_FRONTEND=noninteractive
169178

@@ -191,6 +200,12 @@ fi
191200
# Install X11, fluxbox and VS Code dependencies
192201
check_packages ${package_list}
193202

203+
# On newer versions of Ubuntu (22.04),
204+
# we need an additional package that isn't provided in earlier versions
205+
if ! type vncpasswd > /dev/null 2>&1; then
206+
check_packages ${package_list_additional}
207+
fi
208+
194209
# Install Emoji font if available in distro - Available in Debian 10+, Ubuntu 18.04+
195210
if dpkg-query -W fonts-noto-color-emoji > /dev/null 2>&1 && ! dpkg -s fonts-noto-color-emoji > /dev/null 2>&1; then
196211
apt-get -y install --no-install-recommends fonts-noto-color-emoji

script-library/dotnet-debian.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ ACCESS_GROUP=${6:-"dotnet"}
1818

1919
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
2020
DOTNET_ARCHIVE_ARCHITECTURES="amd64"
21-
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute"
21+
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute jammy"
2222
# Feed URI sourced from the official dotnet-install.sh
2323
# https://github.com/dotnet/install-scripts/blob/1b98b94a6f6d81cc4845eb88e0195fac67caa0a6/src/dotnet-install.sh#L1342-L1343
2424
DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net"
25+
# Ubuntu 22.04 and on do not ship with libssl1.1, which is required for versions of .NET < 6.0
26+
DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hirsute"
2527

2628
# Exit on failure.
2729
set -e
@@ -295,7 +297,14 @@ install_using_dotnet_releases_url() {
295297
# - libgcc-s1 OR libgcc1 depending on OS
296298
# - the latest libicuXX depending on OS (eg libicu57 for stretch)
297299
# - also installs libc6 and libstdc++6 which are required by .NET
298-
check_packages curl ca-certificates tar jq icu-devtools libgssapi-krb5-2 libssl1.1 zlib1g
300+
check_packages curl ca-certificates tar jq icu-devtools libgssapi-krb5-2 zlib1g
301+
302+
# Starting with Ubuntu 22.04 (jammy), libssl1.1 does not ship with the OS anymore.
303+
if [[ "${DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1}" = *"${VERSION_CODENAME}"* ]]; then
304+
check_packages libssl1.1
305+
else
306+
check_packages libssl3.0
307+
fi
299308

300309
get_full_version_details "${sdk_or_runtime}"
301310
# exports DOTNET_DOWNLOAD_URL, DOTNET_DOWNLOAD_HASH, DOTNET_DOWNLOAD_NAME
@@ -343,6 +352,18 @@ EOF
343352

344353
export DEBIAN_FRONTEND=noninteractive
345354

355+
# Dotnet 3.1 and 5.0 are not supported on Ubuntu 22.04 (jammy)+,
356+
# due to lack of libssl3.0 support.
357+
# See: https://github.com/microsoft/vscode-dev-containers/issues/1458#issuecomment-1135077775
358+
# NOTE: This will only guard against installation of the dotnet versions we propose via 'features'.
359+
# The user can attempt to install any other version at their own risk.
360+
if [[ "${DOTNET_VERSION}" = "3.1" ]] || [[ "${DOTNET_VERSION}" = "5.0" ]]; then
361+
if [[ ! "${DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1}" = *"${VERSION_CODENAME}"* ]]; then
362+
err "Dotnet ${DOTNET_VERSION} is not supported on Ubuntu ${VERSION_CODENAME} due to a change in the 'libssl' dependency across distributions.\n Please upgrade your version of dotnet, or downgrade your OS version."
363+
exit 1
364+
fi
365+
fi
366+
346367
# Determine if the user wants to download .NET Runtime only, or .NET SDK & Runtime
347368
# and set the appropriate variables.
348369
if [ "${DOTNET_RUNTIME_ONLY}" = "true" ]; then
@@ -362,13 +383,15 @@ architecture="$(dpkg --print-architecture)"
362383

363384
use_dotnet_releases_url="false"
364385
if [[ "${DOTNET_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${DOTNET_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
386+
echo "Detected ${VERSION_CODENAME} on ${architecture}. Attempting to install dotnet from apt"
365387
install_using_apt "${DOTNET_SDK_OR_RUNTIME}" || use_dotnet_releases_url="true"
366388
else
367389
use_dotnet_releases_url="true"
368390
fi
369391

370392
if [ "${use_dotnet_releases_url}" = "true" ]; then
371-
install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}"
393+
echo "Could not install dotnet from apt. Attempting to install dotnet from releases url"
394+
install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}"
372395
fi
373396

374397
echo "Done!"

script-library/powershell-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ install_using_apt() {
122122

123123
install_using_github() {
124124
# Fall back on direct download if no apt package exists in microsoft pool
125-
check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 liblttng-ust0 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9]
125+
check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9]
126126
if ! type git > /dev/null 2>&1; then
127127
apt_get_update_if_needed
128128
apt-get install -y --no-install-recommends git

script-library/shared/settings.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal"
1313
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
1414
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1515
DOTNET_ARCHIVE_ARCHITECTURES="amd64"
16-
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute"
16+
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute jammy"
17+
DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hirsute"
1718
DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net"
1819
HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS"
1920
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"

script-library/sshd-debian.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ elif [ "${NEW_PASSWORD}" != "skip" ]; then
7575
echo "${USERNAME}:${NEW_PASSWORD}" | chpasswd
7676
fi
7777

78+
if [ $(getent group ssh) ]; then
79+
echo "'ssh' group already exists."
80+
else
81+
echo "adding 'ssh' group, as it does not already exist."
82+
groupadd ssh
83+
fi
84+
7885
# Add user to ssh group
7986
if [ "${USERNAME}" != "root" ]; then
8087
usermod -aG ssh ${USERNAME}

script-library/test/regression/run-scripts.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ fi
9595

9696
# Debian/Ubuntu specific tests
9797
if [ "${DISTRO}" = "debian" ]; then
98+
99+
# dotnet
100+
get_common_setting DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1
101+
if [[ "${DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1}" = *"${VERSION_CODENAME}"* ]]; then
102+
run_script dotnet "3.1 true ${USERNAME} false /opt/dotnet dotnet"
103+
104+
else
105+
run_script dotnet "6.0 true ${USERNAME} false /opt/dotnet dotnet"
106+
fi
107+
108+
run_script ruby "false" "3.1.2"
109+
run_script python "3.10 /opt/python /opt/python-tools ${USERNAME} false false"
98110
run_script awscli
99111
run_script azcli
100112
run_script fish "false ${USERNAME}"
@@ -106,8 +118,6 @@ if [ "${DISTRO}" = "debian" ]; then
106118
run_script kubectl-helm "latest latest latest"
107119
run_script maven "3.6.3 /usr/local/sdkman3 ${USERNAME} false"
108120
run_script node "/usr/local/share/nvm 14 ${USERNAME}"
109-
run_script python "3.4.10 /opt/python /opt/python-tools ${USERNAME} false false"
110-
run_script ruby "${USERNAME} false" "2.7.3"
111121
run_script rust "/opt/rust/cargo /opt/rust/rustup ${USERNAME} false"
112122
run_script terraform "0.15.0 0.12.1"
113123
run_script sshd "2223 ${USERNAME} true random"
@@ -132,7 +142,6 @@ if [ "${DISTRO}" = "debian" ]; then
132142
if [ "${architecture}" = "amd64" ] || [ "${architecture}" = "x86_64" ]; then
133143
run_script homebrew "${USERNAME} false true /home/${USERNAME}/linuxbrew"
134144
fi
135-
run_script dotnet "3.1 true ${USERNAME} false /opt/dotnet dotnet"
136145
fi
137146

138147
# TODO: Most of this script does not execute since 'docker-in-docker' is run above

0 commit comments

Comments
 (0)