Code Monkey home page Code Monkey logo

easytravel-docker's Introduction

easyTravel-Docker

easyTravel Logo

This project builds and deploys the Dynatrace easyTravel demo application in Docker. All components are readily available on the Docker Hub.

Application Components

Component Description
mongodb A pre-populated travel database (MongoDB).
backend The easyTravel Business Backend (Java).
frontend The easyTravel Customer Frontend (Java).
nginx A reverse-proxy for the easyTravel Customer Frontend (NGINX).
angularfrontend The easyTravel Customer Frontend (Java,Angular).
headleassloadgen Load generator using headless Chrome (Java).
pluginservice Optional component that keeps state of plugins. Used in case of multiple backend components (Java).
mongodb-content-creator Allows to create easyTravel database content in empty MongoDB database.
loadgen (deprecated) A synthetic load generator (Java).

Run easyTravel in Docker

You can run easyTravel by using Docker Compose with the provided docker-compose.yml file like so:

docker-compose up

NOTE: if you want to decrease memory usage, you can remove loadgen component from docker-compose.yml

Configure easyTravel in Docker

Aligning with principles of 12factor apps, one of them which requires strict separation of configuration from code, easyTravel can be configured at startup time via the following environment variables:

Component Environment Variable Defaults Description
backend ET_DATABASE_LOCATION  easytravel-mongodb:27017 The location of the database the easyTravel Business Backend shall connect to.
backend ET_MONGO_AUTH_DB  admin Name of the MongoDB authentication database
backend ET_DATABASE_USER  etAdmin Name of the MongoDB user
backend ET_DATABASE_PASSWORD adminadmin MongoDB user password
frontend ET_BACKEND_URL http://easytravel-backend:8080  The URL to easyTravel's Business Backend.
nginx ET_FRONTEND_LOCATION easytravel-frontend:8080 The location of the Customer Frontend the easyTravel WWW server shall serve via port 80.
nginx ET_BACKEND_LOCATION easytravel-backend:8080 The location of the Business Backend the easyTravel WWW server shall serve via port 8080.
backend
frontend
ET_APM_SERVER_DEFAULT APM The type of used server. Can be "APM" for Dynatrace and "Classic" for AppMon
angularfrontend ET_BACKEND_URL http://easytravel-backend:8080 The URL to easyTravel's Business Backend
headlessloadgen ET_FRONTEND_URL http://easytravel-www:9079 The URL to easyTravel's Frontend
headlessloadgen ET_VISIT_NUMBER 1 The number of visits generated per minute
headlessloadgen MAX_CHROME_DRIVERS 1 Maximum number of chrome drivers
headlessloadgen REUSE_CHROME_DRIVER_FREQUENCY 1 How many times we should use one chrome instance for generating visits. Increasing this improves performance, however causes some strange behaviours with generated user sessions.
headlessloadgen SCENARIO_NAME Headless Scenario Name of the scenario
headlessloadgen ET_PROBLEMS BadCacheSynchronization,
CPULoad,
DatabaseCleanup,
FetchSizeTooSmall,
JourneySearchError404,
JourneySearchError500,
LoginProblems,
MobileErrors,
TravellersOptionBox
A list of supported problem patterns, see below on how to activate.
headlessloadgen ET_PROBLEMS_DELAY 0 A delay in seconds. When used with Dynatrace, it is suggested to use a value of 7500 (slightly more than 2 hours) so that Dynatrace can learn from an error-free behavior first.
loadgen ET_WWW_URL http://easytravel-www:80 The URL to easytravel's Customer Frontend.
loadgen ET_BACKEND_URL http://easytravel-www:8080 The URL to easyTravel's Business Backend (optional). If provided, the problem patterns provided in ET_PROBLEMS will be applied consecutively for a duration of 10 minutes each.
loadgen ET_PROBLEMS BadCacheSynchronization,
CPULoad,
DatabaseCleanup,
FetchSizeTooSmall,
JourneySearchError404,
JourneySearchError500,
LoginProblems,
MobileErrors,
TravellersOptionBox
A list of supported problem patterns, see below on how to activate.
loadgen ET_PROBLEMS_DELAY 0 A delay in seconds. When used with Dynatrace, it is suggested to use a value of 7500 (slightly more than 2 hours) so that Dynatrace can learn from an error-free behavior first.
loadgen ET_VISIT_NUMBER 2 The number of visits generated per minute

Enable easyTravel Problem Patterns

The following problem patterns are supported and triggered through the loadgen component, as described above:

