Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/elastic/kibana into move-st…
Browse files Browse the repository at this point in the history
…ructure-risk_engine_apis
  • Loading branch information
WafaaNasr committed Nov 7, 2023
2 parents 9414252 + b7ca287 commit 60bf329
Show file tree
Hide file tree
Showing 12 changed files with 15,617 additions and 2,027 deletions.
10 changes: 10 additions & 0 deletions .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ steps:
- exit_status: '*'
limit: 1

- command: KIBANA_DOCKER_CONTEXT=ironbank .buildkite/scripts/steps/artifacts/docker_context.sh
label: 'Docker Context Verification'
agents:
queue: n2-2
timeout_in_minutes: 30
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/artifacts/cloud.sh
label: 'Cloud Deployment'
soft_fail:
Expand Down
40 changes: 29 additions & 11 deletions .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,43 @@ KIBANA_DOCKER_CONTEXT="${KIBANA_DOCKER_CONTEXT:="default"}"

echo "--- Create contexts"
mkdir -p target
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact "${BUILD_ARGS[@]}"
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact

echo "--- Setup context"
DOCKER_BUILD_FOLDER=$(mktemp -d)
DOCKER_BUILD_ARGS=''
case $KIBANA_DOCKER_CONTEXT in
default)
DOCKER_CONTEXT_FILE="kibana-$FULL_VERSION-docker-build-context.tar.gz"
;;
cloud)
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi8)
DOCKER_CONTEXT_FILE="kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi9)
DOCKER_CONTEXT_FILE="kibana-ubi9-$FULL_VERSION-docker-build-context.tar.gz"
;;
ironbank)
DOCKER_CONTEXT_FILE="kibana-ironbank-$FULL_VERSION-docker-build-context.tar.gz"
DOCKER_BUILD_ARGS='--build-arg BASE_REGISTRY=docker.elastic.co --build-arg BASE_IMAGE=ubi9/ubi --build-arg BASE_TAG=latest'

# See src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml
curl --retry 8 -sS -L -o "$DOCKER_BUILD_FOLDER/tini" "https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64"
echo "8053cc21a3a9bdd6042a495349d1856ae8d3b3e7664c9654198de0087af031f5d41139ec85a2f5d7d2febd22ec3f280767ff23b9d5f63d490584e2b7ad3c218c $DOCKER_BUILD_FOLDER/tini" | sha512sum -c -
curl --retry 8 -sS -L -o "$DOCKER_BUILD_FOLDER/NotoSansCJK-Regular.ttc" https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/NotoSansCJK-Regular.ttc
echo "0ce56bde1853fed3e53282505bac65707385275a27816c29712ab04c187aa249797c82c58759b2b36c210d4e2683eda92359d739a8045cb8385c2c34d37cc9e1 $DOCKER_BUILD_FOLDER/NotoSansCJK-Regular.ttc" | sha512sum -c -

echo "Warning: this will build an approximation of the Iron Bank context, using a swapped base image"
;;
esac

if [[ "$KIBANA_DOCKER_CONTEXT" == "default" ]]; then
DOCKER_CONTEXT_FILE="kibana-$FULL_VERSION-docker-build-context.tar.gz"
elif [[ "$KIBANA_DOCKER_CONTEXT" == "cloud" ]]; then
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
elif [[ "$KIBANA_DOCKER_CONTEXT" == "ubi8" ]]; then
DOCKER_CONTEXT_FILE="kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
elif [[ "$KIBANA_DOCKER_CONTEXT" == "ubi9" ]]; then
DOCKER_CONTEXT_FILE="kibana-ubi9-$FULL_VERSION-docker-build-context.tar.gz"
fi

tar -xf "target/$DOCKER_CONTEXT_FILE" -C "$DOCKER_BUILD_FOLDER"
cd $DOCKER_BUILD_FOLDER

download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"

echo "--- Build context"
docker build .
docker build $DOCKER_BUILD_ARGS .
2 changes: 0 additions & 2 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ spec:
access_level: BUILD_AND_READ
cloud-tooling:
access_level: BUILD_AND_READ
obs-ux-infra_services-team:
access_level: BUILD_AND_READ
everyone:
access_level: READ_ONLY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const storageExplorer = {
href="/storage-explorer"
>
<ApmMainTemplate
environmentFilter={false}
pageHeader={{
alignItems: 'center',
pageTitle: i18n.translate('xpack.apm.views.storageExplorer.title', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiPageHeaderProps } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiPageHeaderProps } from '@elastic/eui';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { ObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template';
Expand Down Expand Up @@ -40,6 +40,7 @@ export function ApmMainTemplate({
environmentFilter = true,
showServiceGroupSaveButton = false,
showServiceGroupsNav = false,
environmentFilterInTemplate = true,
selectedNavButton,
...pageTemplateProps
}: {
Expand Down Expand Up @@ -108,17 +109,25 @@ export function ApmMainTemplate({

const rightSideItems = [
...(showServiceGroupSaveButton ? [<ServiceGroupSaveButton />] : []),
...(environmentFilter ? [<ApmEnvironmentFilter />] : []),
];

const pageHeaderTitle = (
<EuiFlexGroup justifyContent="spaceBetween" wrap={true}>
{pageHeader?.pageTitle ?? pageTitle}
<EuiFlexItem grow={false}>
{environmentFilter && <ApmEnvironmentFilter />}
</EuiFlexItem>
</EuiFlexGroup>
);

const pageTemplate = (
<ObservabilityPageTemplate
noDataConfig={shouldBypassNoDataScreen ? undefined : noDataConfig}
isPageDataLoaded={isLoading === false}
pageHeader={{
pageTitle,
rightSideItems,
...pageHeader,
pageTitle: pageHeaderTitle,
children:
showServiceGroupsNav && selectedNavButton ? (
<ServiceGroupsButtonGroup selectedNavButton={selectedNavButton} />
Expand All @@ -130,11 +139,9 @@ export function ApmMainTemplate({
</ObservabilityPageTemplate>
);

if (environmentFilter) {
return (
<EnvironmentsContextProvider>{pageTemplate}</EnvironmentsContextProvider>
);
}
return (
<EnvironmentsContextProvider>{pageTemplate}</EnvironmentsContextProvider>
);

return pageTemplate;
}
Loading

0 comments on commit 60bf329

Please sign in to comment.