Skip to content

Commit 469005d

Browse files
committed
[CP-Sec] Enable OpenSSF Scorecard
Enable OpenSSF Scorecard workflow, add badge to README file
1 parent 5283e4c commit 469005d

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

.github/workflows/scorecard.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Scorecards' GitHub action
2+
3+
name: Scorecard supply-chain security
4+
on:
5+
# For Branch-Protection check. Only the default branch is supported. See
6+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
7+
branch_protection_rule:
8+
schedule:
9+
- cron: '15 18 * * 5'
10+
push:
11+
branches: [ "main" ]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
26+
steps:
27+
- name: "Checkout code"
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
publish_results: true
38+
39+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
40+
# format to the repository Actions tab.
41+
- name: "Upload artifact"
42+
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
43+
with:
44+
name: SARIF file
45+
path: results.sarif
46+
retention-days: 5
47+
48+
# Upload the results to GitHub's code scanning dashboard (optional).
49+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
50+
- name: "Upload to code-scanning"
51+
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
52+
with:
53+
sarif_file: results.sarif

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# nbody
2+
3+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/codeplaysoftware/cuda-to-sycl-nbody/badge)](https://scorecard.dev/viewer/?uri=github.com/codeplaysoftware/cuda-to-sycl-nbody)
4+
25
Accelerated N-body sim with OpenGL graphics & automatic CUDA->SYCL conversion using [dpct](https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compatibility-tool.html).
36

47
![](http://i.imgur.com/drzi33P.jpg)
@@ -59,7 +62,7 @@ The provided `tasks.json` and `launch.json` configuration files for vscode serve
5962

6063
## Migrating CUDA to SYCL
6164

62-
The script `./scripts/run_dpct.sh` calls a containerized version of the Intel® DPC++ Compatibility Tool to automatically convert the CUDA components of this project into SYCL. A docker container was used because the dev machine has an incompatible version of the CUDA driver. This should be adapted based on your environment.
65+
The script `./scripts/run_dpct.sh` calls a containerized version of the Intel® DPC++ Compatibility Tool to automatically convert the CUDA components of this project into SYCL. A docker container was used because the dev machine has an incompatible version of the CUDA driver. This should be adapted based on your environment.
6366

6467
The Intel® DPC++ compatibility tool offers options for intercepting complex builds, but current dev environment restrictions require me to run the tool inside a docker container. This complicates things, so for now I'm just doing single source conversion on the simulator.cu file.
6568

@@ -186,7 +189,7 @@ The exposure of the final render is obtained from the average luminance, and the
186189

187190
## Running headless
188191

189-
If you run `nbody_cuda` on a remote machine with X-forwarding, sending the rendered frames across the net will be a significant bottleneck. This can be worked around by making use of [Xvfb](https://linux.die.net/man/1/xvfb) which provides a *virtual* X display. You can then read from the memory mapped file to write to e.g. MP4 output.
192+
If you run `nbody_cuda` on a remote machine with X-forwarding, sending the rendered frames across the net will be a significant bottleneck. This can be worked around by making use of [Xvfb](https://linux.die.net/man/1/xvfb) which provides a *virtual* X display. You can then read from the memory mapped file to write to e.g. MP4 output.
190193

191194
The script `./scripts/xvfb.sh` runs `nbody_cuda` in this manner, producing a video file `output.mp4`. Note that this script will run the simulation until manually terminated.
192195

0 commit comments

Comments
 (0)