Skip to content

Commit e520066

Browse files
authored
Merge pull request #27 from Skejven/feature/karaf-provisioned-with-deps
Karaf image with all deps
2 parents 25ecc7b + 5c99d17 commit e520066

7 files changed

Lines changed: 22 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Not released yet
2+
- [PR-27](https://github.com/Skejven/aet-docker/pull/27) - Karaf provisioned with all dependencies - offline mode provisioning support.
23
- [PR-26](https://github.com/Skejven/aet-docker/pull/26) - AET Docker client for running AET suites with no dependencies but Docker
34
- [PR-22](https://github.com/Skejven/aet-docker/pull/22) - changed no of Selenium Grid Nodes replicas in order to improve tests results stability.
45
- [PR-23](https://github.com/Skejven/aet-docker/pull/23) - updated mongodb image version to `3.6`. **Important**: if you are upgrading AET from the version that used mongo 3.2, please read carefully upgrade notes before migrating. Updated docker swarm schema to `3.7`.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ Hosts [Apache ActiveMQ](http://activemq.apache.org/) that is used as the communi
5050
Hosts BrowserMob proxy that is used by AET to collect status codes and inject headers to requests.
5151
### AET Karaf
5252
Hosts [Apache Karaf](https://karaf.apache.org/) OSGi applications container.
53-
It contains all AET modules (bundles): Runner, Workers, Web-API, Datastorage, Executor, Cleaner and runs them within OSGi context.
54-
This container contains [AET application core](https://github.com/Cognifide/aet) in the `/aet/core` directory.
53+
It contains all AET modules (bundles): Runner, Workers, Web-API, Datastorage, Executor, Cleaner and runs them within OSGi context
54+
with all their dependencies required (no internet access required to provision).
55+
[AET application core](https://github.com/Cognifide/aet) is located in the `/aet/core` directory.
5556
All custom AET extensions are kept in the `/aet/custom` directory.
5657
### AET Report
5758
Runs [Apache Server](https://httpd.apache.org/) that hosts [AET Report](https://github.com/Cognifide/aet/wiki/SuiteReport).

example-aet-swarm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AET stack defined in this example runs:
2323
│   ├── ...
2424
│   └── com.github.skejven.collector.LighthouseCollectorFactory.cfg
2525
├── features
26-
│   └── healthcheck-features.xml
26+
│   └── custom-features.xml
2727
└── report
2828
```
2929

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Put custom AET features here, it will extend the existing features.

karaf/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG AET_VERSION="3.3.0"
3333
ARG AET_ARTIFACT="features.zip"
3434
ARG AET_ARTIFACT_DOWNLOAD_URL="https://github.com/Cognifide/aet/releases/download/${AET_VERSION}/${AET_ARTIFACT}"
3535

36-
RUN apk add --update bash tar jq curl && rm -rf /var/cache/apk/*
36+
RUN apk add --update bash tar jq curl tree && rm -rf /var/cache/apk/*
3737

3838
RUN curl -fSL -o /tmp/apache-karaf.tar.gz ${KARAF_DOWNLOAD_URL} \
3939
&& echo "${KARAF_DOWNLOAD_SHA512} /tmp/apache-karaf.tar.gz" | sha512sum -c - \
@@ -42,12 +42,15 @@ RUN curl -fSL -o /tmp/apache-karaf.tar.gz ${KARAF_DOWNLOAD_URL} \
4242
&& rm /tmp/apache-karaf.tar.gz \
4343
&& mkdir -p /opt/karaf/data /opt/karaf/data/log \
4444
&& echo org.ops4j.pax.url.mvn.defaultRepositories = file:///opt/maven/repository@id=local.app@snapshots >> /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg \
45-
&& sed -i "s+http://+https://+g" /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg
45+
&& sed -i "s+http://+https://+g" /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg \
46+
&& echo org.ops4j.pax.url.mvn.localRepository = file:///home/karaf/.m2/repository >> /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg
4647

4748
# download and unzip AET features
4849
RUN curl -fSL -o /tmp/${AET_ARTIFACT} ${AET_ARTIFACT_DOWNLOAD_URL} \
4950
&& unzip -o /tmp/${AET_ARTIFACT} -d /opt/karaf/deploy && rm /tmp/${AET_ARTIFACT}
5051

52+
COPY features/aet-healthcheck-features.xml /opt/karaf/deploy/aet-healthcheck-features.xml
53+
5154
# Run karaf and wait until it downloads all features
5255
COPY provision-karaf.sh /tmp/provision-karaf.sh
5356
RUN chmod a+x /tmp/provision-karaf.sh && sync && /tmp/provision-karaf.sh
@@ -76,6 +79,9 @@ RUN apk add --update bash jq curl tar && rm -rf /var/cache/apk/*
7679

7780
COPY --from=build /opt/karaf /opt/karaf
7881

82+
COPY --from=build /home/karaf/.m2/repository /home/karaf/.m2/repository
83+
RUN chown -R ${KARAF_USER}.${KARAF_USER} /home/karaf/.m2
84+
7985
# Copy Karaf config to watch for AET artifacts
8086
COPY etc/*.cfg /opt/karaf/etc/
8187

@@ -94,9 +100,7 @@ RUN mv /opt/karaf/deploy/aet-*.xml /aet/core/features \
94100
&& chown -R ${KARAF_USER}.${KARAF_USER} /aet/core/features \
95101
&& chown -R ${KARAF_USER}.${KARAF_USER} /aet/extra/features
96102

97-
RUN chown -R ${KARAF_USER}.${KARAF_USER} /opt/karaf \
98-
&& echo org.ops4j.pax.url.mvn.defaultRepositories = file:///opt/maven/repository@id=local.app@snapshots >> /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg \
99-
&& sed -i "s+http://+https://+g" /opt/karaf/etc/org.ops4j.pax.url.mvn.cfg
103+
RUN chown -R ${KARAF_USER}.${KARAF_USER} /opt/karaf
100104

101105
EXPOSE 1099 8101 8181 44444
102106

File renamed without changes.

karaf/provision-karaf.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,24 @@ get_bundles_status() {
2727
curl -s ${KARAF_URL} | jq '.status'
2828
}
2929

30-
echo "Start waiting for Karaf to load features - up to 200 seconds, waiting for 187 active bundles"
30+
echo "Start waiting for Karaf to load features - up to 200 seconds, waiting for 189 active bundles"
3131

3232
/opt/karaf/bin/karaf run &
3333

3434
for i in $(seq 0 60);
3535
do
3636
sec=$((5 * $i))
37-
if curl -s ${KARAF_URL} 2>&1 | jq '.status' | grep -Fq "187 bundles active";
37+
if curl -s ${KARAF_URL} 2>&1 | jq '.status' | grep -Fq "189 bundles active";
3838
then
3939
echo "Karaf loading finished after $sec seconds";
4040
get_bundles_status
4141
/opt/karaf/bin/karaf stop
4242
echo "Status: $(/opt/karaf/bin/karaf status)"
43+
44+
echo "***** /home/karaf/.m2/repository ****"
45+
tree /home/karaf/.m2/repository
46+
echo "***************************************"
47+
4348
exit 0;
4449
else
4550
status_code=$(get_status_code)

0 commit comments

Comments
 (0)