-
Notifications
You must be signed in to change notification settings - Fork 203
ci: verify ecp-elastic-agent-service image is multiarch #11498
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
Draft
rubenruizdegauna
wants to merge
8
commits into
elastic:main
Choose a base branch
from
rubenruizdegauna:verify_multiarch_image
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.
+97
−3
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6ae509c
ci: verify ecp-elastic-agent-service image is multiarch
rubenruizdegauna 36c8137
add agentless bk files to CODEOWNERS
rubenruizdegauna a7371a6
fix typo in codeowners
rubenruizdegauna f83789a
do not start the agentless-tests if the 1st step fails
rubenruizdegauna 01e00b5
install yq
rubenruizdegauna f6432ab
use custom image. simplify script
rubenruizdegauna 2072b50
disable test running just to test the 1st step
rubenruizdegauna cebd2b6
fix agent
rubenruizdegauna 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
82 changes: 82 additions & 0 deletions
82
.buildkite/scripts/steps/validate-agentless-docker-image.sh
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,82 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # ELASTICSEARCH CONFIDENTIAL | ||
| # __________________ | ||
| # | ||
| # Copyright Elasticsearch B.V. All rights reserved. | ||
| # | ||
| # NOTICE: All information contained herein is, and remains | ||
| # the property of Elasticsearch B.V. and its suppliers, if any. | ||
| # The intellectual and technical concepts contained herein | ||
| # are proprietary to Elasticsearch B.V. and its suppliers and | ||
| # may be covered by U.S. and Foreign Patents, patents in | ||
| # process, and are protected by trade secret or copyright | ||
| # law. Dissemination of this information or reproduction of | ||
| # this material is strictly forbidden unless prior written | ||
| # permission is obtained from Elasticsearch B.V. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| PRIVATE_REPO="docker.elastic.co/observability-ci/ecp-elastic-agent-service" | ||
| REQUIRED_ARCHITECTURES=("amd64" "arm64") | ||
|
|
||
| _SELF=$(dirname "$0") | ||
| source "${_SELF}/../common.sh" | ||
|
|
||
| if [ -z "$SERVICE_VERSION" ]; then | ||
| echo "No SHA found for environment: $ENVIRONMENT" | ||
| exit 1 | ||
| fi | ||
|
|
||
| DOCKER_TAG="git-${SERVICE_VERSION}" | ||
| PRIVATE_IMAGE="${PRIVATE_REPO}:${DOCKER_TAG}" | ||
|
|
||
| echo "Environment: ${ENVIRONMENT}" | ||
| echo "Commit SHA: ${SERVICE_VERSION}" | ||
| echo "Validating image: ${PRIVATE_IMAGE}" | ||
|
|
||
| # Inspect the manifest to get architecture information | ||
| echo "--- :mag: Inspecting image manifest" | ||
| MANIFEST_OUTPUT=$(skopeo inspect docker://"${PRIVATE_IMAGE}" --raw 2>&1) || { | ||
| echo "Failed to inspect manifest for image: ${PRIVATE_IMAGE}" | ||
| echo "Error: ${MANIFEST_OUTPUT}" | ||
| exit 1 | ||
| } | ||
|
|
||
| echo "Manifest retrieved successfully" | ||
|
|
||
| # Extract architectures from the manifest | ||
| FOUND_ARCHITECTURES=$(echo "$MANIFEST_OUTPUT" | jq -r '.manifests[]?.platform.architecture // empty' | sort -u) | ||
|
|
||
| if [ -z "$FOUND_ARCHITECTURES" ]; then | ||
| echo "No architectures found in manifest. This might be a single-architecture image." | ||
| echo "Manifest content:" | ||
| echo "$MANIFEST_OUTPUT" | jq . | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Found architectures in image:" | ||
| echo "$FOUND_ARCHITECTURES" | ||
|
|
||
| # Validate that all required architectures are present | ||
| echo "--- :white_check_mark: Validating required architectures" | ||
| MISSING_ARCHITECTURES=() | ||
|
|
||
| for arch in "${REQUIRED_ARCHITECTURES[@]}"; do | ||
| if echo "$FOUND_ARCHITECTURES" | grep -qw "$arch"; then | ||
| echo "✓ Architecture '$arch' is present" | ||
| else | ||
| echo "✗ Architecture '$arch' is MISSING" | ||
| MISSING_ARCHITECTURES+=("$arch") | ||
| fi | ||
| done | ||
|
|
||
| if [ ${#MISSING_ARCHITECTURES[@]} -gt 0 ]; then | ||
| echo "" | ||
| echo "ERROR: Image ${PRIVATE_IMAGE} is missing required architectures: ${MISSING_ARCHITECTURES[*]}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "SUCCESS: Image ${PRIVATE_IMAGE} contains all required architectures (${REQUIRED_ARCHITECTURES[*]})" | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we add an entry in the CODEOWNERS with the team responsible for this script and probably .buildkite/pipeline.agentless-tests.yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Added in 36c8137