-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sunman' of https://github.com/elastic/elasticsearch-labs …
…into sunman
- Loading branch information
Showing
275 changed files
with
135,043 additions
and
5,828 deletions.
There are no files selected for viewing
This file contains 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,101 @@ | ||
name: build chatbot-rag-app image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- example-apps/chatbot-rag-app/** | ||
- .github/workflows/docker-chatbot-rag-app.yml | ||
- '!**/*.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
# Verify changes to the Dockerfile on PRs | ||
- example-apps/chatbot-rag-app/Dockerfile | ||
- .github/workflows/docker-chatbot-rag-app.yml | ||
- '!**/*.md' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
IMAGE: ghcr.io/${{ github.repository }}/chatbot-rag-app | ||
|
||
jobs: | ||
build-image: | ||
strategy: | ||
matrix: | ||
runner: | ||
- ubuntu-24.04 | ||
- ubuntu-24.04-arm | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
if: github.event_name == 'push' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: docker/build-push-action@v6 | ||
id: build | ||
with: | ||
context: example-apps/chatbot-rag-app | ||
outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name == 'push' && 'true' || 'false' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: export digest | ||
if: github.event_name == 'push' | ||
run: | | ||
mkdir -p /tmp/digests | ||
digest="${{ steps.build.outputs.digest }}" | ||
touch "/tmp/digests/${digest#sha256:}" | ||
- name: upload digest | ||
if: github.event_name == 'push' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: digests-${{ matrix.runner }} | ||
path: /tmp/digests/* | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
push-manifest: | ||
runs-on: ubuntu-24.04 | ||
needs: build-image | ||
if: github.event_name == 'push' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.IMAGE }} | ||
tags: | | ||
type=raw,latest | ||
type=sha,format=long | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
- run: ls /tmp/digests | ||
- name: Create manifest list and push | ||
working-directory: /tmp/digests | ||
run: | | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ env.IMAGE }}@sha256:%s ' *) | ||
- name: Inspect image to verify | ||
run: | | ||
docker buildx imagetools inspect ${{ env.IMAGE }}:${{ steps.meta.outputs.version }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,26 @@ | ||
# Running your own Elastic Stack with Docker | ||
|
||
If you'd like to start Elastic locally, you can use the provided | ||
[docker-compose-elastic.yml](docker-compose-elastic.yml) file. This starts | ||
Elasticsearch, Kibana, and APM Server and only requires Docker installed. | ||
|
||
Note: If you haven't checked out this repository, all you need is one file: | ||
```bash | ||
wget https://raw.githubusercontent.com/elastic/elasticsearch-labs/refs/heads/main/docker/docker-compose-elastic.yml | ||
``` | ||
|
||
Use docker compose to run Elastic stack in the background: | ||
|
||
```bash | ||
docker compose -f docker-compose-elastic.yml up --force-recreate -d | ||
``` | ||
|
||
Then, you can view Kibana at http://localhost:5601/app/home#/ | ||
|
||
If asked for a username and password, use username: elastic and password: elastic. | ||
|
||
Clean up when finished, like this: | ||
|
||
```bash | ||
docker compose -f docker-compose-elastic.yml down | ||
``` |
This file contains 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,91 @@ | ||
name: elastic-stack | ||
|
||
services: | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0 | ||
container_name: elasticsearch | ||
ports: | ||
- 9200:9200 | ||
environment: | ||
- node.name=elasticsearch | ||
- cluster.name=docker-cluster | ||
- discovery.type=single-node | ||
- ELASTIC_PASSWORD=elastic | ||
- bootstrap.memory_lock=true | ||
- xpack.security.enabled=true | ||
- xpack.security.http.ssl.enabled=false | ||
- xpack.security.transport.ssl.enabled=false | ||
- xpack.license.self_generated.type=trial | ||
- ES_JAVA_OPTS=-Xmx8g | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=500ms"] | ||
retries: 300 | ||
interval: 1s | ||
|
||
elasticsearch_settings: | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0 | ||
container_name: elasticsearch_settings | ||
restart: 'no' | ||
command: > | ||
bash -c ' | ||
# gen-ai assistants in kibana save state in a way that requires security to be enabled, so we need to create | ||
# a kibana system user before starting it. | ||
echo "Setup the kibana_system password"; | ||
until curl -s -u "elastic:elastic" -X POST http://elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"elastic\"}" -H "Content-Type: application/json" | grep -q "^{}"; do sleep 5; done; | ||
' | ||
kibana: | ||
image: docker.elastic.co/kibana/kibana:8.17.0 | ||
container_name: kibana | ||
depends_on: | ||
elasticsearch_settings: | ||
condition: service_completed_successfully | ||
ports: | ||
- 5601:5601 | ||
environment: | ||
- SERVERNAME=kibana | ||
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200 | ||
- ELASTICSEARCH_USERNAME=kibana_system | ||
- ELASTICSEARCH_PASSWORD=elastic | ||
# Non-default settings from here: | ||
# https://github.com/elastic/apm-server/blob/main/testing/docker/kibana/kibana.yml | ||
- MONITORING_UI_CONTAINER_ELASTICSEARCH_ENABLED=true | ||
- XPACK_SECURITY_ENCRYPTIONKEY=fhjskloppd678ehkdfdlliverpoolfcr | ||
- XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=fhjskloppd678ehkdfdlliverpoolfcr | ||
- SERVER_PUBLICBASEURL=http://127.0.0.1:5601 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'All services are available'"] | ||
retries: 300 | ||
interval: 1s | ||
|
||
apm-server: | ||
image: docker.elastic.co/apm/apm-server:8.17.0 | ||
container_name: apm-server | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
command: > | ||
apm-server | ||
-E apm-server.kibana.enabled=true | ||
-E apm-server.kibana.host=http://kibana:5601 | ||
-E apm-server.kibana.username=elastic | ||
-E apm-server.kibana.password=elastic | ||
-E output.elasticsearch.hosts=["http://elasticsearch:9200"] | ||
-E output.elasticsearch.username=elastic | ||
-E output.elasticsearch.password=elastic | ||
cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"] | ||
cap_drop: ["ALL"] | ||
ports: | ||
- 8200:8200 | ||
healthcheck: | ||
test: ["CMD-SHELL", "bash -c 'echo -n > /dev/tcp/127.0.0.1/8200'"] | ||
retries: 300 | ||
interval: 1s | ||
|
This file contains 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,2 @@ | ||
.venv | ||
*/node_modules |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
frontend/build | ||
frontend/node_modules | ||
api/__pycache__ | ||
api/.env | ||
.venv | ||
venv | ||
.DS_Store | ||
.DS_Store | ||
.env |
This file contains 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
Oops, something went wrong.