Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ngc signing job for auto signing #32

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

shivakunv
Copy link
Contributor

.nvidia-ci.yml Show resolved Hide resolved
.nvidia-ci.yml Show resolved Hide resolved
.nvidia-ci.yml Outdated Show resolved Hide resolved
.nvidia-ci.yml Outdated
needs:
- release:ngc-ubuntu20.04

sign:ngc-rhcos4.9:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use a matrix so that we have one sign:ngc-rhcos job and we specify a matrix of RHCOS_VERSIONS (e.g. 4.9, 4.10, ...)? The same suggestion applies for the rhel jobs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may require us to also parallelize the release:ngc-rhcos jobs using similar logic. If required we can improve this in a follow-up.

Copy link
Contributor Author

@shivakunv shivakunv Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added : ubuntu 22.04, 20.04 , rhcos and rhel in parallel matrix .
@cdesiniotis

@shivakunv shivakunv force-pushed the ngc_signing_job branch 2 times, most recently from b7c18a5 to 85366a1 Compare July 12, 2024 13:58
@shivakunv shivakunv requested review from elezar and cdesiniotis July 12, 2024 14:21
.nvidia-ci.yml Outdated Show resolved Hide resolved
.nvidia-ci.yml Outdated Show resolved Hide resolved
.nvidia-ci.yml Outdated Show resolved Hide resolved
@shivakunv
Copy link
Contributor Author

@tariq1890 @cdesiniotis @elezar

I have tested some new changes to remove hardcoded value for DRIVER VERSION:
https://gitlab-master.nvidia.com/dl/container-dev/driver/-/merge_requests/23

summary : added setup stage to set the env

stages:
  **- setup**
  - trigger
  - image-build
  - test
  - scan
  - release
  - sign

setup_env:
  stage: setup
  script:
    - apk add --no-cache bash
    - |
      # Ensure compatibility with /bin/sh by using POSIX-compliant syntax
      set -e  # Exit immediately if a command exits with a non-zero status
      IFS=' ' # Set IFS to space

      # Split DRIVER_VERSIONS into individual versions
      i=1  # Initialize a counter
      for version in $DRIVER_VERSIONS; do
        # Construct variable name dynamically
        version_var="DRIVER_VERSION$i"
        echo "$version_var=$version"
        echo "$version_var=$version" >> setup_env.env
        i=$((i + 1))  # Increment counter
      done
    - cat setup_env.env  # Print the contents of setup_env.env for debugging
    - ls -l
  artifacts:
    reports:
      dotenv: setup_env.env
sign:ngc-ubuntu-rhel-rhcos:
  extends:
    - .sign:ngc
  parallel:
    matrix:
      - SIGN_JOB_NAME: ["ubuntu"]
        VERSION: ["22.04"]
        DRIVER_VERSION: ["$DRIVER_VERSION2", "$DRIVER_VERSION3"]
      - SIGN_JOB_NAME: ["ubuntu"]
        VERSION: ["20.04"]
        DRIVER_VERSION: ["$DRIVER_VERSION1", "$DRIVER_VERSION2", "$DRIVER_VERSION3"]
      - SIGN_JOB_NAME: ["rhel"]
        VERSION: ["8.6", "8.7", "8.8", "8.9", "8.10"]
        DRIVER_VERSION: ["$DRIVER_VERSION1", "$DRIVER_VERSION2", "$DRIVER_VERSION3"]
      - SIGN_JOB_NAME: ["rhcos"]
        VERSION: ["4.9", "4.10", "4.11", "4.12", "4.13", "4.14", "4.15"]
        DRIVER_VERSION: ["$DRIVER_VERSION1", "$DRIVER_VERSION2", "$DRIVER_VERSION3"]
  rules:
    - when: always
      variables:
        DIST: "$SIGN_JOB_NAME${VERSION}"
  needs:
    - setup_env

Please suggest what should be done:

If you are okay with this change, I will merge these changes into the current PR.
or

I will create a separate Jira ticket for this. I'll remove all hardcoded values and import the DRIVER_VERSION, VERSION, etc., and add them to the setup stage, which can override the current values. In this case, we will have to change only one file or import the pipeline variable from the GitHub variable.

@shivakunv shivakunv force-pushed the ngc_signing_job branch 2 times, most recently from 0f0ffc3 to 2a1cd15 Compare July 17, 2024 13:28
@shivakunv
Copy link
Contributor Author

added conditional run with commit tag

Signed-off-by: shiva kumar <shivaku@nvidia.com>
@shivakunv
Copy link
Contributor Author

moved :
rules:
- if: $CI_COMMIT_TAG
variables:
DIST: "${SIGN_JOB_NAME}${VERSION}"

inside .sign:ngc as @cdesiniotis comments :
NVIDIA/k8s-driver-manager#35 (comment)

@cdesiniotis
Copy link
Contributor

@shivakunv I am fine with the current approach. We can always improve this in a follow-up.

@cdesiniotis cdesiniotis merged commit 3821c55 into NVIDIA:main Aug 1, 2024
7 checks passed
@shivakunv shivakunv deleted the ngc_signing_job branch August 2, 2024 07:36
shivakunv pushed a commit to shivakunv/gpu-driver-container that referenced this pull request Aug 12, 2024
add ngc signing job for auto signing
shivakunv pushed a commit to shivakunv/gpu-driver-container that referenced this pull request Aug 13, 2024
add ngc signing job for auto signing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants