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) (opensearch-project#923) * 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]> (cherry picked from commit b4d589c) Co-authored-by: YANGDB <[email protected]> (cherry picked from commit 620cdef)
- Loading branch information
1 parent
e790336
commit 40017ff
Showing
6 changed files
with
208 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Developer Guide | ||
|
||
So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do. | ||
|
||
### Setup | ||
|
||
1. Git clone OpenSearch-Dashboard for the version that matches the version you want to use [OpenSearch-Dashboards](https://github.com/opensearch-project/OpenSearch-Dashboards) | ||
2. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory. (using [nvm](https://github.com/nvm-sh/nvm) can help for that) | ||
3. Change directory into `OpenSearch-Dashboards` and git Clone the [Observability-Dashboard](https://github.com/opensearch-project/dashboards-observability) into the `plugins/` directory. | ||
4. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards`. | ||
|
||
Ultimately, your directory structure should look like this: | ||
|
||
```md | ||
. | ||
├── OpenSearch-Dashboards | ||
│ └── plugins | ||
│ └── dashboards-observability | ||
``` | ||
|
||
### Build | ||
|
||
To build the plugin's distributable zip simply run `yarn build`. | ||
|
||
The output file : `./build/observabilityDashboards-?.?.?.zip` (`?.?.?` stands for the version number) | ||
|
||
### Run Directly | ||
|
||
Cd back to `OpenSearch-Dashboards` directory and run `yarn start` to start OpenSearch Dashboards including this plugin. OpenSearch Dashboards will be available on `localhost:5601`. | ||
|
||
### Run Docker | ||
|
||
Run `docker-compose up -d` after changing the [Dockerfile](Dockerfile) as described in this [tutorial](Using-Docker.md) | ||
|
||
### Submitting Changes | ||
|
||
See [CONTRIBUTING](CONTRIBUTING.md). | ||
|
||
### Backports | ||
|
||
The Github workflow in [`backport.yml`](.github/workflows/backport.yml) creates backport PRs automatically when the original PR | ||
with an appropriate label `backport <backport-branch-name>` is merged to main with the backport workflow run successfully on the | ||
PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the | ||
backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR | ||
to the `1.x` branch. |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"last_github_commit": "ed572dcc3856c8620e28842b424f33ac46add9d8", | ||
"last_gitfarm_commit": "659b360399849d82eb0a0f2af5d665120e4b8904" | ||
"last_github_commit": "620cdef897f5bab6ee3470af17779fc2844cd273", | ||
"last_gitfarm_commit": "09a72d10db2e8e31a4e01941ebe03537bd772df7" | ||
} |
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 | ||
|