From c4e697879dc09d5f4fc3ad9dbf3fab903d17ad91 Mon Sep 17 00:00:00 2001 From: Christian Adams Date: Wed, 18 Mar 2020 16:33:40 -0400 Subject: [PATCH 1/2] Improve docs for using the logstash container --- tools/docker-compose/{README => README.md} | 46 +++++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) rename tools/docker-compose/{README => README.md} (57%) diff --git a/tools/docker-compose/README b/tools/docker-compose/README.md similarity index 57% rename from tools/docker-compose/README rename to tools/docker-compose/README.md index 96510937ce..35cfd8a675 100644 --- a/tools/docker-compose/README +++ b/tools/docker-compose/README.md @@ -1,8 +1,50 @@ -docker build --no-cache=true --rm=true -t ansible/awx_devel:latest . -docker run --name awx_test -it --memory="4g" --cpuset="0,1" -v /Users/meyers/ansible/:/awx_devel -p 8013:8013 -p 8080:8080 -p 27017:27017 -p 2222:22 ansible/awx_devel +# Docker Compose for Dev container + +## How to start the Dev container + +In the root directory of your awx clone, run the following to build your docker image: + +``` +make docker-compose-build +``` + +Copy over your local settings + +``` +cp awx/settings/local_settings.py.docker_compose awx/settings/local_settings.py +``` + +Build the UI + +``` +make ui-devel +``` + +Run the container + +``` +make docker-compose +``` + +The app should now be accessible in your browser at `https://localhost:8043/#/home` + ## How to use the logstash container +#### Modify the docker-compose.yml + +Uncomment the following lines in the `docker-compose.yml` + +``` +#- logstash +... + +#logstash: +# build: +# context: ./docker-compose +# dockerfile: Dockerfile-logstash +``` + POST the following content to `/api/v2/settings/logging/` (this uses authentication set up inside of the logstash configuration file). From 9a38971d47d346fcb76f6211e66453da86d4c684 Mon Sep 17 00:00:00 2001 From: Christian Adams Date: Wed, 18 Mar 2020 18:27:04 -0400 Subject: [PATCH 2/2] Update ELK Stack container files --- tools/docker-compose/README.md | 12 +++++++++++- tools/elastic/README.md | 1 + tools/elastic/docker-compose.logstash-link.yml | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/docker-compose/README.md b/tools/docker-compose/README.md index 35cfd8a675..b3fdc1db4f 100644 --- a/tools/docker-compose/README.md +++ b/tools/docker-compose/README.md @@ -2,12 +2,16 @@ ## How to start the Dev container -In the root directory of your awx clone, run the following to build your docker image: +In the root directory of your awx clone, run the following to build your docker image. +This step takes a while, but once your image is built, you don't need to do this again +unless you make changes to the Dockerfile or any of the files used by the Dockerfile. ``` make docker-compose-build ``` +> Note: By default, this image will be tagged with your branch name. + Copy over your local settings ``` @@ -26,6 +30,8 @@ Run the container make docker-compose ``` +> Note: You may need to add `COMPOSE_TAG=` at the end of this to use the correct image for your branch. + The app should now be accessible in your browser at `https://localhost:8043/#/home` @@ -74,3 +80,7 @@ An example of how to view the most recent logs from the container: ``` docker exec -i -t $(docker ps -aqf "name=tools_logstash_1") tail -n 50 /logstash.log ``` + +#### How to add logstash plugins + +Add any plugins you need in `tools/elastic/logstash/Dockerfile` before running the container. diff --git a/tools/elastic/README.md b/tools/elastic/README.md index eb9d4f6531..ca804bb7af 100644 --- a/tools/elastic/README.md +++ b/tools/elastic/README.md @@ -16,6 +16,7 @@ done by getting via bash in the running Docker machine. Example: ```bash docker-machine ssh default sudo sysctl -w vm.max_map_count=262144 ``` +> Note: If you are running docker natively on linux, you need only run `sysctl -w vm.max_map_count=262144` After this, the containers can be started up with commands like: diff --git a/tools/elastic/docker-compose.logstash-link.yml b/tools/elastic/docker-compose.logstash-link.yml index 5c71629693..f8fa5a3aed 100644 --- a/tools/elastic/docker-compose.logstash-link.yml +++ b/tools/elastic/docker-compose.logstash-link.yml @@ -1,7 +1,7 @@ --- version: '2' services: - # Primary Tower Development Container - tower: + # Primary AWX Development Container + awx: links: - logstash