Skip to content

Commit 86ff772

Browse files
committed
feat(import): Initial import of boilerplate content
Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
1 parent 68606b1 commit 86ff772

29 files changed

+1252
-0
lines changed

.github/linters/actionlint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
self-hosted-runner:
2+
labels:
3+
- '*-*-amd64'
4+
- '*-dind-*-amd64'
5+
- '*-*-arm*'
6+
- '*-dind-*-arm*'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
helpUrl: 'https://www.conventionalcommits.org/',
4+
ignores: [
5+
(msg) => /Signed-off-by: dependabot\[bot]/m.test(msg),
6+
],
7+
rules: {
8+
'header-max-length': [2, 'always', 72],
9+
'body-max-line-length': [2, 'always', 80],
10+
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
11+
'trailer-exists': [2, 'always', 'Signed-off-by:'],
12+
},
13+
}

.github/linters/licenserc.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
header:
2+
license:
3+
spdx-id: Apache-2.0-short
4+
copyright-owner: "MLSysOps Consortium"
5+
copyright-year: "2025"
6+
software-name: mlsysops-framework
7+
content: |
8+
Copyright (c) 2023-2025, MLSysOps Consortium
9+
10+
Licensed under the Apache License, Version 2.0 (the "License");
11+
you may not use this file except in compliance with the License.
12+
You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing, software
17+
distributed under the License is distributed on an "AS IS" BASIS,
18+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
See the License for the specific language governing permissions and
20+
limitations under the License.
21+
22+
paths-ignore:
23+
- '**/.*'
24+
- '**/*.md'
25+
- '**/*.txt'
26+
- '**/*.build'
27+
- '**/*.options'
28+
- '**/*.cmake'
29+
- '**/*.cmake.in'
30+
- '**/*.pc.in'
31+
- '**/*.toml'
32+
- '**/*.service'
33+
- '.github'
34+
- '**/go.mod'
35+
- '**/go.sum'
36+
- 'LICENSE'
37+
- 'NOTICE'
38+
- 'VERSION'
39+
- 'build*'
40+
- 'docs/CNAME'
41+
42+
language:
43+
Go:
44+
extensions:
45+
- ".go"
46+
C:
47+
extensions:
48+
- ".c"
49+
CPP:
50+
extensions:
51+
- ".cpp"
52+
bash:
53+
extensions:
54+
- ".sh"
55+
python:
56+
extensions:
57+
- ".py"
58+
59+
comment: on-failure

.github/linters/typos.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"
5+
]
6+
7+
[default.extend-words]
8+
SEH = "SEH"
9+
ser = "ser"
10+
nd = "nd"
11+
12+
[files]
13+
extend-exclude = [
14+
"subprojects/*",
15+
]

