Skip to content

Commit 6db0478

Browse files
committed
chore: support platform for dependencies
Support setting platform for `image` dependencies. Also `rekres` and bump deps. Signed-off-by: Noel Georgi <[email protected]>
1 parent 2ad4508 commit 6db0478

File tree

21 files changed

+193
-143
lines changed

21 files changed

+193
-143
lines changed

.codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-09-11T18:54:59Z by kres latest.
3+
# Generated on 2024-03-05T10:13:10Z by kres latest.
44

55
codecov:
66
require_ci_to_pass: false
@@ -9,7 +9,7 @@ coverage:
99
status:
1010
project:
1111
default:
12-
target: 7%
12+
target: 1%
1313
threshold: 0.5%
1414
base: auto
1515
if_ci_failed: success

.conform.yaml

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2022-08-29T16:54:01Z by kres bb965bb.
3+
# Generated on 2024-03-05T05:52:53Z by kres latest.
44

5-
---
65
policies:
7-
- type: commit
8-
spec:
9-
dco: true
10-
gpg:
11-
required: true
12-
identity:
13-
gitHubOrganization: siderolabs
14-
spellcheck:
15-
locale: US
16-
maximumOfOneCommit: true
17-
header:
18-
length: 89
19-
imperative: true
20-
case: lower
21-
invalidLastCharacters: .
22-
body:
23-
required: true
24-
conventional:
25-
types: ["chore","docs","perf","refactor","style","test","release"]
26-
scopes: [".*"]
27-
- type: license
28-
spec:
29-
skipPaths:
30-
- .git/
31-
- testdata/
32-
includeSuffixes:
33-
- .go
34-
excludeSuffixes:
35-
- .pb.go
36-
- .pb.gw.go
37-
header: "// This Source Code Form is subject to the terms of the Mozilla Public\u000A// License, v. 2.0. If a copy of the MPL was not distributed with this\u000A// file, You can obtain one at http://mozilla.org/MPL/2.0/.\u000A"
6+
- type: commit
7+
spec:
8+
dco: true
9+
gpg:
10+
required: true
11+
identity:
12+
gitHubOrganization: siderolabs
13+
spellcheck:
14+
locale: US
15+
maximumOfOneCommit: true
16+
header:
17+
length: 89
18+
imperative: true
19+
case: lower
20+
invalidLastCharacters: .
21+
body:
22+
required: true
23+
conventional:
24+
types:
25+
- chore
26+
- docs
27+
- perf
28+
- refactor
29+
- style
30+
- test
31+
- release
32+
scopes:
33+
- .*
34+
- type: license
35+
spec:
36+
root: .
37+
skipPaths:
38+
- .git/
39+
- testdata/
40+
includeSuffixes:
41+
- .go
42+
excludeSuffixes:
43+
- .pb.go
44+
- .pb.gw.go
45+
header: |
46+
// This Source Code Form is subject to the terms of the Mozilla Public
47+
// License, v. 2.0. If a copy of the MPL was not distributed with this
48+
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

.github/workflows/ci.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-10-30T17:28:15Z by kres latest.
3+
# Generated on 2024-03-05T05:52:53Z by kres latest.
44

55
name: default
66
concurrency:
@@ -22,17 +22,16 @@ jobs:
2222
permissions:
2323
actions: read
2424
contents: write
25+
issues: read
2526
packages: write
2627
pull-requests: read
2728
runs-on:
2829
- self-hosted
2930
- generic
3031
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
31-
outputs:
32-
labels: ${{ steps.workflow-run-info.outputs.pullRequestLabels }}
3332
services:
3433
buildkitd:
35-
image: moby/buildkit:v0.12.2
34+
image: moby/buildkit:v0.12.5
3635
options: --privileged
3736
ports:
3837
- 1234:1234
@@ -50,6 +49,7 @@ jobs:
5049
with:
5150
driver: remote
5251
endpoint: tcp://localhost:1234
52+
timeout-minutes: 1
5353
- name: base
5454
run: |
5555
make base
@@ -90,11 +90,6 @@ jobs:
9090
REGISTRY: registry.dev.siderolabs.io
9191
run: |
9292
make integration
93-
- name: Retrieve workflow info
94-
id: workflow-run-info
95-
uses: potiuk/get-workflow-origin@v1_5
96-
with:
97-
token: ${{ secrets.GITHUB_TOKEN }}
9893
- name: Generate Checksums
9994
if: startsWith(github.ref, 'refs/tags/')
10095
run: |

