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

Enable scorecard #674

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b15aeaf
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 18, 2024
65c8853
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 19, 2024
ebeb417
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 19, 2024
d664fd2
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 21, 2024
87ed3ff
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 22, 2024
1630300
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 25, 2024
ed322c4
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Mar 27, 2024
594f386
Merge branch 'master' of https://github.com/PennyLaneAI/pennylane-lig…
AmintorDusko Apr 1, 2024
ea6ed80
update version
AmintorDusko Apr 1, 2024
06abba6
update gcc and containers for linux_x86_64
AmintorDusko Apr 1, 2024
8883384
trigger CIs
AmintorDusko Apr 1, 2024
10c8c06
test Engine
AmintorDusko Apr 1, 2024
ed1a904
try removing podman
AmintorDusko Apr 1, 2024
2c8c39a
try alternative path for docker
AmintorDusko Apr 1, 2024
f53daa3
y
AmintorDusko Apr 1, 2024
794a8e1
priviledged container
AmintorDusko Apr 3, 2024
60f1028
aarch64
AmintorDusko Apr 3, 2024
8b2946e
build wheels
AmintorDusko Apr 3, 2024
d464460
dnf->yum
AmintorDusko Apr 3, 2024
8fc7f1a
install dependencies (apt)
AmintorDusko Apr 4, 2024
ad8bbe4
update container
AmintorDusko Apr 4, 2024
82b2e99
update and build ppc64le wheels
AmintorDusko Apr 4, 2024
55c42dc
update and build x86_64_cuda wheels
AmintorDusko Apr 4, 2024
7a15bdb
update config-manager
AmintorDusko Apr 4, 2024
bf62045
Merge branch 'master' into update/linux_wheels_manylinux_2_28
AmintorDusko Apr 4, 2024
9d19ab1
Merge branch 'update/linux_wheels_manylinux_2_28' of https://github.c…
AmintorDusko Apr 4, 2024
526f21f
add install dnf-utils
AmintorDusko Apr 4, 2024
c974b79
Auto update version
github-actions[bot] Apr 4, 2024
1a4d8f4
update dev version
AmintorDusko Apr 4, 2024
84dfb48
Merge branch 'update/linux_wheels_manylinux_2_28' of https://github.c…
AmintorDusko Apr 4, 2024
95e2d90
move dnf-utils
AmintorDusko Apr 4, 2024
4d02d84
set cuda repository to AlmaLinux
AmintorDusko Apr 4, 2024
4322b31
make gcc 12
AmintorDusko Apr 4, 2024
1c125d0
Merge branch 'master' into update/linux_wheels_manylinux_2_28
AmintorDusko Apr 8, 2024
bb647c7
Auto update version
github-actions[bot] Apr 8, 2024
ecec364
trigger ci
maliasadi Apr 8, 2024
02f35e1
Add Scorecard action
mlxd Apr 9, 2024
9cf35be
Auto update version
github-actions[bot] Apr 9, 2024
7451a1c
Trigger CI
mlxd Apr 9, 2024
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
56 changes: 56 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Uses https://github.com/ossf/scorecard-action
name: Scorecard
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '29 7 * * 5'
push:
branches:
- master
pull_request:

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
sarif_file: results.sarif
7 changes: 4 additions & 3 deletions .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Wheel::Linux::ARM
# **Who does it impact**: Wheels to be uploaded to PyPI.

