Compare commits

...

4 Commits

Author SHA1 Message Date
Aurélien Bombo
d78c170a55 gha: Pin actionlint version
Pin to the latest released version as a security measure.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2026-03-23 12:35:34 -05:00
Aurélien Bombo
8117f4e998 gha: Avoid pesky deployment logs in PRs
GitHub recently announced that developers can now use environments without
auto-deployment, which allows us to avoid the noisy deployment logs in our
PRs:

https://github.blog/changelog/2026-03-19-github-actions-late-march-2026-updates/#github-actions-now-allows-developers-to-use-environments-without-auto-deployment

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2026-03-23 12:10:07 -05:00
Steve Horsman
2728b493d5 Merge pull request #12681 from manuelh-dev/mahuber/ci-pip-py-venv
tests: cc: setup function for python venv
2026-03-23 14:33:30 +00:00
Manuel Huber
5765bc97b4 tests: cc: setup function for python venv
We recently had a failure on a new CI runner where
${HOME}/.cicd/venv/bin/activate was not present. The relevant call
originated from ensure_sev_snp_measure. Thus, add a function
ensure_cicd_python_venv before callers to pip install.
Currently, the NVIDIA NIM test and the confidential attestation
tests use pip to install dependencies.

Signed-off-by: Manuel Huber <manuelh@nvidia.com>
2026-03-18 17:07:47 -07:00
8 changed files with 42 additions and 21 deletions

View File

@@ -23,3 +23,5 @@ jobs:
- name: Run actionlint
uses: raven-actions/actionlint@e01d1ea33dd6a5ed517d95b4c0c357560ac6f518 # v2.1.1
with:
version: '1.7.11'

View File

@@ -12,7 +12,9 @@ jobs:
runs-on: ubuntu-22.04
permissions:
id-token: write # Used for OIDC access to log into Azure
environment: ci
environment:
name: ci
deployment: false
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:

View File

@@ -58,7 +58,9 @@ jobs:
permissions:
contents: read
id-token: write # Used for OIDC access to log into Azure
environment: ci
environment:
name: ci
deployment: false
env:
DOCKER_REGISTRY: ${{ inputs.registry }}
DOCKER_REPO: ${{ inputs.repo }}

View File

@@ -55,7 +55,9 @@ jobs:
permissions:
id-token: write # Used for OIDC access to log into Azure
environment: ci
environment:
name: ci
deployment: false
env:
DOCKER_REGISTRY: ${{ inputs.registry }}
DOCKER_REPO: ${{ inputs.repo }}

View File

@@ -144,7 +144,9 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: read
environment: ci
environment:
name: ci
deployment: false
env:
DOCKER_REGISTRY: ${{ inputs.registry }}
DOCKER_REPO: ${{ inputs.repo }}
@@ -269,7 +271,9 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: read
environment: ci
environment:
name: ci
deployment: false
env:
DOCKER_REGISTRY: ${{ inputs.registry }}
DOCKER_REPO: ${{ inputs.repo }}
@@ -379,7 +383,9 @@ jobs:
pull-type:
- default
runs-on: ubuntu-24.04
environment: ci
environment:
name: ci
deployment: false
env:
DOCKER_REGISTRY: ${{ inputs.registry }}
DOCKER_REPO: ${{ inputs.repo }}

View File

@@ -48,7 +48,9 @@ jobs:
- host_os: cbl-mariner
vmm: clh
runs-on: ubuntu-22.04
environment: ci
environment:
name: ci
deployment: false
permissions:
id-token: write # Used for OIDC access to log into Azure
env:

View File

@@ -272,12 +272,29 @@ kbs_uninstall_cli() {
fi
}
# Ensure ~/.cicd/venv exists and activate it in the current shell.
ensure_cicd_python_venv() {
local venv_path="${HOME}/.cicd/venv"
if [[ ! -f "${venv_path}/bin/activate" ]]; then
# NIM tests need Python 3.10 via pyenv; attestation uses system python3. Both are fine.
if command -v pyenv &>/dev/null; then
export PYENV_ROOT="${HOME}/.pyenv"
[[ -d "${PYENV_ROOT}/bin" ]] && export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init - bash)"
fi
mkdir -p "${HOME}/.cicd"
python3 -m venv "${venv_path}"
fi
# shellcheck disable=SC1091
source "${venv_path}/bin/activate"
}
# Ensure the sev-snp-measure utility is installed.
#
ensure_sev_snp_measure() {
command -v sev-snp-measure >/dev/null && return
source "${HOME}"/.cicd/venv/bin/activate
ensure_cicd_python_venv
pip install sev-snp-measure
}

View File

@@ -70,8 +70,7 @@ NGC_API_KEY_SEALED_SECRET_EMBEDQA_BASE64=$(echo -n "${NGC_API_KEY_SEALED_SECRET_
export NGC_API_KEY_SEALED_SECRET_EMBEDQA_BASE64
setup_langchain_flow() {
# shellcheck disable=SC1091 # Sourcing virtual environment activation script
source "${HOME}"/.cicd/venv/bin/activate
ensure_cicd_python_venv
pip install --upgrade pip
[[ "$(pip show langchain 2>/dev/null | awk '/^Version:/{print $2}')" = "0.2.5" ]] || pip install langchain==0.2.5
@@ -177,13 +176,6 @@ setup_file() {
dpkg -s jq >/dev/null 2>&1 || sudo apt -y install jq
export PYENV_ROOT="${HOME}/.pyenv"
[[ -d ${PYENV_ROOT}/bin ]] && export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init - bash)"
# shellcheck disable=SC1091 # Virtual environment will be created during test execution
python3 -m venv "${HOME}"/.cicd/venv
setup_langchain_flow
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
@@ -262,8 +254,6 @@ setup_file() {
QUESTION="What is the capital of France?"
ANSWER="The capital of France is Paris."
# shellcheck disable=SC1091 # Sourcing virtual environment activation script
source "${HOME}"/.cicd/venv/bin/activate
# shellcheck disable=SC2031 # Variables are used in heredoc, not subshell
cat <<EOF >"${HOME}"/.cicd/venv/langchain_nim.py
from langchain_nvidia_ai_endpoints import ChatNVIDIA
@@ -295,8 +285,6 @@ EOF
# shellcheck disable=SC2031 # Variables are shared via file between BATS tests
[[ -n "${MODEL_NAME}" ]]
# shellcheck disable=SC1091 # Sourcing virtual environment activation script
source "${HOME}"/.cicd/venv/bin/activate
cat <<EOF >"${HOME}"/.cicd/venv/langchain_nim_kata_rag.py
import os
from langchain.chains import ConversationalRetrievalChain, LLMChain