Skip to content

Commit

Permalink
feat: using a patched version of gsc to fix build failures with gsc
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-neil-1206 committed Dec 7, 2024
1 parent 7d959b2 commit de97da8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 52 deletions.
57 changes: 7 additions & 50 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,53 +34,17 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Clone and set up GSC
- name: Export image to file
run: |
git clone -b adarsh/new-sgx-driver https://github.com/adarshan-intel/gsc.git
cd gsc
python3 -m pip install --no-cache-dir 'docker>=7.1.0' 'jinja2>=3.1.4' 'tomli>=2.0.1' 'tomli-w>=1.0.0' 'pyyaml>=6.0.2'
- name: Create signing key
run: |
echo "${{ secrets.SIGNING_KEY }}" > signing_key.pem
chmod 600 signing_key.pem
- name: Build GSC image
run: |
cd gsc
./gsc build my-proof ../my-proof.manifest.template -c ../config.yaml
- name: Sign GSC image
run: |
cd gsc
./gsc sign-image my-proof ../signing_key.pem -c ../config.yaml
- name: Export GSC image to file
run: |
docker save gsc-my-proof:latest | gzip > gsc-my-proof-${{ github.run_number }}.tar.gz
- name: Generate verification data
docker save my-proof:latest | gzip > my-proof-${{ github.run_number }}.tar.gz
- name: Generate release body
run: |
cd gsc
./gsc info-image gsc-my-proof > ../sigstruct.txt
echo "Image SHA256: $(sha256sum my-proof-${{ github.run_number }}.tar.gz | cut -d' ' -f1)" >> release_body.txt
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: gsc-my-proof-image
path: gsc-my-proof-${{ github.run_number }}.tar.gz

- name: Upload verification data
uses: actions/upload-artifact@v3
with:
name: gsc-my-proof-sigstruct
path: sigstruct.txt

- name: Generate release body
run: |
echo "MRSIGNER: $(grep -oP 'mr_signer = "\K[^"]*' sigstruct.txt)" >> release_body.txt
echo "MRENCLAVE: $(grep -oP 'mr_enclave = "\K[^"]*' sigstruct.txt)" >> release_body.txt
echo "Image SHA256: $(sha256sum gsc-my-proof-${{ github.run_number }}.tar.gz | cut -d' ' -f1)" >> release_body.txt
name: my-proof-image
path: my-proof-${{ github.run_number }}.tar.gz

- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
Expand All @@ -94,14 +58,7 @@ jobs:
draft: false
prerelease: false
files: |
./gsc-my-proof-${{ github.run_number }}.tar.gz
./sigstruct.txt
- name: Cleanup signing key
if: always()
run: |
rm -f signing_key.pem
./my-proof-${{ github.run_number }}.tar.gz
- name: Log build result
if: always()
run: |
Expand Down
3 changes: 1 addition & 2 deletions my_proof/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from my_proof.proof import Proof

INPUT_DIR, OUTPUT_DIR, SEALED_DIR = '/input', '/output', '/sealed'
INPUT_DIR, OUTPUT_DIR = '/input', '/output'

logging.basicConfig(level=logging.INFO, format='%(message)s')

Expand All @@ -17,7 +17,6 @@ def load_config() -> Dict[str, Any]:
"""Load proof configuration from environment variables."""
config = {
'dlp_id': 10,
'use_sealing': os.path.isdir(SEALED_DIR),
'input_dir': INPUT_DIR,
'aws_access_key_id': os.environ.get('AWS_ACCESS_KEY_ID', None),
'aws_secret_access_key': os.environ.get('AWS_SECRET_ACCESS_KEY', None),
Expand Down

0 comments on commit de97da8

Please sign in to comment.