on:
pull_request:
push:
branches:
- master
Expand All @@ -31,7 +32,7 @@ jobs:
arch: [aarch64]
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_aarch64"]
container_img: ["quay.io/pypa/manylinux_2_28_aarch64"]
timeout-minutes: 45
name: Kokkos core (${{ matrix.exec_model }}::${{ matrix.arch }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_aarch64"]
container_img: ["quay.io/pypa/manylinux_2_28_aarch64"]
timeout-minutes: 45
name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11", "cp312-*":"3.12" }')[matrix.cibw_build] }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -135,7 +136,7 @@ jobs:
CIBW_ENVIRONMENT: |
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/wheel_linux_ppc64le.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Wheel::Linux::PowerPC
# **Who does it impact**: Wheels to be uploaded to PyPI.

on:
pull_request:
push:
branches:
- master
Expand All @@ -31,7 +32,7 @@ jobs:
arch: [ppc64le]
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_ppc64le"]
container_img: ["quay.io/pypa/manylinux_2_28_ppc64le"]
timeout-minutes: 45
name: Kokkos core (${{ matrix.exec_model }}::${{ matrix.arch }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
cibw_build: ${{fromJson(needs.set_wheel_build_matrix.outputs.python_version)}}
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_ppc64le"]
container_img: ["quay.io/pypa/manylinux_2_28_ppc64le"]
timeout-minutes: 45
name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{"cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11", "cp312-*":"3.12"}')[matrix.cibw_build] }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -134,7 +135,7 @@ jobs:
CIBW_ENVIRONMENT: |
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux2014
CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

Expand Down
45 changes: 24 additions & 21 deletions .github/workflows/wheel_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Wheel::Linux::x86_64
# **Who does it impact**: Wheels to be uploaded to PyPI.

env:
GCC_VERSION: 11
GCC_VERSION: 13

on:
pull_request:
Expand Down Expand Up @@ -35,11 +35,12 @@ jobs:
os: [ubuntu-latest]
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_x86_64"]
container_img: ["quay.io/pypa/manylinux_2_28_x86_64"]
timeout-minutes: 30
name: Kokkos core (${{ matrix.exec_model }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container_img }}
container:
image: ${{ matrix.container_img }}

steps:
- name: Cache installation directories
Expand All @@ -53,12 +54,12 @@ jobs:
if: ${{ (matrix.container_img == 'ubuntu-latest') && (steps.kokkos-cache.outputs.cache-hit != 'true') }}
run: |
apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git
echo "COMPILER=g++-11" >> $GITHUB_ENV
echo "COMPILER=g++-13" >> $GITHUB_ENV

- name: Install dependencies (CentOS)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux2014_x86_64') && (steps.kokkos-cache.outputs.cache-hit != 'true') }}
- name: Install dependencies (AlmaLinux)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux_2_28_x86_64') && (steps.kokkos-cache.outputs.cache-hit != 'true') }}
run: |
yum update -y && yum install -y cmake ninja-build
dnf update -y && dnf install -y cmake ninja-build
echo "COMPILER=g++" >> $GITHUB_ENV

- name: Clone Kokkos libs
Expand Down Expand Up @@ -96,11 +97,13 @@ jobs:
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_x86_64"]
container_img: ["quay.io/pypa/manylinux_2_28_x86_64"]
timeout-minutes: 30
name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11","cp312-*":"3.12" }')[matrix.cibw_build] }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container_img }}
container:
image: ${{ matrix.container_img }}
options: --privileged

steps:
- name: Restoring cached dependencies
Expand All @@ -119,18 +122,18 @@ jobs:
mkdir Kokkos
cp -rf /root/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/

- name: Install dependencies (CentOS)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux2014_x86_64') }}
- name: Install dependencies (AlmaLinux)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux_2_28_x86_64') }}
run: |
# Reduce wait time for repos not responding
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
yum update -y && yum install -y docker
dnf update -y && dnf install -y podman

- name: Install cibuildwheel
run: python3.9 -m pip install cibuildwheel~=2.16.0

- name: Build wheels
env:
CIBW_CONTAINER_ENGINE: "podman"

CIBW_ARCHS_LINUX: ${{matrix.arch}}

CIBW_BUILD: ${{ matrix.cibw_build }}
Expand All @@ -139,15 +142,15 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
cat /etc/dnf.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/dnf.conf
python -m pip install ninja cmake~=3.24.0
yum clean all -y
yum install centos-release-scl-rh -y
yum install devtoolset-11-gcc-c++ -y
source /opt/rh/devtoolset-11/enable -y
dnf clean all -y
dnf install gcc-toolset-13 -y
source ls /opt/rh/gcc-toolset-13/enable -y
PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH"

CIBW_ENVIRONMENT: |
PATH="/opt/rh/devtoolset-11/root/usr/bin:$PATH" \
PATH="/opt/rh/gcc-toolset-13/root/usr/bin:$PATH" \
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_BEFORE_TEST: |
Expand All @@ -158,7 +161,7 @@ jobs:
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device=${DEVICENAME} --skip-ops -x --tb=short --no-flaky-report

CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

Expand Down
39 changes: 19 additions & 20 deletions .github/workflows/wheel_linux_x86_64_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Wheel::Linux::x86_64::CUDA
# **Who does it impact**: Wheels to be uploaded to PyPI.

env:
GCC_VERSION: "11"
GCC_VERSION: 12

on:
pull_request:
Expand Down Expand Up @@ -38,28 +38,30 @@ jobs:
pl_backend: ["lightning_gpu"]
cuda_version: ["12"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
container_img: ["quay.io/pypa/manylinux2014_x86_64"]
container_img: ["quay.io/pypa/manylinux_2_28_x86_64"]
timeout-minutes: 30
name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} CUDA ${{ matrix.cuda_version }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11","cp312-*":"3.12" }')[matrix.cibw_build] }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container_img }}
container:
image: ${{ matrix.container_img }}
options: --privileged

steps:
- name: Checkout PennyLane-Lightning
uses: actions/checkout@v3

- name: Install dependencies (CentOS)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux2014_x86_64') }}
- name: Install dependencies (AlmaLinux)
if: ${{ (matrix.container_img == 'quay.io/pypa/manylinux_2_28_x86_64') }}
run: |
# Reduce wait time for repos not responding
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
yum update -y && yum install -y docker
dnf update -y && dnf install -y podman

- name: Install cibuildwheel
run: python3.9 -m pip install cibuildwheel~=2.16.0

- name: Build wheels
env:
CIBW_CONTAINER_ENGINE: "podman"

CIBW_ARCHS_LINUX: ${{ matrix.arch }}

CIBW_BUILD: ${{ matrix.cibw_build }}
Expand All @@ -70,25 +72,23 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
python -m pip install ninja cmake~=3.24.3 auditwheel~=5.0 custatevec-cu${{ matrix.cuda_version }}
yum clean all -y
yum install centos-release-scl-rh -y
yum install devtoolset-11-gcc-c++ -y
source /opt/rh/devtoolset-11/enable -y
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo -y
yum -y install cuda-${{ matrix.cuda_version }}-0 git openssh wget
dnf clean all -y
dnf install gcc-toolset-12 dnf-utils -y
source ls /opt/rh/gcc-toolset-12/enable -y
yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo -y
dnf -y install cuda-${{ matrix.cuda_version }}-0 git openssh wget

# ensure nvcc is available
CIBW_ENVIRONMENT: |
PATH=/opt/rh/devtoolset-11/root/usr/bin:$PATH:/usr/local/cuda-${{ matrix.cuda_version }}/bin \
LD_LIBRARY_PATH=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:$LD_LIBRARY_PATH:/usr/local/cuda-${{ matrix.cuda_version }}/lib64 \
PATH=/opt/rh/gcc-toolset-12/root/usr/bin:$PATH:/usr/local/cuda-${{ matrix.cuda_version }}/bin \
LD_LIBRARY_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst:$LD_LIBRARY_PATH:/usr/local/cuda-${{ matrix.cuda_version }}/lib64 \
PL_BACKEND="${{ matrix.pl_backend }}" \
PKG_CONFIG_PATH=/opt/rh/devtoolset-11/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:$PKG_CONFIG_PATH

CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}"

CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

Expand Down Expand Up @@ -133,4 +133,3 @@ jobs:
user: __token__
password: ${{ secrets.TEST_PYPI_LGPU_TOKEN }}
repository_url: https://test.pypi.org/legacy/

2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.36.0-dev22"
__version__ = "0.36.0-dev24"
Loading