.github/workflows/slack-notify.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-10-30T17:28:15Z by kres latest.
3+
# Generated on 2024-03-05T05:52:53Z by kres latest.
44

55
name: slack-notify
66
"on":
@@ -14,14 +14,15 @@ jobs:
1414
runs-on:
1515
- self-hosted
1616
- generic
17-
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
17+
if: github.event.workflow_run.conclusion != 'skipped'
1818
steps:
19-
- name: Retrieve Workflow Run Info
20-
id: retrieve-workflow-run-info
21-
uses: potiuk/get-workflow-origin@v1_5
22-
with:
23-
sourceRunId: ${{ github.event.workflow_run.id }}
24-
token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Get PR number
20+
id: get-pr-number
21+
if: github.event.workflow_run.event == 'pull_request'
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
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
2526
- name: Slack Notify
2627
uses: slackapi/slack-github-action@v1
2728
with:
@@ -38,7 +39,7 @@ jobs:
3839
"fields": [
3940
{
4041
"type": "mrkdwn",
41-
"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.retrieve-workflow-run-info.outputs.pullRequestNumber, github.event.workflow_run.display_title) || format('*Build:* {0}#{1} (`{2}`)', github.repository, github.sha, github.ref_name) }}"
42+
"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) }}"
4243
},
4344
{
4445
"type": "mrkdwn",

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-10-30T17:28:15Z by kres latest.
3+
# Generated on 2024-03-05T05:52:53Z by kres latest.
44

55
# options for analysis running
66
run:
@@ -74,8 +74,6 @@ linters-settings:
7474
govet:
7575
check-shadowing: true
7676
enable-all: true
77-
disable:
78-
- loopclosure
7977
lll:
8078
line-length: 200
8179
tab-width: 4
@@ -153,6 +151,7 @@ linters:
153151
- inamedparam
154152
- testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1)
155153
- protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature
154+
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
156155
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
157156
- interfacer
158157
- maligned

.kres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
---
2727
kind: service.CodeCov
2828
spec:
29-
targetThreshold: 7
29+
targetThreshold: 1
3030
---
3131
kind: golang.Generate
3232
spec:

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2023-10-30T17:28:15Z by kres latest.
5+
# Generated on 2024-03-05T05:52:53Z by kres latest.
66

77
ARG TOOLCHAIN
88

9-
FROM ghcr.io/siderolabs/ca-certificates:v1.6.0-alpha.0-10-gd3d7d29 AS image-ca-certificates
9+
FROM ghcr.io/siderolabs/ca-certificates:v1.6.0 AS image-ca-certificates
1010

11-
FROM ghcr.io/siderolabs/fhs:v1.6.0-alpha.0-10-gd3d7d29 AS image-fhs
11+
FROM ghcr.io/siderolabs/fhs:v1.6.0 AS image-fhs
1212

1313
# runs markdownlint
14-
FROM docker.io/node:20.8.0-alpine3.18 AS lint-markdown
14+
FROM docker.io/node:21.6.2-alpine3.19 AS lint-markdown
1515
WORKDIR /src
16-
RUN npm i -g markdownlint-cli@0.37.0
16+
RUN npm i -g markdownlint-cli@0.39.0
1717
1818
COPY .markdownlint.json .
1919
COPY ./CHANGELOG.md ./CHANGELOG.md

Makefile

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-10-30T17:28:15Z by kres latest.
3+
# Generated on 2024-03-05T05:52:53Z by kres latest.
44

55
# common variables
66

@@ -14,20 +14,19 @@ WITH_RACE ?= false
1414
REGISTRY ?= ghcr.io
1515
USERNAME ?= siderolabs
1616
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
17-
PROTOBUF_GO_VERSION ?= 1.31.0
17+
PROTOBUF_GO_VERSION ?= 1.32.0
1818
GRPC_GO_VERSION ?= 1.3.0
19-
GRPC_GATEWAY_VERSION ?= 2.18.0
20-
VTPROTOBUF_VERSION ?= 0.5.0
21-
DEEPCOPY_VERSION ?= v0.5.5
22-
GOLANGCILINT_VERSION ?= v1.55.1
23-
GOFUMPT_VERSION ?= v0.5.0
24-
GO_VERSION ?= 1.21.3
25-
GOIMPORTS_VERSION ?= v0.14.0
19+
GRPC_GATEWAY_VERSION ?= 2.19.1
20+
VTPROTOBUF_VERSION ?= 0.6.0
21+
DEEPCOPY_VERSION ?= v0.5.6
22+
GOLANGCILINT_VERSION ?= v1.56.2
23+
GOFUMPT_VERSION ?= v0.6.0
24+
GO_VERSION ?= 1.22.0
25+
GOIMPORTS_VERSION ?= v0.18.0
2626
GO_BUILDFLAGS ?=
2727
GO_LDFLAGS ?=
2828
CGO_ENABLED ?= 0
2929
GOTOOLCHAIN ?= local
30-
GOEXPERIMENT ?= loopvar
3130
TESTPKGS ?= ./...
3231
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
3332
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest
@@ -65,7 +64,7 @@ COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)"
6564
COMMON_ARGS += --build-arg=GOIMPORTS_VERSION="$(GOIMPORTS_VERSION)"
6665
COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)"
6766
COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)"
68-
TOOLCHAIN ?= docker.io/golang:1.21-alpine
67+
TOOLCHAIN ?= docker.io/golang:1.22-alpine
6968

