Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .github/copy-pr-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/#configuration

enabled: true
25 changes: 13 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,31 @@

version: 2
updates:
# main branch
- package-ecosystem: "gomod"
target-branch: main
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
ignore:
- dependency-name: k8s.io/*
labels:
- dependencies
groups:
k8sio:
patterns:
- k8s.io/*
exclude-patterns:
- k8s.io/klog/*

- package-ecosystem: "github-actions"
- package-ecosystem: "docker"
target-branch: main
directory: "/"
directories:
# GPU mockctl image
- "/deployments/devel/gpu-mock/container"
# Other development images
- "/deployments/devel"
schedule:
interval: "daily"
labels:
- dependencies

# A dependabot rule to bump the runner version
- package-ecosystem: "docker"
target-branch: main
directory: "/images/gh_runner"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
42 changes: 42 additions & 0 deletions .github/workflows/basic-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2025 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "basic checks"

on:
workflow_call:
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*

jobs:
variables:
uses: ./.github/workflows/variables.yaml

golang:
needs:
- variables
uses: ./.github/workflows/golang.yaml
with:
golang_version: ${{ needs.variables.outputs.golang_version }}

code-scanning:
needs:
- variables
uses: ./.github/workflows/code_scanning.yaml
with:
golang_version: ${{ needs.variables.outputs.golang_version }}
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2025 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI Pipeline

on:
push:
branches:
- "pull-request/[0-9]+"
- main
- release-*

jobs:
variables:
uses: ./.github/workflows/variables.yaml

basic:
uses: ./.github/workflows/basic-checks.yaml
needs:
- variables
secrets: inherit

image:
uses: ./.github/workflows/image.yaml
needs:
- variables
- basic
secrets: inherit
with:
version: ${{ needs.variables.outputs.version }}
golang_version: ${{ needs.variables.outputs.golang_version }}
51 changes: 51 additions & 0 deletions .github/workflows/code_scanning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2025 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "CodeQL"

on:
workflow_call:
inputs:
golang_version:
required: true
type: string

jobs:
analyze:
name: Analyze Go code with CodeQL
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
security-events: write
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.golang_version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: go

- name: Fetch Dependencies
run: go mod download

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:go"
36 changes: 14 additions & 22 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,31 @@
name: Golang

on:
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*
push:
branches:
- main
- release-*
workflow_call:
inputs:
golang_version:
required: true
type: string

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
name: Checkout code
- name: Get Golang version
id: vars
run: |
GOLANG_VERSION=$( grep "GOLANG_VERSION ?=" versions.mk )
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: ${{ env.GOLANG_VERSION }}
go-version: ${{ inputs.golang_version }}

- name: Lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: -v --timeout 5m
skip-cache: true
- name: Check golang modules
run: make check-vendor

- name: Check golang modules
run: |
make check-modules
67 changes: 67 additions & 0 deletions .github/workflows/gpu-mockctl-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2025 NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: GPU Mockctl Image

on:
workflow_call:
inputs:
version:
required: true
type: string
golang_version:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
name: Check out code

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.golang_version }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push gpu-mockctl image
env:
IMAGE: ghcr.io/nvidia/k8s-test-infra/gpu-mockctl
VERSION: ${{ inputs.version }}
PUSH: ${{ github.event_name == 'push' && 'true' || 'false' }}
run: |
cd deployments/devel/gpu-mock
make build-image IMAGE="${IMAGE}:${VERSION}"
if [[ "${PUSH}" == "true" ]]; then
docker push "${IMAGE}:${VERSION}"
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
docker tag "${IMAGE}:${VERSION}" "${IMAGE}:latest"
docker push "${IMAGE}:latest"
fi
fi
Loading