Pattern Description
BadCacheSynchronization Activating this plugin causes synchronization problems in the customer frontend and uses a lot of CPU by doing an inefficient cache lookup. Activating this plugin should show a class 'CacheLookup' as doing lots of synchronization.
CPULoad Causes high CPU usage in the business backend process to provoke an unhealthy host health state. The additional CPU time is triggered in 8 separate threads independent of any searching/booking activity.
DatabaseCleanup Cleans out items where we continuously accumulate data in the Database, e.g. Booking and LoginHistory and keeps the last 5000 to avoid filling up the database over time. This is done every 5 minutes at the point where a Journey is searched. Usually this plugin is enabled by default, if you disable it, the database will fill up over time, especially if traffic is generated automatically.
FetchSizeTooSmall This plugin sets the fetchsize of the Hibernate persistence layer to 1 when executing database queries. This will cause inefficient select statements to show up on databases where otherwise Hibernate is optimizing fetches into bulks.
JourneySearchError404  Causes an HTTP 404 error code by returning an image name that does not exist when searching for journeys in the customer frontend web application.
JourneySearchError500  Throws an HTTP 500 server error if the journey search parameters are invalid, e.g. toDate is before fromDate
 LargeMemoryLeak  Causes a large memory leak in the business backend when locations are queried for auto-completion in the search text box in the customer frontend. Note: This will quickly lead to a non-functional Java backend application because of out-of-memory errors.
LoginProblems Simulates an execption when a login is performed in the customer frontend application.
MobileErrors Journey searches and bookings from mobile devices create errors. (no errors created for Tablets)
 TravellersOptionBox  Causes an 'ArrayIndexOutOfBoundsException' wrapped in an 'InvalidTravellerCostItemException' if in the review-step of the booking flow in the customer frontend, the last option '2 adults+2 kids' is selected in the combo-box for 'travellers'.

How to build easyTravel Docker images ?

Use build.sh if you want to build easyTravel Docker images yourself.

How to build easyTravel deployment artefacts ?

Option A: 'build-et.sh'

The build-et.sh script builds easyTravel deployment artefacts into a directory deploy inside your current working directory, by default. You can override the default behavior by providing the following environment variables to the script:

Environment Variable Defaults Description
ET_SRC_URL http://etinstallers.demoability.dynatracelabs.com/latest/dynatrace-easytravel-src.zip A URL to an easyTravel source distribution .zip file.
ET_DEPLOY_HOME ./deploy A directory to contain the easyTravel deployment artefacts.
ET_BB_DEPLOY_HOME ./backend A directory under ${ET_DEPLOY_HOME} to contain the easyTravel Business Backend deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_BB_DEPLOY_HOME}).
ET_CF_DEPLOY_HOME ./frontend A directory under ${ET_DEPLOY_HOME} to contain the easyTravel Customer Frontend deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_CF_DEPLOY_HOME}).
ET_ACF_DEPLOY_HOME ./angularfrontend A directory under ${ET_DEPLOY_HOME} to contain the easyTravel Customer Frontend (Angular) deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_ACF_DEPLOY_HOME}).
ET_LG_DEPLOY_HOME ./loadgen A directory under ${ET_DEPLOY_HOME} to contain the easyTravel UEM load generator deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_LG_DEPLOY_HOME}).
ET_HLG_DEPLOY_HOME ./headlessloadgen A directory under ${ET_DEPLOY_HOME} to contain the easyTravel headless Angular load generator (Java) deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_HLG_DEPLOY_HOME}).
ET_MG_DEPLOY_HOME ./mongodb A directory under ${ET_DEPLOY_HOME} to contain the easyTravel pre-populated travel database (will be located in ${ET_DEPLOY_HOME}/${ET_MG_DEPLOY_HOME}).
ET_MGC_DEPLOY_HOME ./mongodb-content-creator A directory under ${ET_DEPLOY_HOME} to contain the easyTravel MongoDB Content Creator deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_MGC_DEPLOY_HOME}).
ET_PS_DEPLOY_HOME ./pluginservice A directory under ${ET_DEPLOY_HOME} to contain the easyTravel Plugin Service deployment artefact (will be located in ${ET_DEPLOY_HOME}/${ET_PS_DEPLOY_HOME}).

Example: create deployment artefacts in ./deploy:

./build-et.sh

Example: create deployment artefacts in ./deploy and no sub-folders:

export ET_BB_DEPLOY_HOME=. \
export ET_CF_DEPLOY_HOME=. \
export ET_ACF_DEPLOY_HOME=. \
export ET_LG_DEPLOY_HOME=. \
export ET_HLG_DEPLOY_HOME=. \
export ET_MG_DEPLOY_HOME=. \
export ET_MGC_DEPLOY_HOME=. \
export ET_PS_DEPLOY_HOME=. \
./build-et.sh

Option B: 'build-in-docker.sh'

Use build-in-docker.sh if you want to build easyTravel deployment artefacts in a build environment that runs in Docker, so you don't have to set up your own. Deployment artefacts can be found in a directory deploy inside your current working directory. You can override the default behavior by providing environment variables to the script (the same variables as in Option A).

Problems? Questions? Suggestions?

This offering is Dynatrace Community Supported. Feel free to share any problems, questions and suggestions with your peers on the Dynatrace Community's Application Monitoring & UEM Forum.

License

Licensed under the MIT License. See the LICENSE file for details.

easytravel-docker's People

Contributors

demoability-robot avatar jay-nelson-dynatrace avatar krzysztofsajko avatar maciejbrowarczyk avatar metmajer avatar paweldomaradzki-dt avatar rafalpsciuk avatar tomasz-wieremjewicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easytravel-docker's Issues

RFE: Make Nginx Access Log Configurable via Environment Variable

