-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84c6a5a
commit b064b0f
Showing
8 changed files
with
168 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: ci-py-313-osx | ||
type: homebrew | ||
base: https://github.com/Homebrew/brew/archive/refs/tags/4.3.5.tar.gz | ||
force_dirty: | ||
- orion-decision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
set -e -x -o pipefail | ||
|
||
retry () { i=0; while [[ "$i" -lt 9 ]]; do if "$@"; then return; else sleep 30; fi; i="${i+1}"; done; "$@"; } | ||
retry-curl () { curl -sSL --connect-timeout 25 --fail --retry 5 -w "%{stderr}[downloaded %{url_effective}]\n" "$@"; } | ||
|
||
PYTHON_VERSION=3.13.1 | ||
STANDALONE_RELEASE=20250115 | ||
PYTHON_URL="https://github.com/astral-sh/python-build-standalone/releases/download/${STANDALONE_RELEASE}/cpython-${PYTHON_VERSION}+${STANDALONE_RELEASE}-x86_64-apple-darwin-install_only_stripped.tar.gz" | ||
|
||
mkdir -p "$HOMEBREW_PREFIX/opt" | ||
retry-curl "$PYTHON_URL" | tar -C "$HOMEBREW_PREFIX/opt" -xvz | ||
rm -rf "$HOMEBREW_PREFIX"/opt/python/lib/tcl* "$HOMEBREW_PREFIX"/opt/python/lib/tk* "$HOMEBREW_PREFIX"/opt/python/share | ||
|
||
# shellcheck disable=SC2016 | ||
sed -i '' 's,export PATH=\\",&${HOMEBREW_PREFIX}/opt/python/bin:,' homebrew/Library/Homebrew/cmd/shellenv.sh | ||
PATH="$HOMEBREW_PREFIX/opt/python/bin:$PATH" | ||
|
||
# configure pip | ||
mkdir -p pip | ||
cat << EOF > pip/pip.ini | ||
[global] | ||
disable-pip-version-check = true | ||
no-cache-dir = false | ||
[list] | ||
format = columns | ||
[install] | ||
upgrade-strategy = only-if-needed | ||
progress-bar = off | ||
EOF | ||
export PIP_CONFIG_FILE="$PWD/pip/pip.ini" | ||
|
||
# install utils to match linux ci images | ||
retry python -m pip install tox | ||
retry python -m pip install poetry | ||
retry python -m pip install pre-commit | ||
retry-curl https://uploader.codecov.io/latest/macos/codecov -o homebrew/bin/codecov | ||
chmod +x homebrew/bin/codecov | ||
|
||
mkdir -p .ssh | ||
retry ssh-keyscan github.com > .ssh/known_hosts | ||
|
||
rm -rf homebrew/docs | ||
cp -r orion/services/orion-decision orion-decision | ||
cp orion/scripts/relocate_homebrew homebrew/bin/ | ||
python -m pip install ./orion-decision | ||
relocate_homebrew | ||
tar -jcvf homebrew.tar.bz2 homebrew pip .ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: ci-py-313-win | ||
type: msys | ||
base: https://github.com/msys2/msys2-installer/releases/download/2023-10-26/msys2-base-x86_64-20231026.tar.xz | ||
force_dirty: | ||
- orion-decision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env bash | ||
set -e -x -o pipefail | ||
|
||
retry () { i=0; while [[ "$i" -lt 9 ]]; do if "$@"; then return; else sleep 30; fi; i="$((i+1))"; done; "$@"; } | ||
retry-curl () { curl -sSL --connect-timeout 25 --fail --retry 5 -w "%{stderr}[downloaded %{url_effective}]\n" "$@"; } | ||
|
||
# base msys packages | ||
retry pacman --noconfirm -Sy \ | ||
mingw-w64-x86_64-curl \ | ||
patch \ | ||
psmisc \ | ||
tar | ||
pacman --noconfirm -Scc | ||
killall -TERM gpg-agent || true | ||
pacman --noconfirm -Rs psmisc | ||
|
||
# get nuget | ||
retry-curl "https://aka.ms/nugetclidl" -o msys64/usr/bin/nuget.exe | ||
|
||
# get python | ||
VER=3.13.1 | ||
retry nuget install python -ExcludeVersion -OutputDirectory . -Version "$VER" | ||
rm -rf msys64/opt/python | ||
mkdir -p msys64/opt | ||
mv python/tools msys64/opt/python | ||
rm -rf python | ||
PATH="$PWD/msys64/opt/python:$PWD/msys64/opt/python/Scripts:$PATH" | ||
which python | ||
python -V | ||
|
||
# patch pip to workaround https://github.com/pypa/pip/issues/4368 | ||
sed -i "s/^\\( \\)maker = PipScriptMaker(.*/&\r\n\\1maker.executable = '\\/usr\\/bin\\/env python'/" \ | ||
msys64/opt/python/Lib/site-packages/pip/_internal/operations/install/wheel.py | ||
|
||
# configure pip | ||
mkdir -p pip | ||
cat << EOF > pip/pip.ini | ||
[global] | ||
disable-pip-version-check = true | ||
no-cache-dir = false | ||
[list] | ||
format = columns | ||
[install] | ||
upgrade-strategy = only-if-needed | ||
progress-bar = off | ||
EOF | ||
|
||
# force-upgrade pip to include the above patch | ||
# have to use `python -m pip` until PATH is updated externally | ||
# otherwise /usr/bin/env will select the old `pip` in mozbuild | ||
retry python -m pip install --upgrade --force-reinstall pip | ||
|
||
# patch new pip to workaround https://github.com/pypa/pip/issues/4368 | ||
sed -i "s/^\\( \\)maker = PipScriptMaker(.*/&\r\n\\1maker.executable = '\\/usr\\/bin\\/env python'/" \ | ||
msys64/opt/python/Lib/site-packages/pip/_internal/operations/install/wheel.py | ||
|
||
# install utils to match linux ci images | ||
retry python -m pip install tox | ||
retry python -m pip install pre-commit | ||
retry-curl https://uploader.codecov.io/latest/windows/codecov.exe -o msys64/usr/bin/codecov.exe | ||
|
||
mkdir -p .ssh | ||
retry ssh-keyscan github.com > .ssh/known_hosts | ||
|
||
rm -rf \ | ||
msys64/mingw64/share/doc/ \ | ||
msys64/mingw64/share/info/ \ | ||
msys64/mingw64/share/man/ \ | ||
msys64/usr/share/doc/ \ | ||
msys64/usr/share/info/ \ | ||
msys64/usr/share/man/ | ||
cp -r orion/services/orion-decision orion-decision | ||
retry python -m pip install ./orion-decision | ||
# Delete symlinks | ||
find msys64 -type l -delete | ||
tar -jcvf msys2.tar.bz2 --hard-dereference msys64 pip .ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
FROM python:3.13-slim | ||
|
||
LABEL maintainer Jesse Schwartzentruber <[email protected]> | ||
|
||
COPY base/linux/etc/pip.conf /etc/pip.conf | ||
COPY recipes/linux /src/recipes | ||
COPY services/ci-py-common/setup-linux.sh /src/recipes/setup.sh | ||
COPY services/orion-decision /src/orion-decision | ||
|
||
RUN /src/recipes/setup.sh | ||
|
||
USER worker | ||
WORKDIR /home/worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: ci-py-313 | ||
force_dirty: | ||
- orion-decision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters