Skip to content

Commit 6161868

Browse files
Yang Kaiyongimeoer
Yang Kaiyong
authored andcommitted
builder: suport build external model image from modctl
builder: add support for build external model image from modctl in local context or remote registery. feat(nydusify): add support for mount external large model images chore: introduce GoReleaser for RPM package generation nydusify(feat): add support for model image in check command nydusify(test): add support for binary-based testing in external model's smoke tests Signed-off-by: Yan Song <[email protected]> Signed-off-by: Yang Kaiyong <[email protected]>
1 parent 871e1c6 commit 6161868

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+6075
-294
lines changed

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,85 @@ jobs:
239239
generate_release_notes: true
240240
files: |
241241
${{ env.tarballs }}
242+
243+
244+
goreleaser:
245+
strategy:
246+
matrix:
247+
arch: [amd64, arm64]
248+
os: [linux]
249+
needs: [nydus-linux, contrib-linux]
250+
permissions:
251+
contents: write
252+
runs-on: ubuntu-latest
253+
timeout-minutes: 60
254+
outputs:
255+
hashes: ${{ steps.hash.outputs.hashes }}
256+
steps:
257+
- name: Checkout
258+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
259+
with:
260+
fetch-depth: 0
261+
submodules: recursive
262+
263+
- name: Setup Golang
264+
uses: actions/setup-go@v5
265+
with:
266+
go-version-file: 'go.work'
267+
cache-dependency-path: "**/*.sum"
268+
- name: download artifacts
269+
uses: actions/download-artifact@v4
270+
with:
271+
pattern: nydus-artifacts-${{ matrix.os }}-${{ matrix.arch }}*
272+
merge-multiple: true
273+
path: nydus-static
274+
- name: prepare context
275+
run: |
276+
chmod +x nydus-static/*
277+
export GOARCH=${{ matrix.arch }}
278+
echo "GOARCH: $GOARCH"
279+
sh ./goreleaser.sh
280+
- name: Check GoReleaser config
281+
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3
282+
with:
283+
version: latest
284+
args: check
285+
286+
- name: Run GoReleaser
287+
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3
288+
id: run-goreleaser
289+
with:
290+
version: latest
291+
args: release --clean
292+
env:
293+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
294+
295+
- name: Generate subject
296+
id: hash
297+
env:
298+
ARTIFACTS: "${{ steps.run-goreleaser.outputs.artifacts }}"
299+
run: |
300+
set -euo pipefail
301+
hashes=$(echo $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
302+
if test "$hashes" = ""; then # goreleaser < v1.13.0
303+
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
304+
hashes=$(cat $checksum_file | base64 -w0)
305+
fi
306+
echo "hashes=$hashes" >> $GITHUB_OUTPUT
307+
308+
- name: Set tag output
309+
id: tag
310+
run: echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
311+
312+
provenance:
313+
needs: [goreleaser]
314+
permissions:
315+
actions: read # To read the workflow path.
316+
id-token: write # To sign the provenance.
317+
contents: write # To add assets to a release.
318+
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
319+
with:
320+
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
321+
upload-assets: true # upload to a new release
322+
upload-tag-name: "${{ needs.release.outputs.tag_name }}"
323+
draft-release: true

.github/workflows/smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Lint
5858
uses: golangci/golangci-lint-action@v6
5959
with:
60-
version: v1.61
60+
version: v1.64
6161
working-directory: ${{ matrix.path }}
6262
args: --timeout=10m --verbose
6363

@@ -213,7 +213,7 @@ jobs:
213213
export NYDUS_NYDUSIFY_$version_export=/usr/bin/nydus-$version/nydusify
214214
done
215215
216-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.61.0
216+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.64.8
217217
sudo -E make smoke-only
218218
219219
nydus-unit-test:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
__pycache__
88
.DS_Store
99
go.work.sum
10+
dist/
11+
nydus-static/
12+
.goreleaser.yml

0 commit comments

Comments
 (0)