Nginx Access Logs are configured in nginx.conf. By default, in the configuration used by the Docker images available on Dockerhub have Nginx Access Logs disabled.

https://github.com/Dynatrace/easyTravel-Docker/blob/master/images/nginx/conf/nginx.conf

For those that wish to use the images on Dockerhub (not build their own) and have Nginx Access Logs enabled, it would be helpful if this configuration was controlled through an Environment Variable. Similar to those configurations already referencing an Environment Variable in the nginx.conf file.

upstream easytravelfrontend {
        server $ET_FRONTEND_LOCATION;
    }

Persistent Hourly Authentication and CPU problems when ET_PROBLEMS are disabled

loadgen:
  container_name: loadgen
  image: "dynatrace/easytravel-loadgen"
  links:
  - backend
  - frontend
  - www
  environment:
    ET_APM_SERVER_DEFAULT: "${ET_APM_SERVER_DEFAULT}"
    ET_FRONTEND_URL: "http://easytravel-www:80"
    ET_BACKEND_URL: "http://easytravel-www:8080"
    ET_PROBLEMS: ""

ET_PROBLEMS: ""
Every hour there are authentication problems and CPU problems.
Based on this yml config no problems should be present in our easyTravel deployment.
This is conflicting with problems we are manually simulating and remediating

Dynatrace oneAgent

Hello everybody,

I have the latest version of easyTravel Docker installed. The services are also recognized by the OneAgent, but they can not be monitored. On Dynatrace Hompage is: reboot the service to get more informations. But even after restarting the service or docker, nothing changes.

Many Thanks
Alexander

Unable to build mongo image

I'm trying to build the images so they can run in a raspberry pi (using docker buildx), and it seems that mongo is no longer in the dependencies of alpine.
I tried using different alpine versions (3.6 - 3.11) as the base image, adding the community repos and the edge ones but without success.

Checking dockerhub the image was built 4 months ago, was this build using a different Dockerfile than the one in this repo?

Control Loadgen

It's not possible to control the amount of requests the loadgenerator is running.
It would be great to have access to the weblauncher interface or something similar to change user behavior while the application is running.

HTTP 400 Errors due to nginx configuration

In order to be able to make easyTravel work properly with nginx, I had to make the following change in the nginx configuration:

         location / {
+           proxy_set_header    Host $http_host;
             proxy_pass http://easytravel_frontend;
         }

Without that I always got HTTP 400 errors when trying to navigate there.

mongodb exited with code 100

Hi,

Mongodb doesn't run correctly. What can I do to fix it?
The logs are here;

mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] MongoDB starting : pid=11 port=27017 dbpath=/data/db/easyTravel 64-bit host=easytravel-mongodb
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] db version v3.4.10
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] git version: 078f28920cb24de0dd479b5ea6c66c644f6326e9
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] OpenSSL version: LibreSSL 2.6.5
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] allocator: system
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] modules: none
mongodb     | 2020-03-25T01:55:16.682+0000 I CONTROL  [initandlisten] build environment:
mongodb     | 2020-03-25T01:55:16.683+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongodb     | 2020-03-25T01:55:16.683+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongodb     | 2020-03-25T01:55:16.683+0000 I CONTROL  [initandlisten] options: { net: { http: { RESTInterfaceEnabled: true, enabled: true } }, storage: { dbPath: "/data/db/easyTravel", mmapv1: { smallFiles: true } } }
mongodb     | 2020-03-25T01:55:16.692+0000 I -        [initandlisten] Detected data files in /data/db/easyTravel created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongodb     | 2020-03-25T01:55:16.692+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=2471M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
mongodb     | 2020-03-25T01:55:16.701+0000 E STORAGE  [initandlisten] WiredTiger error (-31803) [1585101316:701856][11:0x7f21c4d44b50], txn-recover: Recovery failed: WT_NOTFOUND: item not found
mongodb     | 2020-03-25T01:55:16.766+0000 I -        [initandlisten] Assertion: 28595:-31803: WT_NOTFOUND: item not found src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 276
mongodb     | 2020-03-25T01:55:16.823+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 -31803: WT_NOTFOUND: item not found, terminating
mongodb     | 2020-03-25T01:55:16.823+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
mongodb     | 2020-03-25T01:55:16.823+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
mongodb     | 2020-03-25T01:55:16.824+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
mongodb     | 2020-03-25T01:55:16.824+0000 I CONTROL  [initandlisten] now exiting
mongodb     | 2020-03-25T01:55:16.824+0000 I CONTROL  [initandlisten] shutting down with code:100
mongodb exited with code 100

docker-compose-withDtAppMon.yml does not match Dynatrace-AppMon-Docker project

I'm trying to get the dockerized version of AppMon to work with easyTravel-Docker as per the instructions. I've successfully setup Dynatrace-AppMon-Docker and can run it in docker.

Unfortunately, the command docker-compose -f docker-compose-withDtAppMon.yml up fails because the links to the AppMon docker setup (networks, volumes) do not match. I've tried porting the configuration file to v3 and fixing the links, but have been unable to get it working.

Any help would be much appreciated.

Thanks,
Martin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.