Skip to content

Commit 8d8de11

Browse files
committed
Revert "Publish elastic-agent-service container directly to serverless from main (#9583)"
This reverts commit 4dcd045.
1 parent 395d0da commit 8d8de11

File tree

3 files changed

+21
-55
lines changed

3 files changed

+21
-55
lines changed

.buildkite/pipeline.agentless-app-release.yaml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,14 @@
11
env:
22
VERSION: "${BUILDKITE_COMMIT:0:12}"
33
steps:
4-
- label: "Packaging: Service Container linux/amd64"
5-
key: packaging-service-container-amd64
6-
env:
7-
PACKAGES: "docker"
8-
PLATFORMS: "linux/amd64"
9-
DOCKER_VARIANTS: "service"
10-
command: |
11-
.buildkite/scripts/steps/integration-package.sh
12-
artifact_paths:
13-
- "build/distributions/elastic-agent-service-git-*.docker.tar.gz"
14-
agents:
15-
provider: "gcp"
16-
machineType: "c2-standard-16"
17-
diskSizeGb: 400
18-
19-
- label: "Packaging: Service Container linux/arm64"
20-
key: packaging-service-container-arm64
21-
env:
22-
PACKAGES: "docker"
23-
PLATFORMS: "linux/arm64"
24-
DOCKER_VARIANTS: "service"
25-
command: |
26-
.buildkite/scripts/steps/integration-package.sh
27-
artifact_paths:
28-
- "build/distributions/elastic-agent-service-git-*.docker.tar.gz"
29-
agents:
30-
provider: "aws"
31-
instanceType: "t4g.2xlarge"
32-
imagePrefix: "core-ubuntu-2204-aarch64"
33-
diskSizeGb: 400
34-
35-
# wait for packaging to be done
36-
- wait: ~
37-
38-
- label: "Publish to internal registry"
4+
- label: "Mirror Elastic-Agent Snapshot DRA to internal registry"
395
key: "mirror-elastic-agent"
406
command: ".buildkite/scripts/steps/ecp-internal-release.sh"
417
agents:
428
image: docker.elastic.co/ci-agent-images/serverless-helm-builder:0.0.2@sha256:d00e8a7a0ab3618cfaacb0a7b1e1b06ee29728eb2b44de602374bd8f6b9b92ac
439

10+
11+
4412
# wait for metadata to be set
4513
- wait: ~
4614

.buildkite/pipeline.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,3 @@ steps:
374374
build:
375375
commit: "${BUILDKITE_COMMIT}"
376376
branch: "${BUILDKITE_BRANCH}"
377-
378-
# wait for packaging to be done
379-
- wait: ~
380-
381-
- label: "Publish to serverless"
382-
branches: main
383-
trigger: "agentless-serverless-release"

.buildkite/scripts/steps/ecp-internal-release.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set -eu
2020
_SELF=$(dirname $0)
2121
source "${_SELF}/../common.sh"
2222

23+
2324
# annotate create temp markdown file if not exists
2425
# this file will be later used to annotate the build
2526
# it appends to the file the message passed as argument
@@ -32,9 +33,19 @@ write_annotation() {
3233
cat $BUILDKITE_ANNOTATE_FILE | buildkite-agent annotate --style info
3334
}
3435

35-
BUILD_VERSION="$(jq -r '.version' .package-version)"
36-
DOCKER_TAG="git-${VERSION}"
3736
PRIVATE_REPO="docker.elastic.co/observability-ci/ecp-elastic-agent-service"
37+
SNAPSHOT_DRA_URL=https://snapshots.elastic.co/latest/master.json
38+
39+
DRA_RESULT=$(curl -s -X GET "$SNAPSHOT_DRA_URL")
40+
echo "$DRA_RESULT"
41+
BUILD_ID=$(echo "$DRA_RESULT" | jq '.build_id' | tr -d '"')
42+
BUILD_VERSION=$(echo "$DRA_RESULT" | jq '.version' | tr -d '"')
43+
44+
MANIFEST_URL="https://snapshots.elastic.co/$BUILD_ID/agent-package/agent-artifacts-$BUILD_VERSION.json"
45+
GIT_COMMIT=$(curl -s -X GET "$MANIFEST_URL" | jq '.projects["elastic-agent-core"]["commit_hash"]' | tr -d '"')
46+
GIT_SHORT_COMMIT=$(echo "$GIT_COMMIT" | cut -c1-12)
47+
48+
DOCKER_TAG="git-${GIT_SHORT_COMMIT}"
3849
PRIVATE_IMAGE="${PRIVATE_REPO}:${DOCKER_TAG}"
3950

4051
# TODO: let's avoid accessing vault directly but use the vault plugin itself
@@ -46,19 +57,13 @@ DOCKER_REGISTRY="docker.elastic.co"
4657
DOCKER_USERNAME_SECRET=$(retry 5 vault kv get -field user "${DOCKER_REGISTRY_SECRET_PATH}")
4758
DOCKER_PASSWORD_SECRET=$(retry 5 vault kv get -field password "${DOCKER_REGISTRY_SECRET_PATH}")
4859
skopeo login --username "${DOCKER_USERNAME_SECRET}" --password "${DOCKER_PASSWORD_SECRET}" "${DOCKER_REGISTRY}"
49-
50-
# download the amd64 and arm64 builds of the image from the previous steps
51-
buildkite-agent artifact download "build/distributions/**" . --step "packaging-service-container-amd64"
52-
buildkite-agent artifact download "build/distributions/**" . --step "packaging-service-container-arm64"
53-
54-
# copy the images into the private image location
55-
skopeo copy --all "docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG-$BUILD_VERSION-linux-amd64.docker.tar.gz" "docker://$PRIVATE_IMAGE"
56-
skopeo copy --all "docker-archive:./build/distributions/elastic-agent-service-$DOCKER_TAG-$BUILD_VERSION-linux-arm64.docker.tar.gz" "docker://$PRIVATE_IMAGE"
60+
skopeo copy --all "docker://docker.elastic.co/cloud-release/elastic-agent-service:$BUILD_ID-SNAPSHOT" "docker://$PRIVATE_IMAGE"
5761

5862
annotate "* Image: $PRIVATE_IMAGE"
59-
annotate "* Short commit: $VERSION"
60-
annotate "* Commit: https://github.com/elastic/elastic-agent/commit/$VERSION"
63+
annotate "* Short commit: $GIT_SHORT_COMMIT"
64+
annotate "* Commit: https://github.com/elastic/elastic-agent/commit/$GIT_COMMIT"
65+
annotate "* Manifest: $MANIFEST_URL"
6166

62-
buildkite-agent meta-data set "git-short-commit" "$VERSION"
67+
buildkite-agent meta-data set "git-short-commit" "$GIT_SHORT_COMMIT"
6368

6469
write_annotation

0 commit comments

Comments
 (0)