Skip to content

Commit

Permalink
renaming macos to Darwin (sigstore#183)
Browse files Browse the repository at this point in the history
* renaming macos to Darwin

Signed-off-by: greg pereira <[email protected]>

* fixing github workflows for Darwin name change

Signed-off-by: greg pereira <[email protected]>

* adding validate deps workflow chagnes

Signed-off-by: greg pereira <[email protected]>

* fixing runs on for unit-tests

Signed-off-by: greg pereira <[email protected]>

---------

Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira authored May 16, 2024
1 parent 087b386 commit 66c46cb
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 25 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/pin_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,23 @@ jobs:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
os_family: Linux
- os: macos-latest
os_family: Darwin
- os: windows-latest
os_family: Windows
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
model_signing/install/requirements_${{ runner.os }}.txt
model_signing/install/requirements_test_${{ runner.os }}.txt
slsa_for_models/install/requirements_${{ runner.os }}.txt
model_signing/install/requirements_${{ matrix.os_family }}.txt
model_signing/install/requirements_test_${{ matrix.os_family }}.txt
slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
- name: Create an empty virtualenv and install `pip-tools`
run: |
set -exuo pipefail
Expand All @@ -39,38 +46,38 @@ jobs:
run: |
set -exuo pipefail
.github/workflows/scripts/venv_activate.sh
pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_${{ runner.os }}.txt model_signing/install/requirements.in
pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_test_${{ runner.os }}.txt model_signing/install/requirements_test.in
pip-compile --upgrade --generate-hashes --strip-extras --output-file=slsa_for_models/install/requirements_${{ runner.os }}.txt slsa_for_models/install/requirements.in
pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_${{ matrix.os_family }}.txt model_signing/install/requirements.in
pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_test_${{ matrix.os_family }}.txt model_signing/install/requirements_test.in
pip-compile --upgrade --generate-hashes --strip-extras --output-file=slsa_for_models/install/requirements_${{ matrix.os_family }}.txt slsa_for_models/install/requirements.in
- name: Test freeze file (for model signing)
run: |
set -exuo pipefail
rm -rf venv # Need clean sandbox
python -m venv venv
.github/workflows/scripts/venv_activate.sh
pip install -r model_signing/install/requirements_${{ runner.os }}.txt
pip install -r model_signing/install/requirements_${{ matrix.os_family }}.txt
pip list # For debugging
- name: Test freeze file (for testing model signing)
run: |
set -exuo pipefail
rm -rf venv # Need clean sandbox
python -m venv venv
.github/workflows/scripts/venv_activate.sh
pip install -r model_signing/install/requirements_test_${{ runner.os }}.txt
pip install -r model_signing/install/requirements_test_${{ matrix.os_family }}.txt
pip list # For debugging
- name: Test freeze file (for SLSA for models)
run: |
set -exuo pipefail
rm -rf venv # Need clean sandbox
python -m venv venv
.github/workflows/scripts/venv_activate.sh
pip install -r slsa_for_models/install/requirements_${{ runner.os }}.txt
pip install -r slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
pip list # For debugging
- name: Upload freeze files
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: freeze-files-${{ matrix.os }}
path: ./*/install/requirements*${{ runner.os }}*txt
path: ./*/install/requirements*${{ matrix.os_family }}*txt

# Separate PR creation job to make sure it creates only one single PR with
# all changed files, eliminate race-conditions and restrict permissions only
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/slsa_for_ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-latest
os_family: Darwin
- os: ubuntu-latest
os_family: Linux
- os: windows-latest
os_family: Windows
outputs:
hash-ubuntu-latest: ${{ steps.hash.outputs.hash-ubuntu-latest }}
hash-macos-latest: ${{ steps.hash.outputs.hash-macos-latest }}
Expand All @@ -45,13 +52,13 @@ jobs:
with:
python-version: 3.11
cache: pip
cache-dependency-path: slsa_for_models/install/requirements_${{ runner.os }}.txt
cache-dependency-path: slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
- name: Install dependencies
run: |
set -exuo pipefail
python -m venv venv
.github/workflows/scripts/venv_activate.sh
python -m pip install --require-hashes -r slsa_for_models/install/requirements_${{ runner.os }}.txt
python -m pip install --require-hashes -r slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
- name: Build model
env:
MODEL_TYPE: ${{ github.event.inputs.model_type || 'pytorch_jitted_model.pt' }}
Expand All @@ -63,7 +70,7 @@ jobs:
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
path: ${{ github.event.inputs.model_type || 'pytorch_jitted_model.pt' }}
name: ${{ github.event.inputs.model_type || 'pytorch_jitted_model.pt' }}_${{ runner.os }}
name: ${{ github.event.inputs.model_type || 'pytorch_jitted_model.pt' }}_${{ matrix.os_family }}
if-no-files-found: error
- id: hash
env:
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,29 @@ jobs:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-latest
os_family: Darwin
- os: ubuntu-latest
os_family: Linux
- os: windows-latest
os_family: Windows
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
model_signing/install/requirements_${{ runner.os }}.txt
model_signing/install/requirements_test_${{ runner.os }}.txt
model_signing/install/requirements_${{ matrix.os_family }}.txt
model_signing/install/requirements_test_${{ matrix.os_family }}.txt
- name: Install dependencies
run: |
set -exuo pipefail
python -m venv venv
.github/workflows/scripts/venv_activate.sh
python -m pip install --require-hashes -r model_signing/install/requirements_${{ runner.os }}.txt
python -m pip install --require-hashes -r model_signing/install/requirements_test_${{ runner.os }}.txt
python -m pip install --require-hashes -r model_signing/install/requirements_${{ matrix.os_family }}.txt
python -m pip install --require-hashes -r model_signing/install/requirements_test_${{ matrix.os_family }}.txt
- name: Run unit tests
run: |
set -euo pipefail
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/validate_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,26 @@ jobs:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-latest
os_family: Darwin
- os: ubuntu-latest
os_family: Linux
- os: windows-latest
os_family: Windows
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.11
cache: pip
cache-dependency-path: model_signing/install/requirements_${{ runner.os }}.txt
cache-dependency-path: model_signing/install/requirements_${{ matrix.os_family }}.txt
- name: Install dependencies
run: |
set -exuo pipefail
python -m venv venv
.github/workflows/scripts/venv_activate.sh
python -m pip install --require-hashes -r model_signing/install/requirements_${{ runner.os }}.txt
python -m pip install --require-hashes -r model_signing/install/requirements_${{ matrix.os_family }}.txt
slsa-for-ml:
name: Test SLSA for ML demo dependencies
Expand All @@ -44,16 +51,23 @@ jobs:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-latest
os_family: Darwin
- os: ubuntu-latest
os_family: Linux
- os: windows-latest
os_family: Windows
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.11
cache: pip
cache-dependency-path: slsa_for_models/install/requirements_${{ runner.os }}.txt
cache-dependency-path: slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
- name: Install dependencies
run: |
set -exuo pipefail
python -m venv venv
.github/workflows/scripts/venv_activate.sh
python -m pip install --require-hashes -r slsa_for_models/install/requirements_${{ runner.os }}.txt
python -m pip install --require-hashes -r slsa_for_models/install/requirements_${{ matrix.os_family }}.txt
2 changes: 1 addition & 1 deletion model_signing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ git clone [email protected]:sigstore/model-transparency.git
cd model-transparency/model_signing
python3 -m venv test_env
source test_env/bin/activate
os=Linux # Supported: Linux, Windows, macOS.
os=Linux # Supported: Linux, Windows, Darwin.
python3 -m pip install --require-hashes -r "install/requirements_${os}".txt
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --generate-hashes --output-file=model_signing/install/requirements_macOS.txt --strip-extras model_signing/install/requirements.in
# pip-compile --generate-hashes --output-file=model_signing/install/requirements_Darwin.txt --strip-extras model_signing/install/requirements.in
#
annotated-types==0.6.0 \
--hash=sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --generate-hashes --output-file=model_signing/install/requirements_test_macOS.txt --strip-extras model_signing/install/requirements_test.in
# pip-compile --generate-hashes --output-file=model_signing/install/requirements_test_Darwin.txt --strip-extras model_signing/install/requirements_test.in
#
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --generate-hashes --output-file=slsa_for_models/install/requirements_macOS.txt --strip-extras slsa_for_models/install/requirements.in
# pip-compile --generate-hashes --output-file=slsa_for_models/install/requirements_Darwin.txt --strip-extras slsa_for_models/install/requirements.in
#
absl-py==2.1.0 \
--hash=sha256:526a04eadab8b4ee719ce68f204172ead1027549089702d99b9059f129ff1308 \
Expand Down

0 comments on commit 66c46cb

Please sign in to comment.