Skip to content

Reapply #1708 Add ElasticsearchGateway and UI adjustments" #1731

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
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,17 @@ jobs:
run: dotnet run --project build -c release -- unit-test

- name: Publish AOT
if: ${{ matrix.os != 'ubuntu-latest' }} # publish containers already validates AOT build
run: dotnet run --project build -c release -- publishbinaries

- name: Publish Containers
if: ${{ matrix.os == 'ubuntu-latest' }}
run: dotnet run --project build -c release -- publishcontainers

- name: Run Container
if: ${{ matrix.os == 'ubuntu-latest' }}
run: docker run elastic/docs-builder:ci-${{ github.event.pull_request.number }} --help


integration:
if: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Containers
run: ./build.sh publishcontainers\
run: ./build.sh publishcontainers

build-lambda:
needs:
Expand Down
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
<PackageVersion Include="AWSSDK.SQS" Version="4.0.0.1" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.0.1" />
<PackageVersion Include="Elastic.Aspire.Hosting.Elasticsearch" Version="9.3.0" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="9.1.4" />
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
<PackageVersion Include="Elastic.Ingest.Elasticsearch" Version="0.11.3" />
<PackageVersion Include="Elastic.Ingest.Elasticsearch" Version="0.14.0" />
<PackageVersion Include="InMemoryLogger" Version="1.0.66" />
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.6.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.4" />
Expand Down
28 changes: 18 additions & 10 deletions build/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,40 @@ let private publishZip _ =
let private publishContainers _ =

let createImage project =
let ci = Environment.environVarOrNone "GITHUB_ACTIONS"
let pr =
match Environment.environVarOrNone "GITHUB_REF_NAME" with
| None -> None
| Some s when s.EndsWith "/merge" -> Some (s.Split('/') |> Seq.head)
| _ -> None
let imageTag =
match project with
| "docs-builder" -> "jammy-chiseled-aot"
| _ -> "jammy-chiseled-aot"
| _ -> "9.0-noble-chiseled-aot"
let labels =
let exitCode = exec {
validExitCode (fun _ -> true)
exit_code_of "git" "describe" "--tags" "--exact-match" "HEAD"
}
match exitCode with | 0 -> "edge;latest" | _ -> "edge"
match (exitCode, pr) with
| 0, _ -> "edge;latest"
| _, None -> "edge"
| _, Some pr -> $"ci-%s{pr}"
let args =
["publish"; $"src/tooling/%s{project}/%s{project}.csproj"]
@ [
"/t:PublishContainer";
"-p"; "DebugType=none";
"-p"; $"ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-%s{imageTag}";
"-p"; $"ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:%s{imageTag}";
"-p"; $"ContainerImageTags=\"%s{labels};%s{Software.Version.Normalize()}\""
"-p"; $"ContainerRepository=elastic/%s{project}"
]
let registry =
match Environment.environVarOrNone "GITHUB_ACTIONS" with
| None -> []
| Some _ -> [
"-p"; "ContainerRegistry=ghcr.io"
"-p"; "ContainerUser=1001:1001";
]
match (ci, pr) with
| Some _, None -> [
"-p"; "ContainerRegistry=ghcr.io"
"-p"; "ContainerUser=1001:1001";
]
| _, _ -> []
exec { run "dotnet" (args @ registry) }
createImage "docs-builder"
createImage "docs-assembler"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { useSearchActions, useSearchTerm } from '../search.store'
import { EuiButton, EuiSpacer, EuiText, useEuiTheme } from '@elastic/eui'
import {
EuiButton,
EuiIcon,
EuiSpacer,
EuiText,
useEuiTheme,
} from '@elastic/eui'
import { css } from '@emotion/react'
import * as React from 'react'

Expand All @@ -26,7 +32,16 @@ export const AskAiSuggestions = (props: Props) => {
`
return (
<>
<EuiText size="xs">Ask Elastic Docs AI Assistant</EuiText>
<div
css={css`
display: flex;
gap: ${euiTheme.size.s};
align-items: center;
`}
>
<EuiIcon type="sparkles" color="subdued" size="s" />
<EuiText size="xs">Ask Elastic Docs AI Assistant</EuiText>
</div>
<EuiSpacer size="s" />
{searchTerm && (
<EuiButton
Expand Down
Loading
Loading