7069
# extra variables
7170

@@ -92,6 +91,23 @@ To create a builder instance, run:
9291

9392
docker buildx create --name local --use
9493

94+
If running builds that needs to be cached aggresively create a builder instance with the following:
95+
96+
docker buildx create --name local --use --config=config.toml
97+
98+
config.toml contents:
99+
100+
[worker.oci]
101+
gc = true
102+
gckeepstorage = 50000
103+
104+
[[worker.oci.gcpolicy]]
105+
keepBytes = 10737418240
106+
keepDuration = 604800
107+
filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"]
108+
[[worker.oci.gcpolicy]]
109+
all = true
110+
keepBytes = 53687091200
95111

96112
If you already have a compatible builder instance, you may use that instead.
97113

@@ -113,7 +129,7 @@ endif
113129
ifneq (, $(filter $(WITH_DEBUG), t true TRUE y yes 1))
114130
GO_BUILDFLAGS += -tags sidero.debug
115131
else
116-
GO_LDFLAGS += -s -w
132+
GO_LDFLAGS += -s
117133
endif
118134

119135
all: unit-tests bldr image-bldr integration.test integration lint
@@ -140,7 +156,7 @@ lint-gofumpt: ## Runs gofumpt linter.
140156
.PHONY: fmt
141157
fmt: ## Formats the source code
142158
@docker run --rm -it -v $(PWD):/src -w /src golang:$(GO_VERSION) \
143-
bash -c "export GOEXPERIMENT=loopvar; export GOTOOLCHAIN=local; \
159+
bash -c "export GOTOOLCHAIN=local; \
144160
export GO111MODULE=on; export GOPROXY=https://proxy.golang.org; \
145161
go install mvdan.cc/gofumpt@$(GOFUMPT_VERSION) && \
146162
gofumpt -w ."
@@ -222,7 +238,7 @@ integration: integration.test bldr
222238
.PHONY: rekres
223239
rekres:
224240
@docker pull $(KRES_IMAGE)
225-
@docker run --rm --net=host -v $(PWD):/src -w /src -e GITHUB_TOKEN $(KRES_IMAGE)
241+
@docker run --rm --net=host --user $(shell id -u):$(shell id -g) -v $(PWD):/src -w /src -e GITHUB_TOKEN $(KRES_IMAGE)
226242

227243
.PHONY: help
228244
help: ## This help menu.

cmd/bldr/cmd/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var evalCmd = &cobra.Command{
2727
Variables are looked up for the target specified as the '--target' flag.'.
2828
`,
2929
Args: cobra.ExactArgs(1),
30-
Run: func(cmd *cobra.Command, args []string) {
30+
Run: func(_ *cobra.Command, args []string) {
3131
context := options.GetVariables().Copy()
3232

3333
for _, buildArg := range evalCmdFlags.buildArgs {

cmd/bldr/cmd/frontend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Run with:
3030
3131
docker buildx build -f ./Pkgfile --target <target> .
3232
`,
33-
Run: func(cmd *cobra.Command, args []string) {
33+
Run: func(_ *cobra.Command, _ []string) {
3434
if err := grpcclient.RunFromEnvironment(
3535
appcontext.Context(),
3636
func(ctx context.Context, c client.Client) (*client.Result, error) {

0 commit comments

Comments
 (0)