Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 2b03dbf

Browse files
committed
WIP: build with JDK11 and Docker on CircleCI
* Upgrade docker-maven-plugin from 0.4.13 to 1.2.0 * latest version supports Java 11 * Upgrade ssh-agent-tls from 0.0.3 to 0.0.4 * Upgrade ssh-agent-proxy from 0.1.5 to 0.2.0
1 parent 931a1fd commit 2b03dbf

5 files changed

Lines changed: 103 additions & 14 deletions

File tree

.circleci/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Dockerfile for the container CircleCI uses to build and test helios
2+
FROM ubuntu:bionic
3+
4+
RUN apt-get -qq update && apt-get -qq install \
5+
# Required tools for primary containers that aren't already in bionic
6+
# https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers
7+
git ssh \
8+
# tools we need
9+
wget maven lsof jq python-minimal python-pip
10+
11+
# Download and validate checksum of openjdk-11
12+
# Checksum from https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz.sha256
13+
RUN wget --quiet https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz && \
14+
echo '3784cfc4670f0d4c5482604c7c513beb1a92b005f569df9bf100e8bef6610f2e openjdk-11_linux-x64_bin.tar.gz' > openjdk-11-sha256sum.txt && \
15+
sha256sum -c openjdk-11-sha256sum.txt
16+
17+
# Install openjdk-11
18+
RUN tar -xzf openjdk-11_linux-x64_bin.tar.gz && \
19+
mkdir -p /usr/lib/jvm && \
20+
mv jdk-11 /usr/lib/jvm/openjdk-11 && \
21+
update-alternatives --install /usr/bin/java java /usr/lib/jvm/openjdk-11/bin/java 20000 && \
22+
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/openjdk-11/bin/javac 20000
23+
24+
# Install codecov
25+
RUN pip install codecov

.circleci/config.yml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
environment:
1313
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
1414
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
15+
CIRCLE_MACHINE_EXECUTOR: true
1516
MAVEN_OPTS: -Xmx128m
1617
JAVA_VERSION: *jdk_180_version
1718

@@ -37,7 +38,7 @@ jobs:
3738
if [[ $(python --version 2>&1) = *"2.7.10"* ]] || pyenv versions --bare | grep -x -q '2.7.10'; then pyenv global 2.7.10;else pyenv install --skip-existing 2.7.10 && pyenv global 2.7.10 && pyenv rehash && pip install virtualenv && pip install nose && pip install pep8 && pyenv rehash;fi
3839
3940
# Configuring Docker to accept remote connections
40-
- run: ./circle.sh pre_machine
41+
- run: ./circle.sh pre_machine && ./circle.sh pre_machine_docker
4142

4243
# Restarting docker for the changes to be applied
4344
- run: sudo service docker restart
@@ -64,3 +65,60 @@ jobs:
6465
path: /var/log/upstart/docker.log
6566
- store_artifacts:
6667
path: /tmp/circleci-test-results
68+
69+
build_java11:
70+
docker:
71+
- image: dxia/bionic-openjdk11:test
72+
resource_class: large
73+
working_directory: ~/spotify/helios
74+
parallelism: 6
75+
shell: /bin/bash --login
76+
environment:
77+
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
78+
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
79+
MAVEN_OPTS: -Xmx128m
80+
81+
steps:
82+
# Machine Setup
83+
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
84+
# The following `checkout` command checks out your code to your working directory. In 1.0 this is done implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
85+
- checkout
86+
87+
- setup_remote_docker
88+
89+
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
90+
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
91+
92+
- run: ./circle.sh pre_machine
93+
94+
- run:
95+
command: ./circle.sh dependencies
96+
no_output_timeout: 20m
97+
98+
- run:
99+
command: ./circle.sh test
100+
no_output_timeout: 20m
101+
102+
- run: if [ "$CIRCLE_NODE_INDEX" == "0" ]; then ./circle.sh post_test; fi
103+
104+
- run: ./circle.sh collect_test_reports
105+
106+
- store_test_results:
107+
path: /tmp/circleci-test-results
108+
109+
# Save artifacts
110+
- store_artifacts:
111+
path: /tmp/circleci-artifacts
112+
- store_artifacts:
113+
path: artifacts
114+
- store_artifacts:
115+
path: /var/log/upstart/docker.log
116+
- store_artifacts:
117+
path: /tmp/circleci-test-results
118+
119+
workflows:
120+
version: 2
121+
build_and_test:
122+
jobs:
123+
- build
124+
- build_java11

