Skip to content

Commit 0b2846b

Browse files
muscarielloparalta
andauthored
feat: stage commit of the OSS CSIT repo (#2)
* feat: stage commit of the OSS CSIT repo This commit introduces the first testing framework which provides integrations for agp in this first commit. Tests runs in k8s locally or in the Github actions runner using king. --------- Signed-off-by: Luca Muscariello <lumuscar@cisco.com> Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> Co-authored-by: Catarina Paralta <46568597+paralta@users.noreply.github.com>
1 parent 575354a commit 0b2846b

File tree

151 files changed

+31107
-578
lines changed

Some content is hidden

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

151 files changed

+31107
-578
lines changed

.cz.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitattributes

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*.7z filter=lfs diff=lfs merge=lfs -text
2+
*.arrow filter=lfs diff=lfs merge=lfs -text
3+
*.bin filter=lfs diff=lfs merge=lfs -text
4+
*.bz2 filter=lfs diff=lfs merge=lfs -text
5+
*.ckpt filter=lfs diff=lfs merge=lfs -text
6+
*.ftz filter=lfs diff=lfs merge=lfs -text
7+
*.gz filter=lfs diff=lfs merge=lfs -text
8+
*.h5 filter=lfs diff=lfs merge=lfs -text
9+
*.joblib filter=lfs diff=lfs merge=lfs -text
10+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
11+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
12+
*.model filter=lfs diff=lfs merge=lfs -text
13+
*.msgpack filter=lfs diff=lfs merge=lfs -text
14+
*.npy filter=lfs diff=lfs merge=lfs -text
15+
*.npz filter=lfs diff=lfs merge=lfs -text
16+
*.onnx filter=lfs diff=lfs merge=lfs -text
17+
*.ot filter=lfs diff=lfs merge=lfs -text
18+
*.parquet filter=lfs diff=lfs merge=lfs -text
19+
*.pb filter=lfs diff=lfs merge=lfs -text
20+
*.pickle filter=lfs diff=lfs merge=lfs -text
21+
*.pkl filter=lfs diff=lfs merge=lfs -text
22+
*.pt filter=lfs diff=lfs merge=lfs -text
23+
*.pth filter=lfs diff=lfs merge=lfs -text
24+
*.rar filter=lfs diff=lfs merge=lfs -text
25+
*.safetensors filter=lfs diff=lfs merge=lfs -text
26+
*.tar.* filter=lfs diff=lfs merge=lfs -text
27+
*.tar filter=lfs diff=lfs merge=lfs -text
28+
*.tflite filter=lfs diff=lfs merge=lfs -text
29+
*.tgz filter=lfs diff=lfs merge=lfs -text
30+
*.wasm filter=lfs diff=lfs merge=lfs -text
31+
*.xz filter=lfs diff=lfs merge=lfs -text
32+
*.zip filter=lfs diff=lfs merge=lfs -text
33+
*.zst filter=lfs diff=lfs merge=lfs -text
34+
*tfevents* filter=lfs diff=lfs merge=lfs -text

.github/CODEOWNERS

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
####################################################
2-
#
3-
# List of approvers for <project-name> project
4-
#
5-
#####################################################
6-
#
7-
# Learn about CODEOWNERS file format:
8-
# https://help.github.com/en/articles/about-code-owners
9-
#
10-
11-
# These owners will be the default owners for everything in
12-
# the repository. Unless a later match takes precedence,
13-
# the following users/teams will be requested for
14-
# review when someone opens a pull request.
15-
* @agntcy/<maintainer-team-name>
16-
17-
# Enforces admin protections for repo configuration via probot settings app.
18-
# ref: https://github.com/probot/settings#security-implications
19-
.github/settings.yml @agntcy/<admin-team-name>
1+
**/ @muscariello @pbalogh-sa

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
---
25
name: Bug Report
36
description: Report a bug to help us improve.

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
---
25
name: Feature Request
36
description: Suggest a feature for this project.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
6+
name: Detect changes
7+
description: Detect changes in as list of directories
8+
inputs:
9+
dirs:
10+
description: 'Directories where to search for changes'
11+
required: true
12+
default: "./"
13+
outputs:
14+
changed-dirs:
15+
description: 'Directories with changes'
16+
value: ${{ steps.detect-changes.outputs.changed-dirs }}
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Detect changes
22+
id: detect-changes
23+
run: |
24+
# Function to get the diff in a directory in case of pr or push event
25+
get_diff() {
26+
dir=${1}
27+
28+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
29+
base_ref="${{ github.event.pull_request.base.sha }}"
30+
head_ref="${{ github.event.pull_request.head.sha }}"
31+
else
32+
# For push to main, compare against the previous commit
33+
base_ref="${{ github.event.before }}"
34+
head_ref="${{ github.sha }}"
35+
fi
36+
37+
git diff --quiet --name-only $base_ref $head_ref -- ${dir}
38+
}
39+
40+
# Check if any of the folder have changed
41+
CHANGED_DIRS=()
42+
for DIR in ${{ inputs.dirs }}; do
43+
if get_diff ${DIR}; then
44+
echo "No changes in ${DIR}"
45+
else
46+
echo "Changes detected in ${DIR}"
47+
CHANGED_DIRS+=($DIR)
48+
fi
49+
done
50+
51+
# Set the output variable
52+
dirs_out=$(echo -n ${CHANGED_DIRS[*]} | jq -R -s -c 'split(" ") | map(select(length > 0))')
53+
echo changed-dirs=${dirs_out} >> $GITHUB_OUTPUT
54+
shell: bash
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
6+
name: Setup Environment
7+
description: setup environment with common tools/vars
8+
inputs:
9+
python:
10+
description: 'Install python'
11+
required: false
12+
default: false
13+
python-version:
14+
description: 'Python version to install'
15+
required: false
16+
default: '3.12'
17+
go:
18+
description: 'Install golang'
19+
required: false
20+
default: false
21+
go-version:
22+
description: 'Go version to install'
23+
required: false
24+
default: '1.23.1'
25+
26+
runs:
27+
using: "composite"
28+
steps:
29+
- name: Setup Taskfile
30+
shell: bash
31+
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
32+
33+
- name: Setup Python
34+
if: ${{ inputs.python == 'true' }}
35+
uses: ./.github/actions/setup-python
36+
with:
37+
py-version: ${{ inputs.python-version }}
38+
39+
- name: Setup Golang
40+
if: ${{ inputs.go == 'true' }}
41+
uses: ./.github/actions/setup-go
42+
with:
43+
go-version: ${{ inputs.go-version }}
44+
45+
- name: Update GITHUB_PATH
46+
shell: bash
47+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
6+
name: Setup Environment
7+
description: setup environment to build/test/lint go applications
8+
inputs:
9+
go-version:
10+
description: 'Go version to install'
11+
required: false
12+
default: ~1.23
13+
check-latest:
14+
description: 'Check if the cached Go version is the latest one. If the locally cached version is not the most up-to-date, a relevant Go version will then be downloaded.'
15+
required: false
16+
default: true
17+
github-token:
18+
description: 'github token'
19+
required: false
20+
default: ''
21+
go-fips:
22+
description: 'Whether to install GoFIPS'
23+
required: false
24+
default: "false"
25+
outputs:
26+
cache-hit:
27+
description: "Whether we hit the cache"
28+
value: ${{ steps.go-cache.outputs.cache-hit }}
29+
runs:
30+
using: "composite"
31+
steps:
32+
- name: Setup Go
33+
if: ${{ inputs.go-fips != 'true' }}
34+
uses: actions/setup-go@v5
35+
with:
36+
go-version: ${{ inputs.go-version }}
37+
check-latest: ${{ inputs.check-latest }}
38+
cache: false
39+
40+
- name: Setup Go fips
41+
if: ${{ inputs.go-fips == 'true' }}
42+
run: |
43+
# Install GoFIPS
44+
curl -fsSL https://devhub.cisco.com/artifactory/csl-ubuntu-sto/csl-key.gpg | sudo tee /etc/apt/trusted.gpg.d/csm-toolkit.asc
45+
sudo add-apt-repository -y "deb https://devhub.cisco.com/artifactory/csl-ubuntu-sto/ $(lsb_release -cs) main"
46+
sudo apt-get update
47+
sudo apt-get install -y csm-toolkit
48+
sudo /opt/cisco/csm-toolkit/bin/csm-toolkit install gofips
49+
echo 'source /opt/cisco/csm-toolkit/environment/buildtime*' >> ~/.bashrc
50+
echo 'source /opt/cisco/csm-toolkit/environment/buildtime*' >> ~/.shrc
51+
shell: bash
52+
53+
- name: Cache Go
54+
id: go-cache
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
~/go/bin
59+
~/go/pkg/mod
60+
~/gofips/pkg/mod
61+
~/gofips/bin
62+
key: go-cache-${{ inputs.go-fips == 'true' && 'fips' || 'nofips' }}-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
63+
64+
- id: set-cache-hit
65+
run: echo "cache-hit=${{ steps.go-cache.outputs.cache-hit }}" >> $GITHUB_OUTPUT
66+
shell: bash
67+
68+
- name: Update GITHUB_PATH
69+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
70+
shell: bash
71+
72+
- name: Setup access to private go modules
73+
if: ${{ inputs.github-token != '' }}
74+
run: |
75+
git config --global --add url."https://${{ inputs.github-token }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
76+
shell: bash
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
6+
name: Setup Kubernetes tooling
7+
description: Setup Kubernetes tooling
8+
inputs:
9+
helm-version:
10+
description: 'Helm version'
11+
required: false
12+
default: "3.12.1"
13+
helm-ct-version:
14+
description: 'Helm chart-testing version'
15+
required: false
16+
default: "3.11.0"
17+
kind-version:
18+
description: 'Kind version'
19+
required: false
20+
default: "0.24.0"
21+
kind-create-cluster:
22+
description: 'Create kind K8s cluster'
23+
required: false
24+
default: "false"
25+
kind-cluster-name:
26+
description: 'Kind K8s cluster name to create'
27+
required: false
28+
default: "kind"
29+
kind-cluster-gateway:
30+
description: 'Gateway IP to use for kind server nodes. Useful when running actions inside containers.'
31+
required: false
32+
default: "127.0.0.1"
33+
runs:
34+
using: "composite"
35+
steps:
36+
#
37+
# Install kubernetes tools
38+
#
39+
- name: Setup Helm
40+
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
41+
with:
42+
version: ${{ inputs.helm-version }}
43+
44+
- name: Set up Helm chart-testing
45+
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
46+
with:
47+
version: ${{ inputs.helm-ct-version }}
48+
49+
- name: Setup kind
50+
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
51+
with:
52+
version: v${{ inputs.kind-version }}
53+
install_only: true
54+
55+
- name: Setup kubectl
56+
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
57+
58+
#
59+
# Setup cluster
60+
#
61+
- name: Setup Kind cluster
62+
if: ${{ inputs.kind-create-cluster == 'true' }}
63+
shell: bash
64+
run: |
65+
# Create cluster config
66+
KIND_CONFIG_FILE=$(mktemp -p /tmp)
67+
cat <<EOF > $KIND_CONFIG_FILE
68+
kind: Cluster
69+
apiVersion: kind.x-k8s.io/v1alpha4
70+
networking:
71+
apiServerAddress: "${{ inputs.kind-cluster-gateway }}"
72+
apiServerPort: 6443
73+
EOF
74+
75+
# Create cluster
76+
kind create cluster --config $KIND_CONFIG_FILE --name ${{ inputs.kind-cluster-name }}
77+
kubectl cluster-info
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
6+
name: Setup Python Environment
7+
description: setup environment to build/test/lint python applications
8+
inputs:
9+
py-version:
10+
description: 'Python version to install'
11+
required: false
12+
default: "3.12"
13+
py-package-manager:
14+
description: 'Python package manager to use'
15+
required: false
16+
default: "poetry"
17+
py-poetry-version:
18+
description: 'Poetry version to use'
19+
required: false
20+
default: "1.7.1"
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Setup Python
26+
id: setup-python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ inputs.py-version }}
30+
31+
- name: Load cached Poetry Binary
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.local
35+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.py-poetry-version }}
36+
37+
- name: Install Poetry
38+
shell: bash
39+
run: |
40+
if [[ -f ~/.local/bin/poetry ]]; then
41+
echo "Poetry already installed"
42+
else
43+
curl -sSL https://install.python-poetry.org | POETRY_VERSION=${{ inputs.py-poetry-version }} python3 -
44+
fi
45+
46+
- name: Install uv
47+
shell: bash
48+
run: |
49+
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="${HOME}/.local/bin" sh
50+
51+
- name: Load cached venv
52+
uses: actions/cache@v4
53+
with:
54+
path: ~/.cache/pypoetry/virtualenvs
55+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
56+
57+
- name: Update GITHUB_PATH
58+
shell: bash
59+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

0 commit comments

Comments
 (0)