-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[None][infra] Add container scanning to plc nightly pipeline #12549
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
Open
yuanjingx87
wants to merge
14
commits into
NVIDIA:main
Choose a base branch
from
yuanjingx87:user/yuanjingx/plc_pipeline_container_scanning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a4fd056
Add container scanning
yuanjingx87 5637df0
Process Container Scan Result
yuanjingx87 51b4f53
clean up
yuanjingx87 06d6b88
Refactor and add container scanning
yuanjingx87 ace5507
check in local change
yuanjingx87 637342f
Aggretate scan result
yuanjingx87 2f2b388
clean up
yuanjingx87 da92bd6
CLean up
yuanjingx87 2297f54
fix
yuanjingx87 8a9168e
debug
yuanjingx87 2708bbb
Clean up
yuanjingx87 34f02be
Re-enable lockfile generation in PLC pipeline
yuanjingx87 204ab8f
Typo fix
yuanjingx87 b1121c9
[None][infra] Check in most recent lock file from nightly pipeline
tensorrt-cicd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason to make this a Bash script if all the other scripts are Python? |
||
|
|
||
| set -e | ||
|
|
||
| BRANCH_NAME="${1}" | ||
|
|
||
| if [[ -z "$BRANCH_NAME" ]]; then | ||
| echo "Usage: $0 <branch_name>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| JENKINS_BASE="https://prod.blsm.nvidia.com/sw-tensorrt-top-1/job/LLM/job/${BRANCH_NAME}/job/L0_PostMerge" | ||
| ARTIFACTORY_BASE="https://urm.nvidia.com/artifactory/sw-tensorrt-generic-local/llm-artifacts/LLM/${BRANCH_NAME}/L0_PostMerge" | ||
|
|
||
| echo "Fetching latest build number from Jenkins for branch: ${BRANCH_NAME}" >&2 | ||
|
|
||
| # Query Jenkins API for the last successful build number | ||
| BUILD_NUMBER=$(curl -fsSL "${JENKINS_BASE}/lastBuild/api/json" | python3 -c "import json,sys; print(json.load(sys.stdin)['number'])" 2>/dev/null) | ||
|
|
||
| if [[ -z "$BUILD_NUMBER" ]]; then | ||
| echo "Failed to get last successful build number. Trying last completed build..." >&2 | ||
| BUILD_NUMBER=$(curl -fsSL "${JENKINS_BASE}/lastCompletedBuild/api/json" | python3 -c "import json,sys; print(json.load(sys.stdin)['number'])" 2>/dev/null) | ||
| fi | ||
|
|
||
| if [[ -z "$BUILD_NUMBER" ]]; then | ||
| echo "Error: Could not determine the latest build number from ${JENKINS_BASE}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Latest build number: ${BUILD_NUMBER}" >&2 | ||
|
|
||
| while [[ "${BUILD_NUMBER}" -gt 0 ]]; do | ||
| ARTIFACT_URL="${ARTIFACTORY_BASE}/${BUILD_NUMBER}/imageKeyToTag.json" | ||
| echo "Fetching: ${ARTIFACT_URL}" >&2 | ||
| HTTP_STATUS=$(curl -sL -o /tmp/imageKeyToTag.json -w "%{http_code}" "${ARTIFACT_URL}") | ||
| if [[ "${HTTP_STATUS}" == "200" ]]; then | ||
| cat /tmp/imageKeyToTag.json | ||
| exit 0 | ||
| fi | ||
| echo "Got HTTP ${HTTP_STATUS} for build ${BUILD_NUMBER}, trying build $((BUILD_NUMBER - 1))..." >&2 | ||
| BUILD_NUMBER=$((BUILD_NUMBER - 1)) | ||
| done | ||
|
|
||
| echo "Error: Could not find imageKeyToTag.json in any recent build" >&2 | ||
| exit 1 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.