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

Lance/repros support #486

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,34 @@ jobs:
shell: 'script -q -e -c "bash {0}"'
run: |
make -j$(nproc)
reproduce:
name: reproduce artifacts
runs-on:
group: ubuntu-runners
strategy:
matrix:
host: [144.76.154.76]
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Run `make`
run: |
mkdir -p ~/.ssh/
chmod 700 ~/.ssh
echo "${{ secrets.REPROS_KEY }}" > ~/.ssh/repros.key
chmod 600 ~/.ssh/repros.key
cat >>~/.ssh/config <<-END
Host $${{matrix.host}}
HostName ${{matrix.host}}
User git
IdentityFile ~/.ssh/repros.key
StrictHostKeyChecking no
END
echo "Using key: ~/.ssh/repros.key"
ssh-keygen -l -f /home/runner/.ssh/repros.key
ssh-keyscan -H ${{matrix.host}} >> ~/.ssh/known_hosts
git remote add repros-lance git@${{matrix.host}}:qos
ssh-agent sh -c " \
ssh-add ~/.ssh/repros.key \
&& git push repros-lance HEAD \
"
15 changes: 15 additions & 0 deletions .repros/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
build:
command: make
sign:
files:
- out/qos_client/index.json
- out/qos_enclave/index.json
- out/qos_host/index.json
- out/digests.txt
format: raw
method: ssh
backing: disk
storage:
method: git
location: [email protected]:tkhq/repros-sigs.git
path: /qos
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ include src/macros.mk
REGISTRY := local
.DEFAULT_GOAL :=
.PHONY: default
default: \
default: out/digests.txt

.PHONY: all
all: \
out/qos_client/index.json \
out/qos_host/index.json \
out/qos_enclave/index.json
Expand Down Expand Up @@ -39,6 +42,9 @@ shell: out/.common-loaded
qos-local/common:latest \
/bin/bash

out/digests.txt: all
@$(call digests) > $@

out/nitro.pcrs: out/qos_enclave.tar
@$(call run,/src/scripts/extract_oci_file.sh qos_enclave.tar nitro.pcrs)

Expand Down
12 changes: 12 additions & 0 deletions src/macros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ define run
/bin/sh -c "set -eu; $(1)"
endef

define digests
find out -iname "index.json" \
| awk -F/ '{print $$2}' \
| sort \
| while IFS= read -r package; do \
jq \
-jr '.manifests[].digest | sub ("sha256:";"")' \
out/$${package}/index.json; \
printf " %s\n" "$${package}"; \
done
endef

define build_context
$$( \
self=$(1); \
Expand Down