Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use github hosted runners #196

Merged
merged 4 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/build-cross-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ jobs:
( matrix.host != matrix.target && inputs.kind == "cross" )

runs-on:
- self-hosted
- linux
- src-build
- ${{ matrix.host }}
- ${{ (contains(matrix.host, "x86_64") && "linux-x86_64") || "linux-arm64" }}

env:
RELENV_DATA: ${{ github.workspace }}
Expand All @@ -56,8 +53,9 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison python3-all patchelf swig
python3 -m pip install nox
sudo apt-get install -y build-essential bison python3-all patchelf swig python3-virtualenv
virtualenv venv
venv/bin/pip3 install nox

- name: Python Version
run: |
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/build-native-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ jobs:
name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}"

runs-on:
- self-hosted
- linux
- src-build
- ${{ matrix.host }}
- ${{ (contains(matrix.host, 'x86_64') && 'linux-x86_64') || 'linux-arm64' }}

env:
RELENV_DATA: ${{ github.workspace }}
Expand All @@ -46,13 +43,14 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison python3-all patchelf swig cmake libldap2-dev libsasl2-dev ldap-utils libssl-dev pkg-config libvirt-dev default-libmysqlclient-dev
python3 -m pip install nox
sudo apt-get install -y build-essential bison python3-all patchelf swig cmake libldap2-dev libsasl2-dev ldap-utils libssl-dev pkg-config libvirt-dev default-libmysqlclient-dev python3-virtualenv
virtualenv venv
venv/bin/pip3 install nox

- name: Python Version
run: |
python3 --version
python3 -c 'import os; print(os.name)'
venv/bin/python3 --version
venv/bin/python3 -c 'import os; print(os.name)'

- name: Download Toolchain Artifact
uses: actions/download-artifact@v4
Expand All @@ -67,12 +65,12 @@ jobs:

- name: Build
run: |
python3 -m relenv build --arch=${{ matrix.target }} --python=${{ matrix.version }}
venv/bin/python3 -m relenv build --arch=${{ matrix.target }} --python=${{ matrix.version }}

- name: Verify Build
if: ${{ matrix.host == matrix.target }}
run: |
python3 -m nox -e tests -- -s tests/test_verify_build.py
venv/bin/python3 -m nox -e tests -- -s tests/test_verify_build.py

- name: Linux Logs
uses: actions/upload-artifact@v4
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,27 @@ jobs:
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}

upload-build-artifacts:
name: Deploy Prebuilt Python Builds
if: ${{ inputs.kind == 'release' && success() }}
uses: ./.github/workflows/deploy-build-action.yml
needs:
- build-python-package
- build-native
- test-fips
#- build-cross
with:
version: "${{ needs.build-python-package.outputs.version }}"
#upload-build-artifacts:
# name: Deploy Prebuilt Python Builds
# if: ${{ inputs.kind == 'release' && success() }}
# uses: ./.github/workflows/deploy-build-action.yml
# needs:
# - build-python-package
# - build-native
# - test-fips
# #- build-cross
# with:
# version: "${{ needs.build-python-package.outputs.version }}"

upload-toolchain-artifacts:
name: Deploy Toolchain
if: ${{ inputs.kind == 'release' && success() }}
uses: ./.github/workflows/deploy-toolchain-action.yml
needs:
- build-python-package
- toolchain
with:
version: "${{ needs.build-python-package.outputs.version }}"
#upload-toolchain-artifacts:
# name: Deploy Toolchain
# if: ${{ inputs.kind == 'release' && success() }}
# uses: ./.github/workflows/deploy-toolchain-action.yml
# needs:
# - build-python-package
# - toolchain
# with:
# version: "${{ needs.build-python-package.outputs.version }}"

deploy-python-package:
name: Deploy Python Package
Expand All @@ -158,8 +158,8 @@ jobs:
- docs
- build-python-package
- test-fips
- upload-build-artifacts
- upload-toolchain-artifacts
# - upload-build-artifacts
# - upload-toolchain-artifacts

