Skip to content

Update bootstrap buildcache for SC release #71

Update bootstrap buildcache for SC release

Update bootstrap buildcache for SC release #71

Workflow file for this run

name: clingo
on:
push:
branches:
- main
tags:
- v0.**
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: clingo-${{ github.ref }}
cancel-in-progress: true
jobs:
macos_clingo_x86_64:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Prepare Spack
run: |
pip install --upgrade pip
brew install bison
export PATH="/usr/local/opt/bison/bin:$PATH"
git clone https://github.com/spack/spack.git spack-src
cd spack-src && git checkout -b docker-reference 08da9a854a53542e1f71d30ed8d14d6b7d18119f
if [ ${{ matrix.python-version }} = "3.12" ] ; then
# distutils -> setuptools patch
wget -q -O - https://github.com/spack/spack/commit/1452e927719ddbbf07118e88f9fd8d18fabf0fae.patch | git apply -v
fi
cd ..
. spack-src/share/spack/setup-env.sh
spack external find --not-buildable cmake bison
spack config add "config:install_tree:padded_length:256"
- name: Install clingo
run: |
. spack-src/share/spack/setup-env.sh
spack python clingo/scripts/install_clingo.py
mkdir -p binary-mirror
spack buildcache push --unsigned --force $PWD/binary-mirror clingo-bootstrap
- uses: actions/upload-artifact@v3
with:
name: clingo_binary_mirror
path: binary-mirror
macos_clingo_aarch64:
runs-on: ["self-hosted", "macOS", "ARM64"]
strategy:
matrix:
python-version: ["3.6.15", "3.7.14", "3.8.14", "3.9.14", "3.10.7", "3.11.5", "3.12.0"]
steps:
- uses: actions/checkout@v3
- name: Prepare Spack
env:
PYENV_VERSION: ${{ matrix.python-version }}
run: |
export PATH=/Users/spack-bootstrap-runner/homebrew/bin:/Users/spack-bootstrap-runner/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export PATH="$(pyenv prefix)/bin:$PATH"
python --version
brew install cmake bison
export PATH="/Users/spack-bootstrap-runner/homebrew/opt/bison/bin:$PATH"
pyenv exec pip install --upgrade pip
git clone https://github.com/spack/spack.git spack-src
cd spack-src && git checkout -b docker-reference 08da9a854a53542e1f71d30ed8d14d6b7d18119f
if [ ${{ matrix.python-version }} = "3.12.0" ] ; then
# distutils -> setuptools patch
wget -q -O - https://github.com/spack/spack/commit/1452e927719ddbbf07118e88f9fd8d18fabf0fae.patch | git apply -v
fi
cd ..
. spack-src/share/spack/setup-env.sh
spack external find --not-buildable cmake bison
spack config add "config:install_tree:padded_length:256"
- name: Install clingo
env:
PYENV_VERSION: ${{ matrix.python-version }}
run: |
export PATH=/Users/spack-bootstrap-runner/homebrew/bin:/Users/spack-bootstrap-runner/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export PATH="$(pyenv prefix)/bin:$PATH"
python --version
. spack-src/share/spack/setup-env.sh
spack python clingo/scripts/install_clingo.py
mkdir -p binary-mirror
spack buildcache push --unsigned --force $PWD/binary-mirror clingo-bootstrap
- uses: actions/upload-artifact@v3
with:
name: clingo_binary_mirror
path: binary-mirror
manylinux2014:
runs-on: ["self-hosted", "Linux"]
outputs:
spack_manylinux_tag: ${{ fromJSON(steps.docker_meta.outputs.json).tags[0] }}
permissions:
packages: write
steps:
- uses: actions/checkout@v3
# Setup tags to be used for docker images
- uses: docker/metadata-action@v4
id: docker_meta
with:
images: ghcr.io/${{ github.repository_owner }}/clingo_manylinux2014
# Login to Github Packages
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v2
id: qemu
with:
platforms: linux/ppc64le,linux/arm64
- uses: docker/setup-buildx-action@v2
# Build and eventually push to registry
- uses: docker/build-push-action@v3
with:
file: ./clingo/Dockerfile.manylinux2014
platforms: linux/arm64,linux/ppc64le,linux/amd64
cache-from: |
${{ steps.docker_meta.outputs.tags }}
cache-to: type=inline
pull: ${{ github.event_name == 'pull_request' }}
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
upload-manylinux2014:
runs-on: ubuntu-latest
needs: [ manylinux2014 ]
env:
SPACK_MANYLINUX2014_TAG: ${{ needs.manylinux2014.outputs.spack_manylinux_tag }}
steps:
- uses: actions/checkout@v3
- run: |
. ./clingo/scripts/copy_mirror_manylinux2014.sh
- uses: actions/upload-artifact@v3
with:
name: clingo_binary_mirror
path: |
binary-mirror
clingo_json:
runs-on: ubuntu-latest
needs: [ upload-manylinux2014, macos_clingo_x86_64, macos_clingo_aarch64 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/download-artifact@v3
with:
name: clingo_binary_mirror
- run: |
pip install ruamel.yaml
python clingo/scripts/clingo_json.py
- uses: actions/upload-artifact@v3
with:
name: clingo_manifest
path: |
clingo.json