Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bedc706
Provision automatic test runs for ruby/java unit tests and integratio…
donoghuc Feb 7, 2025
a0de9d7
Split fips integration tests into two steps (#17038)
donoghuc Feb 7, 2025
6b8b56b
Skip offline pack manager tests when running in fips mode (#17160)
donoghuc Feb 27, 2025
4a11e9a
Get tests running in FIPS environment (#17096)
donoghuc Mar 4, 2025
8f7873f
Backport 17203 and 17267 fedramp8x (#17271)
yaauie Mar 6, 2025
7a6149b
Run x-pack tests under FIPS mode (#17254)
donoghuc Mar 7, 2025
4ccc03e
observabilitySRE: docker rake tasks (#17272)
yaauie Mar 11, 2025
48a599a
Ensure env2yaml dep is properly expressed in observabilitySRE task (#…
donoghuc Mar 12, 2025
8b422fb
Add a smoke test for observability SRE container (#17298)
donoghuc Mar 14, 2025
c8992ce
Configure observability SRE container for FIPS (#17297)
donoghuc Mar 14, 2025
c3088e0
Exclude plugin manager and keystore cli from observabilitySRE artifac…
yaauie Mar 20, 2025
a5df608
Conditionally install bcfips jars when building/testing observability…
donoghuc Mar 20, 2025
182f15e
Pull in latests commits from 8.x and update based on new patterns (#1…
donoghuc Mar 21, 2025
65c3dfa
Pin rubocop-ast development gem due to new dep on prism (#17407) (#17…
mergify[bot] Mar 27, 2025
4bb71ef
Add age filter fedramp (#17434)
yaauie Mar 27, 2025
17fb059
Add licenses for bouncycastle fips jars (#17406)
donoghuc Mar 31, 2025
5d8d640
Publish Observability SRE images to internal container registry (#17401)
donoghuc Apr 7, 2025
96bf497
x-pack: add fips validation plugin from x-pack (#16940)
yaauie Apr 8, 2025
6f89de5
Improve smoke tests for observability SRE image (#17486)
donoghuc Apr 8, 2025
8b49b84
Merge remote-tracking branch 'upstream/feature/fedramp-high-8.x' into…
donoghuc Apr 9, 2025
6e7673c
Fix naming convention for integration tests
donoghuc Apr 10, 2025
d05db29
Use parameter expansion for FEDRAMP_HIGH_MODE
donoghuc Apr 10, 2025
acb2e7b
Use parameter expansion for FEDRAMP_HIGH_MODE
donoghuc Apr 10, 2025
c2f96ab
Use parameter expansion for FEDRAMP_HIGH_MODE
donoghuc Apr 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions .buildkite/pull_request_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ steps:
export GRADLE_OPTS="-Xmx2g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info"
ci/license_check.sh -m 4G

steps:
- label: ":passport_control: License check - Fedramp High Mode"
key: "license-check-fedramp-high"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

source .buildkite/scripts/common/container-agent.sh
export JRUBY_OPTS="-J-Xmx1g"
export GRADLE_OPTS="-Xmx2g -Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info"
docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e ORG_GRADLE_PROJECT_fedrampHighMode=true test-runner-image ci/license_check.sh -m 4G

- label: ":rspec: Ruby unit tests"
key: "ruby-unit-tests"
agents:
Expand All @@ -37,6 +58,25 @@ steps:
artifact_paths:
- "coverage/coverage.json"

- label: ":rspec: Ruby unit tests - FIPS mode"
key: "ruby-unit-tests-fips"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run test-runner-image ./gradlew --info --stacktrace -PfedrampHighMode=true rubyTests
artifact_paths:
- "coverage/coverage.json"

- label: ":java: Java unit tests"
key: "java-unit-tests"
agents:
Expand All @@ -58,6 +98,29 @@ steps:
- "**/jacocoTestReport.xml"
- "**/build/classes/**/*.*"

- label: ":java: Java unit tests - FIPS mode"
key: "java-unit-tests-fips"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
env:
ENABLE_SONARQUBE: true
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run test-runner-image ./gradlew --info --stacktrace -PfedrampHighMode=true javaTests
artifact_paths:
- "**/build/test-results/javaTests/TEST-*.xml"
- "**/jacocoTestReport.xml"
- "**/build/classes/**/*.*"

- label: ":sonarqube: Continuous Code Inspection"
if: |
build.pull_request.id != null ||
Expand All @@ -79,6 +142,82 @@ steps:
manual:
allowed: true

- label: "Observability SRE container smoke test"
key: "observability-sre-container-smoke-test"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail
source .buildkite/scripts/common/vm-agent.sh
QUALIFIED_VERSION="$(.buildkite/scripts/common/qualified-version.sh)"
# Build the image locally with the gradle task
./gradlew --stacktrace artifactDockerObservabilitySRE -PfedrampHighMode=true
# Ensure it can at least start logstash
docker run docker.elastic.co/logstash/logstash-observability-sre:$${QUALIFIED_VERSION} \
logstash -e 'input { generator { count => 3 } } output { stdout { codec => rubydebug } }'
# Run the smoke tests on the PR code
docker tag docker.elastic.co/logstash/logstash-observability-sre:$${QUALIFIED_VERSION} \
pr-built-observability-sre-image
./gradlew observabilitySREsmokeTests --stacktrace

- label: ":lab_coat: Integration Tests - FIPS mode / part 1-of-3"
key: "integration-tests-fips-part-1-of-3"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e FEDRAMP_HIGH_MODE=true test-runner-image ci/integration_tests.sh split 0 3

- label: ":lab_coat: Integration Tests - FIPS mode / part 2-of-3"
key: "integration-tests-fips-part-2-of-3"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e FEDRAMP_HIGH_MODE=true test-runner-image ci/integration_tests.sh split 1 3

- label: ":lab_coat: Integration Tests - FIPS mode / part 3-of-3"
key: "integration-tests-fips-part-3-of-3"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e FEDRAMP_HIGH_MODE=true test-runner-image ci/integration_tests.sh split 2 3

- label: ":lab_coat: Integration Tests / part 1-of-3"
key: "integration-tests-part-1-of-3"
agents:
Expand Down Expand Up @@ -226,6 +365,40 @@ steps:
source .buildkite/scripts/common/container-agent.sh
x-pack/ci/integration_tests.sh

- label: ":lab_coat: x-pack unit tests - FIPS mode"
key: "x-pack-unit-tests-fips"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e FEDRAMP_HIGH_MODE=true test-runner-image x-pack/ci/unit_tests.sh

- label: ":lab_coat: x-pack integration - FIPS mode"
key: "integration-tests-x-pack-fips"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-4"
diskSizeGb: 64
retry:
automatic:
- limit: 3
command: |
set -euo pipefail

docker build -t test-runner-image -f x-pack/distributions/internal/observabilitySRE/docker/Dockerfile .
docker run -e FEDRAMP_HIGH_MODE=true test-runner-image x-pack/ci/integration_tests.sh

- wait: ~
continue_on_failure: true

Expand Down
5 changes: 5 additions & 0 deletions .buildkite/scripts/common/qualified-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export QUALIFIED_VERSION="$(
# e.g: 8.0.0-alpha1
printf '%s' "${VERSION_QUALIFIER:+-${VERSION_QUALIFIER}}"

# Include git SHA if requested
if [[ -n "${INCLUDE_COMMIT_ID:+x}" ]]; then
printf '%s' "-$(git rev-parse --short HEAD)"
fi

# add the SNAPSHOT tag unless WORKFLOW_TYPE=="staging" or RELEASE=="1"
if [[ ! ( "${WORKFLOW_TYPE:-}" == "staging" || "${RELEASE:+$RELEASE}" == "1" ) ]]; then
printf '%s' "-SNAPSHOT"
Expand Down
38 changes: 38 additions & 0 deletions .buildkite/scripts/dra/build-and-push-observability-sre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Script to build and publish ObservabilitySRE container
# Currently this is built on a host with the target architecture.
# This allows us to utilize the make file for building the container and
# to ensure the best compatability with the host architecture.
# A later step in CI will take care of pushing a tag that references the right
# image using `docker manifest` commands.

echo "Setting up environment"
source .buildkite/scripts/common/vm-agent.sh
source .buildkite/scripts/dra/docker-env-setup.sh

echo "Building ObservabilitySRE container"
./gradlew --stacktrace artifactDockerObservabilitySRE -PfedrampHighMode=true

echo "Pushing ObservabilitySRE container to Docker repository"
docker_login

# Get qualified version without SHA (this is what the gradle task will produce)
QUALIFIED_VERSION="$(.buildkite/scripts/common/qualified-version.sh)"

# Set environment variable to include SHA and get version with SHA
QUALIFIED_VERSION_WITH_SHA="$(INCLUDE_COMMIT_ID=1 .buildkite/scripts/common/qualified-version.sh)"

REGISTRY_PATH=docker.elastic.co/logstash/logstash-observability-sre

# Current architecture
ARCH="${ARCH:-x86_64}" # Default to x86_64 if ARCH is not set
echo "Architecture: ${ARCH}"

# Create the full tag with SHA and architecture
FULL_TAG="${QUALIFIED_VERSION_WITH_SHA}-${ARCH}"
echo "Tagging and pushing: ${REGISTRY_PATH}:${QUALIFIED_VERSION} as ${REGISTRY_PATH}:${FULL_TAG}"
docker tag ${REGISTRY_PATH}:${QUALIFIED_VERSION} ${REGISTRY_PATH}:${FULL_TAG}
docker push ${REGISTRY_PATH}:${FULL_TAG}

# Teardown Docker environment
source .buildkite/scripts/dra/docker-env-teardown.sh
62 changes: 61 additions & 1 deletion .buildkite/scripts/dra/generatesteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,61 @@ def package_aarch64_docker_step(branch, workflow_type):

return step

def ship_observability_sre_image_steps(branch, workflow_type):
step = f'''
- label: ":package: Build & Ship aarch64 ObservabilitySRE container / {branch}-{workflow_type.upper()}"
key: "logstash_build_and_ship_observability_sre_aarch64"
soft_fail: true
depends_on: logstash_publish_dra
agents:
provider: aws
imagePrefix: platform-ingest-logstash-ubuntu-2204-aarch64
instanceType: "m6g.4xlarge"
diskSizeGb: 200
artifact_paths:
- "**/*.hprof"
command: |
export WORKFLOW_TYPE="{workflow_type}"
export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH"
export ARCH="aarch64"
eval "$(rbenv init -)"
.buildkite/scripts/dra/build-and-push-observability-sre.sh
- label: ":package: Build & Ship x86_64 ObservabilitySRE container / {branch}-{workflow_type.upper()}"
key: "logstash_build_and_ship_observability_sre_x86_64"
soft_fail: true
depends_on: logstash_publish_dra
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-16"
diskSizeGb: 200
artifact_paths:
- "**/*.hprof"
command: |
export WORKFLOW_TYPE="{workflow_type}"
export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH"
export ARCH="x86_64"
eval "$(rbenv init -)"
.buildkite/scripts/dra/build-and-push-observability-sre.sh
- label: ":docker: Create & Push ObservabilitySRE Multi-Arch Manifest / {branch}-{workflow_type.upper()}"
key: "logstash_create_observability_sre_manifest"
depends_on:
- "logstash_build_and_ship_observability_sre_aarch64"
- "logstash_build_and_ship_observability_sre_x86_64"
agents:
provider: gcp
imageProject: elastic-images-prod
image: family/platform-ingest-logstash-ubuntu-2204
machineType: "n2-standard-8"
command: |
export WORKFLOW_TYPE="{workflow_type}"
export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:$PATH"
eval "$(rbenv init -)"
.buildkite/scripts/dra/multi-architecture-observability-sre.sh
'''
return step

def publish_dra_step(branch, workflow_type, depends_on):
step = f'''
- label: ":elastic-stack: Publish / {branch}-{workflow_type.upper()} DRA artifacts"
Expand Down Expand Up @@ -139,9 +194,14 @@ def build_steps_to_yaml(branch, workflow_type):
"steps": build_steps_to_yaml(branch, workflow_type),
})

# Final step: pull artifacts built above and publish them via the release-manager
# Pull artifacts built above and publish them via the release-manager
structure["steps"].extend(
yaml.safe_load(publish_dra_step(branch, workflow_type, depends_on=group_key)),
)

# Once published, do the same for observabilitySRE image
structure["steps"].extend(
yaml.safe_load(ship_observability_sre_image_steps(branch, workflow_type)),
)

print(YAML_HEADER + yaml.dump(structure, Dumper=yaml.Dumper, sort_keys=False))
53 changes: 53 additions & 0 deletions .buildkite/scripts/dra/multi-architecture-observability-sre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# Script to create and push Docker manifest for multi-architecture support
# This MUST be run after build-and-push-observabilty-sre.sh!

source .buildkite/scripts/common/vm-agent.sh
source .buildkite/scripts/dra/docker-env-setup.sh

docker_login

# Set INCLUDE_COMMIT_ID to include git SHA in version
QUALIFIED_VERSION="$(INCLUDE_COMMIT_ID=1 .buildkite/scripts/common/qualified-version.sh)"
REGISTRY_PATH=docker.elastic.co/logstash/logstash-observability-sre

# Architecture-specific tags (created by the build steps)
X86_64_TAG="${QUALIFIED_VERSION}-x86_64"
AARCH64_TAG="${QUALIFIED_VERSION}-aarch64"

# Target manifest tags - already has SHA from QUALIFIED_VERSION
VERSION_MANIFEST_TAG="${QUALIFIED_VERSION}"

# Create and push manifest with version (which already includes SHA)
echo "Creating manifest list for: ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG}"
docker manifest create ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG} \
${REGISTRY_PATH}:${X86_64_TAG} \
${REGISTRY_PATH}:${AARCH64_TAG}

docker manifest annotate ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG} \
${REGISTRY_PATH}:${X86_64_TAG} --os linux --arch amd64

docker manifest annotate ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG} \
${REGISTRY_PATH}:${AARCH64_TAG} --os linux --arch arm64

echo "Pushing manifest: ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG}"
docker manifest push ${REGISTRY_PATH}:${VERSION_MANIFEST_TAG}

# Also create version without SHA for effective "latest" tag
BASE_VERSION="$(.buildkite/scripts/common/qualified-version.sh)"
echo "Creating manifest list for: ${REGISTRY_PATH}:${BASE_VERSION}"
docker manifest create ${REGISTRY_PATH}:${BASE_VERSION} \
${REGISTRY_PATH}:${X86_64_TAG} \
${REGISTRY_PATH}:${AARCH64_TAG}

docker manifest annotate ${REGISTRY_PATH}:${BASE_VERSION} \
${REGISTRY_PATH}:${X86_64_TAG} --os linux --arch amd64

docker manifest annotate ${REGISTRY_PATH}:${BASE_VERSION} \
${REGISTRY_PATH}:${AARCH64_TAG} --os linux --arch arm64

echo "Pushing manifest: ${REGISTRY_PATH}:${BASE_VERSION}"
docker manifest push ${REGISTRY_PATH}:${BASE_VERSION}

# Teardown Docker environment
source .buildkite/scripts/dra/docker-env-teardown.sh
Loading