diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-02-03 15:58:33 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-03 15:58:33 +0000 |
| commit | d1fb3796b96ff6ba312fac4686770b4d992886d3 (patch) | |
| tree | 63c72dd9fbdf3851331361e2b9a757fc8d8c850f | |
| parent | 2c2e8a395073ba6750e76b9a7d04d0d59cff463a (diff) | |
| parent | 944e914430653f55102845dd775597411a24a3d3 (diff) | |
| download | vyos-build-d1fb3796b96ff6ba312fac4686770b4d992886d3.tar.gz vyos-build-d1fb3796b96ff6ba312fac4686770b4d992886d3.zip | |
Merge pull request #1112 from asklymenko/current
T8219: Start building Salt from source
| -rw-r--r-- | .github/workflows/trigger_rebuild_packages.yml | 6 | ||||
| -rw-r--r-- | data/architectures/amd64.toml | 5 | ||||
| -rw-r--r-- | data/architectures/arm64.toml | 5 | ||||
| -rw-r--r-- | scripts/package-build/salt/.gitignore | 1 | ||||
| l--------- | scripts/package-build/salt/build.py | 1 | ||||
| -rw-r--r-- | scripts/package-build/salt/build.sh | 76 | ||||
| -rw-r--r-- | scripts/package-build/salt/package.toml | 25 |
7 files changed, 109 insertions, 10 deletions
diff --git a/.github/workflows/trigger_rebuild_packages.yml b/.github/workflows/trigger_rebuild_packages.yml index 0c390b32..f184c1da 100644 --- a/.github/workflows/trigger_rebuild_packages.yml +++ b/.github/workflows/trigger_rebuild_packages.yml @@ -80,6 +80,8 @@ jobs: - 'scripts/package-build/pyhumps/**' radvd: - 'scripts/package-build/radvd/**' + salt: + - 'scripts/package-build/salt/**' strongswan: - 'scripts/package-build/strongswan/**' tacacs: @@ -229,6 +231,10 @@ jobs: trigger_build "radvd" fi + if [ "${{ steps.changes.outputs.salt }}" == "true" ]; then + trigger_build "salt" + fi + if [ "${{ steps.changes.outputs.strongswan }}" == "true" ]; then trigger_build "strongswan" fi diff --git a/data/architectures/amd64.toml b/data/architectures/amd64.toml index acebec1c..aeea8ffe 100644 --- a/data/architectures/amd64.toml +++ b/data/architectures/amd64.toml @@ -11,8 +11,3 @@ packages = [ "intel-microcode", "amd64-microcode" ] - -[additional_repositories.salt] - architecture = "amd64" - url = "https://packages.vyos.net/saltproject/debian/11/amd64/3005" - distribution = "bullseye" diff --git a/data/architectures/arm64.toml b/data/architectures/arm64.toml index 36b2fe07..07de5225 100644 --- a/data/architectures/arm64.toml +++ b/data/architectures/arm64.toml @@ -4,8 +4,3 @@ packages = [ ] bootloaders = "grub-efi" squashfs_compression_type = "xz -b 256k -always-use-fragments -no-recovery" - -[additional_repositories.salt] - architecture = "arm64" - url = "https://packages.vyos.net/saltproject/debian/11/arm64/3005" - distribution = "bullseye" diff --git a/scripts/package-build/salt/.gitignore b/scripts/package-build/salt/.gitignore new file mode 100644 index 00000000..5c783a52 --- /dev/null +++ b/scripts/package-build/salt/.gitignore @@ -0,0 +1 @@ +/salt/ diff --git a/scripts/package-build/salt/build.py b/scripts/package-build/salt/build.py new file mode 120000 index 00000000..3c76af73 --- /dev/null +++ b/scripts/package-build/salt/build.py @@ -0,0 +1 @@ +../build.py
\ No newline at end of file diff --git a/scripts/package-build/salt/build.sh b/scripts/package-build/salt/build.sh new file mode 100644 index 00000000..b99b9d93 --- /dev/null +++ b/scripts/package-build/salt/build.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +# ============================================================================== +# Script to build Salt (Onedir) for VyOS +# ============================================================================== + +# Exit immediately on error +set -e + +# Configuration +ARCH=$(dpkg --print-architecture) + +# Uncomment SALT_REPO and ALT_VERSION variable to build Salt manually +#SALT_REPO="https://github.com/saltstack/salt.git" +#SALT_VERSION="v3006.19" +TOOLS_REPO="https://github.com/saltstack/python-tools-scripts" + +# Check this page to find a correct relenv/python combination. +# https://github.com/saltstack/relenv/releases +RELENV_VERSION="0.22.2" +RELENV_PYTHON_VERSION="3.11.14" + +# Specify the platform parameter, use x86_64 for amd64, arm64 for arm64 +if [ "${ARCH}" = "arm64" ]; then + BUILD_ARCH=${ARCH} +else + BUILD_ARCH="x86_64" +fi + +# Specify the Python version currently used by VyOS. This version will be used to specify the correct requirements list, +# for example: requirements/static/pkg/py3.11/tools.tx +PYTHON_VERSION="3.11" + +BUILD_DIR="salt" +OUTPUT_DIR="$BUILD_DIR/artifacts" + +# Prepare Build Directory +mkdir -p "$BUILD_DIR" +cd "$BUILD_DIR" + +if [ ! -d "python-tools-scripts" ]; then + git clone ${TOOLS_REPO} +fi + +# Setup Python Build Environment +echo "Setting up build virtual environment..." +if [ ! -d "venv-build" ]; then + python3 -m venv venv-build +fi + +# Install Python build requirements +echo "Installing Python build requirements..." +venv-build/bin/python3 -m pip install --upgrade pip + +# Install all required build tools +venv-build/bin/python3 -m pip install relenv build packaging jinja2 pyyaml msgpack-python python-tools-scripts ppbt setuptools tornado + +# Install repo-specific tools if found +if [ -f "requirements/static/pkg/py${PYTHON_VERSION}/tools.txt" ]; then + venv-build/bin/python3 -m pip install -r requirements/static/pkg/py${PYTHON_VERSION}/tools.txt +fi + +# Build the package +echo "Starting Build..." +export PYTHONPATH=$PYTHONPATH:$(pwd) + +# The build script below handles fetching the correct runtime version. +venv-build/bin/python3 -m tools.pkg.build deb + +# Example: tools pkg build deb --relenv-version=0.22.2 --python-version=3.10.19 --arch=x86_64 +venv-build/bin/tools pkg build deb --relenv-version=${RELENV_VERSION} --python-version=${RELENV_PYTHON_VERSION} --arch=${BUILD_ARCH} + +echo "List artifacts..." +find ../ -name "*.deb" + +echo "Build finished successfully" diff --git a/scripts/package-build/salt/package.toml b/scripts/package-build/salt/package.toml new file mode 100644 index 00000000..24bada78 --- /dev/null +++ b/scripts/package-build/salt/package.toml @@ -0,0 +1,25 @@ +[[packages]] +name = "salt" +commit_id = "v3006.19" +scm_url = "https://github.com/saltstack/salt.git" +build_cmd = "cd ..; ./build.sh" + +[dependencies] +packages = [ + "libssl-dev", + "libffi-dev", + "python3-dev", + "python3-pip", + "python3-venv", + "patchelf", + "fakeroot", + "dpkg-dev", + "cargo", + "dh-make", + "libgdbm-dev", + "liblzma-dev", + "libzmq3-dev", + "patchelf", + "pkg-config", + "python3-venv" +] |