.github/workflows/build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
type: string
8+
default: '["base", "dind", "2204"]'
9+
runner-archs:
10+
type: string
11+
default: '["amd64", "arm64"]'
12+
runner-arch-map:
13+
type: string
14+
default: '[{"amd64":"x86_64", "arm64":"aarch64", "arm":"armv7l"}]'
15+
secrets:
16+
GIT_CLONE_PAT:
17+
required: false
18+
19+
#pull_request:
20+
#branches: [ "main" ]
21+
#types:
22+
#- synchronize
23+
#- labeled
24+
25+
workflow_dispatch:
26+
27+
jobs:
28+
build:
29+
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.archconfig) }}
30+
strategy:
31+
matrix:
32+
archconfig: ["${{ fromJSON(inputs.runner-archs) }}"]
33+
fail-fast: false
34+
35+
steps:
36+
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
- name: Display Go version
41+
run: |
42+
go version
43+
44+
- name: Find SHA
45+
run: |
46+
if [[ "${{github.event.pull_request.head.sha}}" != "" ]]
47+
then
48+
echo "ARTIFACT_SHA=$(echo ${{github.event.pull_request.head.ref}})" >> $GITHUB_ENV
49+
else
50+
echo "ARTIFACT_SHA=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Build urunc binaries
54+
run: |
55+
make
56+
57+
- name: Upload urunc_aarch64 to S3
58+
if: matrix.archconfig == 'aarch64'
59+
uses: cloudkernels/minio-upload@v3
60+
with:
61+
url: https://s3.nbfc.io
62+
access-key: ${{ secrets.AWS_ACCESS_KEY }}
63+
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
64+
local-path: dist/urunc_static_arm64
65+
remote-path: nbfc-assets/github/urunc/dist/${{ env.ARTIFACT_SHA }}/${{ matrix.archconfig }}/
66+
policy: 1
67+
68+
- name: Upload urunc_amd64 to S3
69+
if: matrix.archconfig == 'amd64'
70+
uses: cloudkernels/minio-upload@v3
71+
with:
72+
url: https://s3.nbfc.io
73+
access-key: ${{ secrets.AWS_ACCESS_KEY }}
74+
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
75+
local-path: dist/urunc_static_amd64
76+
remote-path: nbfc-assets/github/urunc/dist/${{ env.ARTIFACT_SHA }}/${{ matrix.archconfig }}/
77+
policy: 1
78+
79+
- name: Upload containerd-shim-urunc-v2_aarch64 to S3
80+
if: matrix.archconfig == 'aarch64'
81+
uses: cloudkernels/minio-upload@v3
82+
with:
83+
url: https://s3.nbfc.io
84+
access-key: ${{ secrets.AWS_ACCESS_KEY }}
85+
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
86+
local-path: dist/containerd-shim-urunc-v2_arm64
87+
remote-path: nbfc-assets/github/urunc/dist/${{ env.ARTIFACT_SHA }}/${{ matrix.archconfig }}/
88+
policy: 1
89+
90+
- name: Upload containerd-shim-urunc-v2_amd64 to S3
91+
if: matrix.archconfig == 'amd64'
92+
uses: cloudkernels/minio-upload@v3
93+
with:
94+
url: https://s3.nbfc.io
95+
access-key: ${{ secrets.AWS_ACCESS_KEY }}
96+
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
97+
local-path: dist/containerd-shim-urunc-v2_amd64
98+
remote-path: nbfc-assets/github/urunc/dist/${{ env.ARTIFACT_SHA }}/${{ matrix.archconfig }}/
99+
policy: 1

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
types: [synchronize, labeled, unlabeled]
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
pull-requests: read
15+
contents: read
16+
17+
18+
jobs:
19+
validate-files-and-commits:
20+
name: Lint Files & commits
21+
if: |
22+
contains(github.event.pull_request.labels.*.name, 'ok-to-test') &&
23+
!contains(github.event.pull_request.labels.*.name, 'skip-lint')
24+
uses: ./.github/workflows/validate-files-and-commits.yml
25+
secrets: inherit
26+
27+
lint:
28+
name: Lint code
29+
if: |
30+
contains(github.event.pull_request.labels.*.name, 'ok-to-test') &&
31+
!contains(github.event.pull_request.labels.*.name, 'skip-lint')
32+
uses: ./.github/workflows/lint.yml
33+
secrets: inherit
34+
35+
# build:
36+
# #needs: [validate-files-and-commits, lint]
37+
# name: Build
38+
# if: |
39+
# contains(github.event.pull_request.labels.*.name, 'ok-to-test') &&
40+
# !contains(github.event.pull_request.labels.*.name, 'skip-build')
41+
# uses: ./.github/workflows/build.yml
42+
# secrets: inherit
43+
#
44+
# unit_test:
45+
# #needs: [validate-files-and-commits, lint]
46+
# name: Unit tests
47+
# if: |
48+
# contains(github.event.pull_request.labels.*.name, 'ok-to-test') &&
49+
# !contains(github.event.pull_request.labels.*.name, 'skip-build')
50+
# uses: ./.github/workflows/unit_test.yml
51+
# secrets: inherit
52+
#
53+
# #FIXME: run for arm64
54+
# vm_test:
55+
# needs: [build,unit_test]
56+
# name: E2E test
57+
# if: |
58+
# contains(github.event.pull_request.labels.*.name, 'ok-to-test') &&
59+
# !contains(github.event.pull_request.labels.*.name, 'skip-build')
60+
# uses: ./.github/workflows/vm_test.yml
61+
# secrets: inherit
62+
#

.github/workflows/lint.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Code linting
2+
on:
3+
workflow_call:
4+
inputs:
5+
runner:
6+
type: string
7+
default: '["base", "dind", "2204"]'
8+
runner-archs:
9+
type: string
10+
default: '["amd64"]'
11+
runner-arch-map:
12+
type: string
13+
default: '[{"amd64":"x86_64", "arm64":"aarch64", "arm":"armv7l"}]'
14+
secrets:
15+
GIT_CLONE_PAT:
16+
required: false
17+
18+
permissions:
19+
contents: read
20+
# allow read access to pull request. Use with `only-new-issues` option.
21+
pull-requests: read
22+
23+
jobs:
24+
golangci:
25+
name: lint
26+
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.archconfig) }}
27+
strategy:
28+
matrix:
29+
archconfig: ["${{ fromJSON(inputs.runner-archs) }}"]
30+
fail-fast: false
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-go@v4
34+
with:
35+
go-version: '1.22'
36+
cache: false
37+
- name: golangci-lint
38+
uses: golangci/golangci-lint-action@v3
39+
with:
40+
version: v1.63
41+
42+
# show only new issues if it's a pull request. The default value is `false`.
43+
only-new-issues: true

.github/workflows/stale.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Automatically close stale PRs'
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/stale@v9
12+
with:
13+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.'
14+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.'
15+
close-issue-message: 'This issue was closed because it has been stalled for 75 days with no activity.'
16+
close-pr-message: 'This PR was closed because it has been stalled for 75 days with no activity.'
17+
days-before-issue-stale: 60
18+
days-before-pr-stale: 60
19+
days-before-issue-close: 15
20+
days-before-pr-close: 15
21+
exempt-issue-labels: 'design,dev,enhancement,documentation,bug,feature'

0 commit comments

Comments
 (0)