Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
  • Loading branch information
abbyhu2000 committed Mar 3, 2023
1 parent dbde0b5 commit ebacd34
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dev-tools/install-docker-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ osd_do_copy_dev_docker_files(){

osd_do_copy_dev_docker_files

} # this ensures the entire script is downloaded #
} # this ensures the entire script is downloaded #
3 changes: 2 additions & 1 deletion docs/docker-dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ volumes:
opensearch-data:
osd-dev:
networks:
opensearch-net:
opensearch-net:

26 changes: 13 additions & 13 deletions docs/docker-dev/docker-dev-setup-manual.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Docker Development Environment Setup
The following instructions demonstrate how to set up a development environment for OpenSearch Dashboards using Docker. It utilizes tools such as `Docker` and `VS Code`, and users should be familiar with the basic usages of them. Users will be able to develop and run the application inside VS Code without additional configurations.

1. Install [Docker](https://docs.docker.com/get-docker/) if not already.
2. On the terminal, run command `curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh | bash`. This should create a folder named `opensearch-dashboards-docker-dev` and it should contain two files: `docker-compose.yml` and `entrypoint.sh`.
3. Open [VsCode](https://code.visualstudio.com/download). Install here if not already. Make sure VsCode has the extension `Dev Containers` and `Docker` installed. If not, go to Extensions tab, search and install them.
1. Install [Docker](https://docs.docker.com/get-docker/) if not already installed.
2. In the terminal, run the command `curl -o- https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh | bash`. This should create a folder named `opensearch-dashboards-docker-dev` and it should contain two files: `docker-compose.yml` and `entrypoint.sh`. Here is the link to the installer script: `https://raw.githubusercontent.com/opensearch-project/OpenSearch-Dashboards/main/dev-tools/install-docker-dev.sh`.
3. Open VS Code or [install it](https://code.visualstudio.com/download), if it's not already installed. Make sure VS Code has the extensions `Dev Containers` and `Docker` installed. If not, go to `Extensions` tab, search and install them.
4. Under the Discover tab, click `Open Folder`, and open the `opensearch-dashboards-docker-dev` folder that we just created.
5. In the workspace folder, set environment variable for the fork repository URL: run `export REPO_URL=[insert your fork repo url here]`. If fork repo has not been created: Go to [OpenSearch Dashboards github page](https://github.com/opensearch-project/OpenSearch-Dashboards) and under fork, select create a new fork, and then copy the https link of the fork url and use it in the above command.
6. To run the `docker-compose.yml` file in the background, and type `docker compose up -d --build` in the terminal.
7. Under `Docker` tab in VsCode, verify that there are two containers running: `opensearchproject/opensearch:latest` and `docker.io/library/osd-development`. We can also verify using the command line: `docker ps`.
8. Right click `docker.io/library/osd-development`, and select `Attach Visual Studio Code`. This should ssh into the container in another VsCode window.
9. For the new VsCode window, if it is not showing the repository code, then select `Open Folder`. Then open `/workspace-docker/OpenSearch-Dashboards`.
10. In the terminal, type `yarn start:docker` to start the OpenSearch Dashboards application. (To open a terminal, right click on a file and click `Open in Integrated Terminal`. Then change the terminal type to bash by clicking the + sign on the right top of the terminal window.)
11. Now dashboard is running, you should be able to see a similar line `[info][server][OpenSearchDashboards][http] http server running at http://0.0.0.0:5603/dog` . The last three letters are randomly generated every time we start dashboards.
12. Wait for the optimizer to run, and it takes about 100s - 200s. Once the optimizer is finished running, it will show a line such as `[success][@osd/optimizer] 48 bundles compiled successfully after 204.9 sec, watching for changes`.
5. In the workspace folder, set environment variable for the fork repository URL: run `export REPO_URL=[insert your fork repo url here]`. If fork repo has not been created: Go to [OpenSearch Dashboards github page](https://github.com/opensearch-project/OpenSearch-Dashboards) and under fork, select create a new fork, and then copy the https link of the fork url and use it in the above command. The command needs to be re-run every time it re-start the docker compose file in a new terminal.
6. Run the `docker-compose.yml` file in the background, and type `docker compose up -d --build` in the terminal.
7. Under the `Docker` tab in VS Code, verify that there are two containers running: `opensearchproject/opensearch:latest` and `docker.io/library/osd-development`. We can also verify using the command line: `docker ps`.
8. Right-click `docker.io/library/osd-development`, and select `Attach Visual Studio Code`. This should ssh into the container in another VsCode window.
9. For the new VS Code window, if it is not showing the repository code, then select `Open Folder`. Then open `/workspace-docker/OpenSearch-Dashboards`.
10. In the terminal, type `yarn start:docker` to start the OpenSearch Dashboards application.
11. Now that OpenSearch Dashboards is running, you should be able to see a log line similar to `[info][server][OpenSearchDashboards][http] http server running at http://0.0.0.0:5603/dog` . The last three letters are randomly generated every time we start dashboards.
12. Wait for the optimizer to run, which takes about 100s - 200s. Once the optimizer is finished running, it will show a line such as `[success][@osd/optimizer] 48 bundles compiled successfully after 204.9 sec, watching for changes`.
13. Then paste the link into a chrome browser and view dashboard running in browser, but change ‘0.0.0.0’ to ‘localhost’. So here the link should be `http://localhost:5603/dog`.
14. Changes are constantly being watched, so when there is changes made, dashboard will rebuild and restart automatically. Refresh the link in the browser and the new changes should be applied.
14. Files are constantly watched, so when you make code changes, OpenSearch Dashboards will rebuild and restart automatically. Refresh the link in the browser and the new changes should be applied.
15. `Git` is already configured in the `entrypoint.sh` file, and the remote is already tracking the fork repository. You can start contributing by creating your branch off the main, and commit your first PR!

2 changes: 1 addition & 1 deletion docs/docker-dev/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
echo $REPO_URL
git remote set-url origin $REPO_URL
git fetch
tail -f /dev/null
tail -f /dev/null

0 comments on commit ebacd34

Please sign in to comment.