From cb24095c01cd19d4b848a0c4fc443c6458de9f81 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 3 Dec 2024 16:21:49 -0800 Subject: [PATCH 1/4] Add a fedora 40 helix image --- src/fedora/40/helix/Dockerfile | 70 ++++++++++++++++++++++++++++++++++ src/fedora/manifest.json | 12 ++++++ 2 files changed, 82 insertions(+) create mode 100644 src/fedora/40/helix/Dockerfile diff --git a/src/fedora/40/helix/Dockerfile b/src/fedora/40/helix/Dockerfile new file mode 100644 index 00000000..52043da9 --- /dev/null +++ b/src/fedora/40/helix/Dockerfile @@ -0,0 +1,70 @@ +FROM library/fedora:40 AS venv + +RUN dnf upgrade --refresh -y && \ + dnf install --setopt tsflags=nodocs -y \ + dnf-plugins-core && \ + dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ + openssl \ + python3-devel \ + python3-pip \ + gcc \ + libatomic \ + redhat-rpm-config && \ + dnf clean all + +RUN python3 -m venv /venv && \ + source /venv/bin/activate && \ + pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ + pip install ./helix_scripts-*-py3-none-any.whl + +FROM library/fedora:40 + +# Install Helix Dependencies + +RUN dnf upgrade --refresh -y \ + && dnf install --setopt tsflags=nodocs -y \ + dnf-plugins-core \ + && dnf config-manager --add-repo=https://packages.microsoft.com/fedora/40/prod/config.repo \ + && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ + # Helix dependencies + python3 \ + python3-pip \ + # Tools used by build automation + azure-cli \ + git \ + jq \ + tar \ + redhat-rpm-config \ + procps \ + zip \ + # Runtime dependencies + curl \ + icu \ + iputils \ + krb5-libs \ + libatomic \ + libmsquic \ + libunwind \ + lttng-ust \ + openssl \ + sudo && \ + dnf clean all + +# Needed for .NET libraries tests to pass +ENV LANG=en-US.UTF-8 + +# create helixbot user and give rights to sudo without password +# Fedora does not have all options as other Linux systems +RUN /usr/sbin/adduser --uid 1000 --shell /bin/bash --group adm helixbot && \ + chmod 755 /root && \ + echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \ + chmod +s /usr/bin/ping + +USER helixbot + +# Install Helix Dependencies + +ENV VIRTUAL_ENV=/home/helixbot/.vsts-env +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +COPY --from=venv /venv $VIRTUAL_ENV diff --git a/src/fedora/manifest.json b/src/fedora/manifest.json index 9c34f40f..2ee374c3 100644 --- a/src/fedora/manifest.json +++ b/src/fedora/manifest.json @@ -15,6 +15,18 @@ } ] }, + { + "platforms": [ + { + "dockerfile": "src/fedora/40/helix", + "os": "linux", + "osVersion": "fedora40", + "tags": { + "fedora-40-helix": {} + } + } + ] + }, { "platforms": [ { From f3773732baece3806a29f846d937a8e4fc05f3f1 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 4 Dec 2024 12:54:04 -0800 Subject: [PATCH 2/4] Provide a Fedora 41 image instead of a Fedora 40 image --- src/fedora/{40 => 41}/helix/Dockerfile | 14 +++++++++----- src/fedora/manifest.json | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) rename src/fedora/{40 => 41}/helix/Dockerfile (82%) diff --git a/src/fedora/40/helix/Dockerfile b/src/fedora/41/helix/Dockerfile similarity index 82% rename from src/fedora/40/helix/Dockerfile rename to src/fedora/41/helix/Dockerfile index 52043da9..340d87b6 100644 --- a/src/fedora/40/helix/Dockerfile +++ b/src/fedora/41/helix/Dockerfile @@ -1,4 +1,4 @@ -FROM library/fedora:40 AS venv +FROM library/fedora:41 AS venv RUN dnf upgrade --refresh -y && \ dnf install --setopt tsflags=nodocs -y \ @@ -17,14 +17,13 @@ RUN python3 -m venv /venv && \ pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ pip install ./helix_scripts-*-py3-none-any.whl -FROM library/fedora:40 +FROM library/fedora:41 -# Install Helix Dependencies +# Install Dependencies RUN dnf upgrade --refresh -y \ && dnf install --setopt tsflags=nodocs -y \ dnf-plugins-core \ - && dnf config-manager --add-repo=https://packages.microsoft.com/fedora/40/prod/config.repo \ && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ # Helix dependencies python3 \ @@ -43,13 +42,18 @@ RUN dnf upgrade --refresh -y \ iputils \ krb5-libs \ libatomic \ - libmsquic \ libunwind \ lttng-ust \ openssl \ sudo && \ dnf clean all +# Install MSQuic. Fedora 41 does not have it in the repositories, so use the Fedora 40 package + +RUN dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/fedora/40/prod/config.repo && \ + dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ + libmsquic + # Needed for .NET libraries tests to pass ENV LANG=en-US.UTF-8 diff --git a/src/fedora/manifest.json b/src/fedora/manifest.json index 2ee374c3..1b10d01a 100644 --- a/src/fedora/manifest.json +++ b/src/fedora/manifest.json @@ -18,11 +18,11 @@ { "platforms": [ { - "dockerfile": "src/fedora/40/helix", + "dockerfile": "src/fedora/41/amd64", "os": "linux", - "osVersion": "fedora40", + "osVersion": "fedora41", "tags": { - "fedora-40-helix": {} + "fedora-41": {} } } ] @@ -30,11 +30,11 @@ { "platforms": [ { - "dockerfile": "src/fedora/41/amd64", + "dockerfile": "src/fedora/41/helix", "os": "linux", "osVersion": "fedora41", "tags": { - "fedora-41": {} + "fedora-41-helix": {} } } ] From 6db2dbd3d1ca06b496dbfdc861ee80b33120ffdd Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 4 Dec 2024 15:47:27 -0800 Subject: [PATCH 3/4] Update src/fedora/41/helix/Dockerfile Co-authored-by: Matt Thalman --- src/fedora/41/helix/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fedora/41/helix/Dockerfile b/src/fedora/41/helix/Dockerfile index 340d87b6..06ff81a9 100644 --- a/src/fedora/41/helix/Dockerfile +++ b/src/fedora/41/helix/Dockerfile @@ -1,16 +1,16 @@ FROM library/fedora:41 AS venv -RUN dnf upgrade --refresh -y && \ - dnf install --setopt tsflags=nodocs -y \ - dnf-plugins-core && \ - dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ +RUN dnf upgrade --refresh -y \ + && dnf install --setopt tsflags=nodocs -y \ + dnf-plugins-core \ + && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ openssl \ python3-devel \ python3-pip \ gcc \ libatomic \ - redhat-rpm-config && \ - dnf clean all + redhat-rpm-config \ + && dnf clean all RUN python3 -m venv /venv && \ source /venv/bin/activate && \ From 854e900f6e7ba9fdd0167702403a9f1b485d7f58 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 4 Dec 2024 15:48:52 -0800 Subject: [PATCH 4/4] Fix style --- src/fedora/41/helix/Dockerfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/fedora/41/helix/Dockerfile b/src/fedora/41/helix/Dockerfile index 06ff81a9..17a2afa3 100644 --- a/src/fedora/41/helix/Dockerfile +++ b/src/fedora/41/helix/Dockerfile @@ -12,10 +12,11 @@ RUN dnf upgrade --refresh -y \ redhat-rpm-config \ && dnf clean all -RUN python3 -m venv /venv && \ - source /venv/bin/activate && \ - pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple && \ - pip install ./helix_scripts-*-py3-none-any.whl +RUN python3 -m venv /venv \ + && source /venv/bin/activate \ + pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ + && pip download --no-deps helix-scripts --index-url https://dnceng.pkgs.visualstudio.com/public/_packaging/helix-client-prod/pypi/simple \ + && pip install ./helix_scripts-*-py3-none-any.whl FROM library/fedora:41 @@ -45,13 +46,13 @@ RUN dnf upgrade --refresh -y \ libunwind \ lttng-ust \ openssl \ - sudo && \ - dnf clean all + sudo \ + && dnf clean all # Install MSQuic. Fedora 41 does not have it in the repositories, so use the Fedora 40 package -RUN dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/fedora/40/prod/config.repo && \ - dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ +RUN dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/fedora/40/prod/config.repo \ + && dnf install --setopt=install_weak_deps=False --setopt tsflags=nodocs -y \ libmsquic # Needed for .NET libraries tests to pass @@ -59,10 +60,10 @@ ENV LANG=en-US.UTF-8 # create helixbot user and give rights to sudo without password # Fedora does not have all options as other Linux systems -RUN /usr/sbin/adduser --uid 1000 --shell /bin/bash --group adm helixbot && \ - chmod 755 /root && \ - echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \ - chmod +s /usr/bin/ping +RUN /usr/sbin/adduser --uid 1000 --shell /bin/bash --group adm helixbot \ + && chmod 755 /root \ + && echo "helixbot ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers \ + && chmod +s /usr/bin/ping USER helixbot