circle.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
case "$1" in
44
pre_machine)
5+
grep -c ^processor /proc/cpuinfo
6+
57
# ensure correct level of parallelism
68
expected_nodes=6
79
if [ "$CIRCLE_NODE_TOTAL" -ne "$expected_nodes" ]
@@ -10,15 +12,17 @@ case "$1" in
1012
exit 1
1113
fi
1214

15+
# Edit pom files to have correct version syntax
16+
for i in $(find . -name pom.xml -not -path './.rvm*'); do sed -i 's/${revision}/0/g' $i; done
17+
18+
;;
19+
20+
pre_machine_docker)
1321
# have docker bind to localhost
1422
docker_opts='DOCKER_OPTS="$DOCKER_OPTS -H tcp://0.0.0.0:2375"'
1523
sudo sh -c "echo '$docker_opts' >> /etc/default/docker"
16-
1724
cat /etc/default/docker
1825

19-
# Edit pom files to have correct version syntax
20-
for i in $(find . -name pom.xml -not -path './.rvm*'); do sed -i 's/${revision}/0/g' $i; done
21-
2226
;;
2327

2428
post_machine)
@@ -34,10 +38,12 @@ case "$1" in
3438
;;
3539

3640
test)
37-
# fix DOCKER_HOST to be accessible from within containers
38-
docker0_ip=$(/sbin/ifconfig docker0 | grep 'inet addr' | \
39-
awk -F: '{print $2}' | awk '{print $1}')
40-
export DOCKER_HOST="tcp://$docker0_ip:2375"
41+
if [ -n "$CIRCLE_MACHINE_EXECUTOR" ]; then
42+
# fix DOCKER_HOST to be accessible from within containers
43+
docker0_ip=$(/sbin/ifconfig docker0 | grep 'inet addr' | \
44+
awk -F: '{print $2}' | awk '{print $1}')
45+
export DOCKER_HOST="tcp://$docker0_ip:2375"
46+
fi
4147

4248
case $CIRCLE_NODE_INDEX in
4349
0)

helios-services/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<plugin>
3636
<groupId>com.spotify</groupId>
3737
<artifactId>docker-maven-plugin</artifactId>
38-
<version>0.4.13</version>
38+
<version>1.2.0-SNAPSHOT</version>
3939
<configuration>
4040
<labels>
4141
<label>com.spotify.helios.version="${project.version}"</label>
@@ -119,7 +119,7 @@
119119
<plugin>
120120
<groupId>com.spotify</groupId>
121121
<artifactId>docker-maven-plugin</artifactId>
122-
<version>0.4.13</version>
122+
<version>1.2.0-SNAPSHOT</version>
123123
<configuration>
124124
<labels>
125125
<label>com.spotify.helios.version="${project.version}"</label>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@
323323
<dependency>
324324
<groupId>com.spotify</groupId>
325325
<artifactId>ssh-agent-tls</artifactId>
326-
<version>0.0.3</version>
326+
<version>0.0.4</version>
327327
</dependency>
328328
<dependency>
329329
<groupId>com.spotify</groupId>
330330
<artifactId>ssh-agent-proxy</artifactId>
331-
<version>0.1.5</version>
331+
<version>0.2.0</version>
332332
</dependency>
333333

334334
<!--
@@ -435,7 +435,7 @@
435435
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
436436
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
437437
<autoReleaseAfterClose>true</autoReleaseAfterClose>
438-
<jacoco.version>0.7.1.201405082137</jacoco.version>
438+
<jacoco.version>0.8.2</jacoco.version>
439439
<jdeb.skip>false</jdeb.skip>
440440
<surefire.version>2.16</surefire.version>
441441
<surefireArgLine>-Xmx128m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</surefireArgLine>

0 commit comments

Comments
 (0)