forked from opensearch-project/dashboards-observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker-compose.yml testing and readme for integration to 2.9 (ope…
…nsearch-project#917) * add docker-compose.yml testing and readme for integration to 2.9 Signed-off-by: YANGDB <[email protected]> * move the screenshots down to the lower part of the README.md file Signed-off-by: YANGDB <[email protected]> --------- Signed-off-by: YANGDB <[email protected]>
- Loading branch information
Showing
5 changed files
with
172 additions
and
21 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,3 @@ | ||
# version for opensearch & opensearch-dashboards docker image | ||
VERSION=2.9.0 | ||
|
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,47 @@ | ||
# Using Docker | ||
Using docker as the runtime environment for testing and validating new developments is now available using the next commands: | ||
|
||
## Build the plugin | ||
First the plugin must be build using the `yarn build` command. | ||
|
||
Once this build was completed - the expected zip location of the plugin is `./build/observabilityDashboards-?.?.?.zip` where as the `?.?.?` represents the version of this dashboard plugin. | ||
|
||
> Note: that the plugin version must correspond to the OpenSearch-Dashboards version - this information appears [here](opensearch_dashboards.json) | ||
> | ||
Once the build is completed, make sure to overide the [Dockerfile](Dockerfile) target zip file with the exact name | ||
``` | ||
# Install updated plugin | ||
RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/observabilityDashboards-3.0.0.zip | ||
``` | ||
|
||
## Docker imageVersion | ||
The docker images used by this file are all referencing the [.env](.env) environment file that contains the version that needed to be changed to match your own system. | ||
|
||
## Run the docker image build | ||
To build the docker image use the next command: | ||
> `docker build --build-arg VERSION=$(grep VERSION .env | cut -d '=' -f2) -t your_image_name .` | ||
## Run the docker compose | ||
The [docker-compose](docker-compose.yml) file represents a simple assembly of an OpenSearch cluster with two nodes and an opensearch dashboard that has the updated image with the latest changes in this plugin. | ||
> This is a test only docker compose that should not be used for production purpose - for such use cases please review this [link](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/) | ||
### Option 1 (All from docker) | ||
run `docker compose up -d` to start the services and once the service is up and running you can start testing the changes. | ||
|
||
### Option 2 (Combined Docker & Dashboard) | ||
run `docker compose up -d opensearch` to only run the OpenSearch engine - in this case the dashboard has to be run manualy using `yarn start --no-base-path` command in the root dashboards path `./OpenSearch-Dashboards/` | ||
|
||
> Note that the OpenSearch version also must correspond to the OpenSearch-Dashboards version | ||
## Accessing the Dashboard | ||
The dashboard service uses port `localhost:5601` for access and this was already exported in the docker-compose service definition | ||
```yaml | ||
ports: | ||
- 5601:5601 # Map host port 5601 to container port 5601 | ||
``` | ||
## Security Notice | ||
There is no security plugin and authentication definitions for this development test demo - pay attention not to use this configuration in a production or any environment that may contain | ||
confident or personal information without first changing the security definition for accessing the servers - for production use cases please review this [link](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/) | ||
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,69 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
version: '3.9' | ||
x-default-logging: &logging | ||
driver: "json-file" | ||
options: | ||
max-size: "5m" | ||
max-file: "2" | ||
|
||
volumes: | ||
opensearch-data: | ||
|
||
networks: | ||
default: | ||
name: opensearch-dashboards-demo | ||
driver: bridge | ||
|
||
services: | ||
# OpenSearch store - node (not for production - no security - only for test purpose ) | ||
opensearch: | ||
image: opensearchstaging/opensearch:${VERSION} | ||
container_name: opensearch | ||
environment: | ||
- cluster.name=opensearch-cluster | ||
- node.name=opensearch | ||
- discovery.seed_hosts=opensearch | ||
- cluster.initial_cluster_manager_nodes=opensearch | ||
- bootstrap.memory_lock=true | ||
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" | ||
- "DISABLE_INSTALL_DEMO_CONFIG=true" | ||
- "DISABLE_SECURITY_PLUGIN=true" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536 | ||
hard: 65536 | ||
volumes: | ||
- opensearch-data:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container | ||
ports: | ||
- 9200:9200 | ||
- 9600:9600 | ||
expose: | ||
- "9200" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:9200/_cluster/health?wait_for_status=yellow"] | ||
interval: 20s | ||
timeout: 10s | ||
retries: 10 | ||
|
||
# OpenSearch store - dashboard | ||
opensearch-dashboards: | ||
container_name: opensearch-dashboards | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
args: | ||
- VERSION=${VERSION} | ||
|
||
ports: | ||
- 5601:5601 # Map host port 5601 to container port 5601 | ||
expose: | ||
- "5601" # Expose port 5601 for web access to OpenSearch Dashboards | ||
environment: | ||
OPENSEARCH_HOSTS: '["http://opensearch:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query | ||
depends_on: | ||
- opensearch | ||
|