Skip to content

Commit

Permalink
Merge pull request #36 from rh-ecosystem-edge/update-config-files
Browse files Browse the repository at this point in the history
Update config files
  • Loading branch information
enriquebelarte authored Feb 6, 2025
2 parents 3df3e49 + 6808efe commit 16b78a2
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Crawl and build from matrix
run: python scripts/check-changes.py
run: python scripts/check_changes.py
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/create-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Get kernel list
run: python scripts/kernels.py
- name: Update matrix file
run: python scripts/re-matrix.py
run: python scripts/re_matrix.py
- name: Commit kernel list updates
run: |
git config user.name "github-actions[bot]"
Expand Down
4 changes: 2 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ RUN dnf -y install git git-lfs xz && \
rm -rf /var/cache/yum
RUN --mount=type=secret,id=${AUTH_SECRET}/PRIVATE_GITLAB_TOKEN echo "export PRIVATE_GITLAB_TOKEN="$(cat /run/secrets/${AUTH_SECRET}/PRIVATE_GITLAB_TOKEN) >> /tmp/envfile
RUN source /tmp/envfile && \
git clone https://gitlab-ci-token:${PRIVATE_GITLAB_TOKEN}@gitlab.com/ebelarte/artifact-storage.git && \
git clone https://gitlab-ci-token:${PRIVATE_GITLAB_TOKEN}@${UPLOAD_ARTIFACT_REPO} && \
cd artifact-storage && \
git lfs install && \
git lfs track "*.tar.xz" && \
git remote set-url origin "https://gitlab-ci-token:${PRIVATE_GITLAB_TOKEN}@gitlab.com/ebelarte/artifact-storage.git" && \
git remote set-url origin "https://gitlab-ci-token:${PRIVATE_GITLAB_TOKEN}@{UPLOAD_ARTIFACT_REPO}" && \
git config --global user.email "[email protected]" && \
git config --global user.name "CI build LFS bot" && \
tar -cvJf ${DRIVER_VENDOR}-${DRIVER_VERSION}-${KERNEL_VERSION}.tar.xz /opt/drivers && \
Expand Down
13 changes: 8 additions & 5 deletions argfile.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
DRIVER_REPO=https://github.com/NVIDIA/open-gpu-kernel-modules.git
DRIVER_VERSION=565.77
DRIVER_VENDOR=nvidia-opengpu
ADDITIONAL_BUILD_DEPS=gcc-c++
DTK_IMAGE=quay.io/redhat-user-workloads/partners-kmod-accel-tenant/pa-driver-toolkit:ee183d162f9f41f83be39c4b362165e0eec8051f
DRIVER_IMAGE=registry.redhat.io/ubi9/ubi@sha256:b632d0cc6263372a90e9097dcac0a369e456b144a66026b9eac029a22f0f6e07
ADDITIONAL_BUILD_DEPS=gcc-c++
SIGNER_SDK_IMAGE=quay.io/redhat-user-workloads/partners-kmod-accel-tenant/klerk:75ad7b90c81b5056b69ff5407a3a2e218d4bbdbc
DRIVER_IMAGE=registry.redhat.io/ubi9/ubi@sha256:b632d0cc6263372a90e9097dcac0a369e456b144a66026b9eac029a22f0f6e07
# AWS settings
AWS_DEFAULT_REGION=us-east-1
AUTH_SECRET=external-auth-secret
AWS_KMS_KEY_LABEL=my-test-key
# Vendor settings
DRIVER_VER_JSON=https://raw.githubusercontent.com/rh-ecosystem-edge/build-and-sign/refs/heads/main/data/driver-list.json
DRIVER_REPO=https://github.com/NVIDIA/open-gpu-kernel-modules.git
DRIVER_VERSION=565.77
DRIVER_VENDOR=nvidia-opengpu
UPLOAD_ARTIFACT_REPO=gitlab.com/ebelarte/artifact-storage.git
1 change: 0 additions & 1 deletion scripts/check-changes.py → scripts/check_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import requests
import os

# File paths
matrix_json_file = "data/combined_output.json"
argsfile = "argfile.conf"
token = os.getenv("TOKEN")
Expand Down
File renamed without changes.
11 changes: 10 additions & 1 deletion scripts/re-matrix.py → scripts/re_matrix.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import json
import os
import md5mod
import urllib.request
import read_argfile

# Download driver_info_file from argfile.conf
config = read_argfile.read_key_value_file()
DRIVER_VER_JSON = config.get("DRIVER_VER_JSON", "Key 'DRIVER_VER_JSON' not found.")
download_dir = "vendor"
os.makedirs(download_dir, exist_ok=True)

# Sources for kernel versions and driver versions
driver_info_file = "data/driver-list.json"
driver_info_file = read_argfile.download_file(DRIVER_VER_JSON, os.path.join(download_dir, os.path.basename(DRIVER_VER_JSON))) if DRIVER_VER_JSON.startswith("http") else "Invalid URL"
#driver_info_file = "data/driver-list.json"
kernel_versions_file = "data/kernel-list.json"
matrix_file = "data/combined_output.json"

Expand Down
19 changes: 19 additions & 0 deletions scripts/read_argfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import urllib.request

def read_key_value_file(filename="argfile.conf"):
data = {}
with open(filename, "r") as file:
for line in file:
line = line.strip()
if line and "=" in line:
key, value = line.split("=", 1)
data[key.strip()] = value.strip()
return data

def download_file(url, save_path):
try:
urllib.request.urlretrieve(url, save_path)
return save_path
except Exception as e:
return f"Error downloading file: {e}"

0 comments on commit 16b78a2

Please sign in to comment.