Skip to content

Commit

Permalink
Merge pull request #19 from Skejven/feature/enable-dynamic-api-exposi…
Browse files Browse the repository at this point in the history
…ng-via-report-apache

Enable exposing AET WebAPI via Report server
  • Loading branch information
Skejven authored Feb 20, 2020
2 parents d5f1ef9 + a10dd35 commit 296e9c0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Not released yet
Nothing now :)
- [PR-18](https://github.com/Skejven/aet-docker/pull/18] - Add env variable for karaf hostname
- [PR-19](https://github.com/Skejven/aet-docker/pull/19) - Enable exposing AET WebAPI via Report server

# 0.12.1
- [PR-17](https://github.com/Skejven/aet-docker/pull/17) Update maven repositories to use https over http. Fixes '501-https-required' error while downloading karaf dependecies. More info about the issue [here](https://support.sonatype.com/hc/en-us/articles/360041287334).
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You may find released versions of AET Docker images at [Docker Hub](https://clou
* [How to use external MongoDB](#how-to-use-external-mongodb)
* [How to use external Selenium Grid](#how-to-use-external-selenium-grid)
* [How to set report domain](#how-to-set-report-domain)
* [How to expose AET Web API](#how-to-expose-aet-web-api)
* [How to enable AET instance to run more tests simultaneously](#how-to-enable-aet-instance-to-run-more-tests-simultaneously)
* [How to use external Selenium Grid nodes](#how-to-use-external-selenium-grid-nodes)
* [Is there other way to run AET than with Docker Swarm cluster](#is-there-other-way-to-run-aet-than-with-docker-swarm-cluster)
Expand All @@ -44,10 +45,10 @@ You may find released versions of AET Docker images at [Docker Hub](https://clou
Hosts [Apache ActiveMQ](http://activemq.apache.org/) that is used as the communication bus by the AET components.
### AET Browsermob
Hosts BrowserMob proxy that is used by AET to collect status codes and inject headers to requests.
### AET Apache Karaf
### AET Karaf
Hosts [Apache Karaf](https://karaf.apache.org/) OSGi applications container.
It contains all AET modules (bundles): Runner, Workers, Web-API, Datastorage, Executor, Cleaner and runs them within OSGi context.
### AET Apache Server
### AET Report
Runs [Apache Server](https://httpd.apache.org/) that hosts [AET Report](https://github.com/Cognifide/aet/wiki/SuiteReport).

## Running AET instance with Docker Swarm
Expand Down Expand Up @@ -279,6 +280,12 @@ After you setup external Selenium Grid, update the `seleniumGridUrl` property in
### How to set report domain
Set `report-domain` property in the `com.cognifide.aet.rest.helpers.ReportConfigurationManager.cfg` to point the domain.

### How to expose AET Web API
[AET Web API](https://github.com/Cognifide/aet/wiki/WebAPI) is hosed by the AET Karaf instance.
In order to avoid CORS errors from the Report Application, AET Web API is exposed by the AET Report Apache Server (`ProxyPass`).
By default it is set to work with Docker cluster managers such as Swarm or Kubernetes and points to `http://karaf:8181/api`.
Use `AET_WEB_API` environment variable to change the URL of the AET Web API.

### How to enable AET instance to run more tests simultaneously
> Notice: those changes will impact your machine resources, be sure to extend the number of CPUs and memory
> if you scale up a number of browsers.
Expand Down
2 changes: 2 additions & 0 deletions example-aet-swarm/aet-swarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,7 @@ services:
- "80:80"
# volumes:
# - ./report:/usr/local/apache2/htdocs
# environment:
# - AET_WEB_API=http://my.karaf.com/api # uncomment to configure custom AET Web API endpoint
networks:
- private
2 changes: 1 addition & 1 deletion report/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ENV APACHE_WWW_DIR /usr/local/apache2/htdocs
ENV APACHE_LOG_DIR /usr/local/apache2/logs
ENV APACHE_CONFIG_DIR /usr/local/apache2/conf
ENV APACHE_MODULES "deflate proxy proxy_http"
ENV KARAF_HOSTNAME karaf
ENV AET_WEB_API http://karaf:8181/api

# clear default content
RUN rm -rf ${APACHE_WWW_DIR}}/*
Expand Down
2 changes: 1 addition & 1 deletion report/aet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@

<Location "/api">
Header set Access-Control-Allow-Origin "*"
ProxyPass http://${KARAF_HOSTNAME}:8181/api
ProxyPass ${AET_WEB_API}
</Location>
</VirtualHost>

0 comments on commit 296e9c0

Please sign in to comment.