generated from siderolabs/sbc-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NVIDIA Jetson family overlay. Signed-off-by: Noel Georgi <[email protected]>
- Loading branch information
Showing
22 changed files
with
527 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
# | ||
# Generated on 2024-03-16T13:23:31Z by kres c2d361c. | ||
|
||
policies: | ||
- type: commit | ||
spec: | ||
dco: true | ||
gpg: | ||
required: true | ||
identity: | ||
gitHubOrganization: siderolabs | ||
spellcheck: | ||
locale: US | ||
maximumOfOneCommit: true | ||
header: | ||
length: 89 | ||
imperative: true | ||
case: lower | ||
invalidLastCharacters: . | ||
body: | ||
required: true | ||
conventional: | ||
types: | ||
- chore | ||
- docs | ||
- perf | ||
- refactor | ||
- style | ||
- test | ||
- release | ||
scopes: | ||
- .* | ||
- type: license | ||
spec: | ||
root: . | ||
skipPaths: | ||
- .git/ | ||
- testdata/ | ||
includeSuffixes: | ||
- .go | ||
excludeSuffixes: | ||
- .pb.go | ||
- .pb.gw.go | ||
header: | | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
# | ||
# Generated on 2024-03-16T13:23:31Z by kres c2d361c. | ||
|
||
* | ||
!README.md | ||
!pkg.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
# | ||
# Generated on 2024-03-16T13:23:31Z by kres c2d361c. | ||
|
||
name: slack-notify | ||
"on": | ||
workflow_run: | ||
workflows: | ||
- default | ||
types: | ||
- completed | ||
jobs: | ||
slack-notify: | ||
runs-on: | ||
- self-hosted | ||
- generic | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
steps: | ||
- name: Get PR number | ||
id: get-pr-number | ||
if: github.event.workflow_run.event == 'pull_request' | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT | ||
- name: Slack Notify | ||
uses: slackapi/slack-github-action@v1 | ||
with: | ||
channel-id: proj-talos-maintainers | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}", | ||
"fallback": "test", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Author:*\n`${{ github.actor }}`" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "actions", | ||
"elements": [ | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Logs" | ||
}, | ||
"url": "${{ github.event.workflow_run.html_url }}" | ||
}, | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Commit" | ||
}, | ||
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
go.work.sum | ||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
# | ||
# Generated on 2024-03-16T13:23:31Z by kres c2d361c. | ||
|
||
_out | ||
go.work.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
kind: pkgfile.Build | ||
spec: | ||
targets: | ||
- sbc-board | ||
- sbc-jetson | ||
extraBuildArgs: | ||
- PKGS_PREFIX | ||
- PKGS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,162 @@ | ||
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. | ||
# | ||
# Generated on 2024-03-16T13:23:31Z by kres c2d361c. | ||
|
||
# common variables | ||
|
||
SHA := $(shell git describe --match=none --always --abbrev=8 --dirty) | ||
TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*) | ||
ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined') | ||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD) | ||
ARTIFACTS := _out | ||
OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
GOARCH := $(shell uname -m | tr '[:upper:]' '[:lower:]') | ||
|
||
ifeq ($(GOARCH),x86_64) | ||
GOARCH := amd64 | ||
endif | ||
REGISTRY ?= ghcr.io | ||
USERNAME ?= siderolabs | ||
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) | ||
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest | ||
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest | ||
|
||
# source date epoch of first commit | ||
|
||
INITIAL_COMMIT_SHA := $(shell git rev-list --max-parents=0 HEAD) | ||
SOURCE_DATE_EPOCH := $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct) | ||
|
||
# sync bldr image with pkgfile | ||
|
||
BLDR_RELEASE := v0.3.0 | ||
BLDR_IMAGE := ghcr.io/siderolabs/bldr:$(BLDR_RELEASE) | ||
BLDR := docker run --rm --user $(shell id -u):$(shell id -g) --volume $(PWD):/src --entrypoint=/bldr $(BLDR_IMAGE) --root=/src | ||
|
||
# docker build settings | ||
|
||
BUILD := docker buildx build | ||
PLATFORM ?= linux/amd64,linux/arm64 | ||
PROGRESS ?= auto | ||
PUSH ?= false | ||
CI_ARGS ?= | ||
COMMON_ARGS = --file=Pkgfile | ||
COMMON_ARGS += --provenance=false | ||
COMMON_ARGS += --progress=$(PROGRESS) | ||
COMMON_ARGS += --platform=$(PLATFORM) | ||
COMMON_ARGS += --build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) | ||
COMMON_ARGS += --build-arg=PKGS_PREFIX="$(PKGS_PREFIX)" | ||
COMMON_ARGS += --build-arg=PKGS="$(PKGS)" | ||
|
||
# extra variables | ||
|
||
PKGS_PREFIX ?= ghcr.io/siderolabs | ||
PKGS ?= v1.7.0-alpha.0-33-g3aacf03 | ||
|
||
# targets defines all the available targets | ||
|
||
TARGETS = sbc-jetson | ||
|
||
# help menu | ||
|
||
export define HELP_MENU_HEADER | ||
# Getting Started | ||
|
||
To build this project, you must have the following installed: | ||
|
||
- git | ||
- make | ||
- docker (19.03 or higher) | ||
|
||
## Creating a Builder Instance | ||
|
||
The build process makes use of experimental Docker features (buildx). | ||
To enable experimental features, add 'experimental: "true"' to '/etc/docker/daemon.json' on | ||
Linux or enable experimental features in Docker GUI for Windows or Mac. | ||
|
||
To create a builder instance, run: | ||
|
||
docker buildx create --name local --use | ||
|
||
If running builds that needs to be cached aggresively create a builder instance with the following: | ||
|
||
docker buildx create --name local --use --config=config.toml | ||
|
||
config.toml contents: | ||
|
||
[worker.oci] | ||
gc = true | ||
gckeepstorage = 50000 | ||
|
||
[[worker.oci.gcpolicy]] | ||
keepBytes = 10737418240 | ||
keepDuration = 604800 | ||
filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"] | ||
[[worker.oci.gcpolicy]] | ||
all = true | ||
keepBytes = 53687091200 | ||
|
||
If you already have a compatible builder instance, you may use that instead. | ||
|
||
## Artifacts | ||
|
||
All artifacts will be output to ./$(ARTIFACTS). Images will be tagged with the | ||
registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(IMAGE):$(TAG)). | ||
The registry and username can be overridden by exporting REGISTRY, and USERNAME | ||
respectively. | ||
|
||
endef | ||
|
||
all: $(TARGETS) ## Builds all targets defined. | ||
|
||
.PHONY: clean | ||
clean: ## Cleans up all artifacts. | ||
@rm -rf $(ARTIFACTS) | ||
|
||
$(ARTIFACTS): ## Creates artifacts directory. | ||
@mkdir -p $(ARTIFACTS) | ||
|
||
target-%: ## Builds the specified target defined in the Pkgfile. The build result will only remain in the build cache. | ||
@$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) . | ||
|
||
local-%: ## Builds the specified target defined in the Pkgfile using the local output type. The build result will be output to the specified local destination. | ||
@$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)" | ||
|
||
docker-%: ## Builds the specified target defined in the Pkgfile using the docker output type. The build result will be loaded into Docker. | ||
@$(MAKE) target-$* TARGET_ARGS="$(TARGET_ARGS)" | ||
|
||
reproducibility-test-local-%: ## Builds the specified target defined in the Pkgfile using the local output type with and without cahce. The build result will be output to the specified local destination | ||
@rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b | ||
@$(MAKE) local-$* DEST=$(ARTIFACTS)/build-a | ||
@$(MAKE) local-$* DEST=$(ARTIFACTS)/build-b TARGET_ARGS="--no-cache" | ||
@touch -ch -t $$(date -d @$(SOURCE_DATE_EPOCH) +%Y%m%d0000) $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b | ||
@diffoscope $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b | ||
@rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b | ||
|
||
.PHONY: $(TARGETS) | ||
$(TARGETS): | ||
@$(MAKE) docker-$@ TARGET_ARGS="--tag=$(REGISTRY_AND_USERNAME)/$@:$(TAG) --push=$(PUSH)" | ||
|
||
.PHONY: deps.png | ||
deps.png: ## Generates a dependency graph of the Pkgfile. | ||
@$(BLDR) graph | dot -Tpng -o deps.png | ||
|
||
.PHONY: rekres | ||
rekres: | ||
@docker pull $(KRES_IMAGE) | ||
@docker run --rm --net=host --user $(shell id -u):$(shell id -g) -v $(PWD):/src -w /src -e GITHUB_TOKEN $(KRES_IMAGE) | ||
|
||
.PHONY: help | ||
help: ## This help menu. | ||
@echo "$$HELP_MENU_HEADER" | ||
@grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: release-notes | ||
release-notes: | ||
mkdir -p $(ARTIFACTS) | ||
@ARTIFACTS=$(ARTIFACTS) ./hack/release.sh $@ $(ARTIFACTS)/RELEASE_NOTES.md $(TAG) | ||
|
||
.PHONY: conformance | ||
conformance: | ||
@docker pull $(CONFORMANCE_IMAGE) | ||
@docker run --rm -it -v $(PWD):/src -w /src $(CONFORMANCE_IMAGE) enforce | ||
|
Oops, something went wrong.