create-release:
name: Create Github Release
Expand All @@ -185,8 +185,8 @@ jobs:
#- build-cross
- test
- docs
- upload-build-artifacts
- upload-toolchain-artifacts
# - upload-build-artifacts
# - upload-toolchain-artifacts
- deploy-python-package
- create-release
steps:
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,84 @@ jobs:
release:
name: Create Github Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux-gnu
arch: x86_64
python: 3.10.15
- platform: linux-gnu
arch: x86_64
python: 3.11.10
- platform: linux-gnu
arch: x86_64
python: 3.12.7
- platform: linux-gnu
arch: x86_64
python: 3.13.0
- platform: linux-gnu
arch: aarch64
python: 3.10.15
- platform: linux-gnu
arch: aarch64
python: 3.11.10
- platform: linux-gnu
arch: aarch64
python: 3.12.7
- platform: linux-gnu
arch: aarch64
python: 3.13.0

- platform: win
arch: x86
python: 3.10.15
- platform: win
arch: x86
python: 3.11.10
- platform: win
arch: x86
python: 3.12.7
- platform: win
arch: x86
python: 3.13.0
- platform: win
arch: amd64
python: 3.10.15
- platform: win
arch: amd64
python: 3.11.10
- platform: win
arch: amd64
python: 3.12.7
- platform: win
arch: amd64
python: 3.13.0

- platform: macos
arch: x86_64
python: 3.10.15
- platform: macos
arch: x86_64
python: 3.11.10
- platform: macos
arch: x86_64
python: 3.12.7
- platform: macos
arch: x86_64
python: 3.13.0
- platform: macos
arch: arm64
python: 3.10.15
- platform: macos
arch: arm64
python: 3.11.10
- platform: macos
arch: arm64
python: 3.12.7
- platform: macos
arch: arm64
python: 3.13.0

steps:
- name: Download Python Build Artifacts
uses: actions/download-artifact@v4
Expand All @@ -24,6 +102,12 @@ jobs:
name: Python Wheel
path: dist

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
path: release-artifacts/

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down Expand Up @@ -58,3 +142,11 @@ jobs:
asset_path: dist/relenv-${{ inputs.version }}-py3-none-any.whl
asset_name: relenv-${{ inputs.version }}-py3-none-any.whl
asset_content_type: application/zip

- name: Upload Release artifacts
id: upload-python-build-assets
uses: actions/upload-release-asset@v1
with:
name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
path: release-artifacts/
asset_content_type: application/tar+xz
5 changes: 1 addition & 4 deletions .github/workflows/toolchain-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ jobs:
name: "Toolchain ${{ matrix.target }} on ${{ matrix.host }}"

runs-on:
- self-hosted
- linux
- src-build
- ${{ matrix.host }}
- ${{ (contains(matrix.host, 'x86_64') && 'linux-x86_64') || 'linux-arm64' }}

#if: fromJSON(inputs.changed-files)['toolchain'] == 'true'

Expand Down
8 changes: 6 additions & 2 deletions relenv/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import time

# relenv package version
__version__ = "0.17.4"
__version__ = "0.17.40000000"

MODULE_DIR = pathlib.Path(__file__).resolve().parent

Expand All @@ -28,7 +28,11 @@

MACOS_DEVELOPMENT_TARGET = "10.15"

CHECK_HOSTS = ("repo.saltproject.io", "woz.io")
CHECK_HOSTS = (
"packages.broadcom.com/artifactory/saltproject-generic",
"repo.saltproject.io",
"woz.io",
)

arches = {
LINUX: (
Expand Down
7 changes: 6 additions & 1 deletion relenv/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
TC_URL = "https://{hostname}/relenv/{version}/toolchain/{host}/{triplet}.tar.xz"
CICD = "CI" in os.environ

LAST_RELENV_W_TOOLCHAIN = "0.17.4"


def setup_parser(subparsers):
"""
Expand Down Expand Up @@ -91,7 +93,10 @@ def fetch(arch, toolchain, clean=False, version=__version__):
check_hosts = [os.environ["RELENV_FETCH_HOST"]]
for host in check_hosts:
url = TC_URL.format(
hostname=host, version=version, host=platform.machine(), triplet=triplet
hostname=host,
version=LAST_RELENV_W_TOOLCHAIN,
host=platform.machine(),
triplet=triplet,
)
if check_url(url, timeout=5):
break
Expand Down
Loading