5555 run : spack -e . install --no-check-signature
5656
5757 - name : Run
58- run : ./my_view/bin/python -c 'print("hello world")'
58+ run : ./my_view/bin/python3 -c 'print("hello world")'
5959` ` `
6060
6161## Caching your own binaries
@@ -71,7 +71,13 @@ If you want to cache your own binaries too, there are three steps to take:
7171 root: /opt/spack
7272 padded_length: 128
7373 mirrors:
74- local-buildcache: oci://ghcr.io/<username>/spack-buildcache
74+ local-buildcache:
75+ url: oci://ghcr.io/<username>/spack-buildcache
76+ signed: false
77+ access_pair:
78+ id_variable: GITHUB_USER
79+ secret_variable: GITHUB_TOKEN
80+
7581 ` ` `
7682
77832. Configure the permissions for `GITHUB_TOKEN` :
@@ -92,9 +98,10 @@ If you want to cache your own binaries too, there are three steps to take:
9298 example:
9399 steps:
94100 - name: Push packages and update index
95- run: |
96- spack -e . mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
97- spack -e . buildcache push --base-image ubuntu:22.04 --unsigned --update-index local-buildcache
101+ env:
102+ GITHUB_USER: ${{ github.actor }}
103+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+ run: spack -e . buildcache push --base-image ubuntu:22.04 --update-index local-buildcache
98105 if: ${{ !cancelled() }}
99106 ` ` `
100107 NOTE : Make sure to add `if: ${{ !cancelled() }}`, so that binaries for successfully
@@ -104,30 +111,28 @@ If you want to cache your own binaries too, there are three steps to take:
104111
105112When your local buildcache is stored in a private GitHub package,
106113you need to specify the OCI credentials already *before* `spack concretize`.
107- This is because Spack needs to fetch the buildcache index. Also, remember to
108- remove the `--push` flag from `spack mirror set`, since fetching needs
109- credentials too :
114+ This is because Spack needs to fetch the buildcache index.
110115
111116` ` ` yaml
117+ env:
118+ GITHUB_USER: ${{ github.actor }}
119+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
112121jobs:
113122 example-private:
114123 steps:
115- - name: Login
116- run: spack -e . mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
117-
118124 - name: Concretize
119125 run: spack -e . concretize
120126
121127 - name: Install
122128 run: spack -e . install --no-check-signature
123129
124130 - name: Push packages and update index
125- run: spack -e . buildcache push --base-image ubuntu:22.04 --unsigned -- update-index local-buildcache
131+ run: spack -e . buildcache push --base-image ubuntu:22.04 --update-index local-buildcache
126132` ` `
127133
128- From a security perspective, notice that the `GITHUB_TOKEN` is exposed to every
129- subsequent job step. (This is no different from `docker login`, which also likes
130- to store credentials in the home directory.)
134+ From a security perspective, do note that the `GITHUB_TOKEN` is exposed to every
135+ job step.
131136
132137# # Contributing
133138
0 commit comments