Skip to content

Commit 40922c9

Browse files
committed
tweak the build process to run a little faster
1 parent 9acc81f commit 40922c9

33 files changed

+916
-501
lines changed

.travis.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@ language: python
44
cache: pip
55

66
env:
7-
- 'PYLINT_ENABLE=1'
7+
global:
8+
LIBGIT2_VERSION: "0.26.5"
9+
LIBGIT2_SRC_URL=https://github.com/libgit2/libgit2/archive/v${LIBGIT2_VERSION}.tar.gz
10+
LIBGIT2_DIR_NAME=libgit2-${LIBGIT2_VERSION}
11+
LIBGIT2_TAR_NAME=${LIBGIT2_DIR_NAME}.tar.gz
12+
LIBGIT2: ~/libgit2/_install
13+
LD_LIBRARY_PATH: ${LIBGIT2}/lib:${LD_LIBRARY_PATH}
814

915
python:
10-
- "2.7"
11-
- "3.6"
12-
13-
matrix:
14-
allow_failures:
15-
- python: "3.6"
16+
- "3.6.10"
1617

1718
install:
1819
- pip install -r test-requirements.txt
1920

2021
script:
21-
- bash tests/travis-runner.sh
22+
- wget -q "$LIBGIT2_SRC_URL" -O $LIBGIT2_TAR_NAME
23+
- tar -xzf $LIBGIT2_TAR_NAME
24+
- (cd $LIBGIT2_DIR_NAME; cmake . -DMAKE_INSTALL_PREFIX=${LIBGIT2} && make -j 5 install)
25+
- pip install --upgrade pip
26+
- pip install --upgrade -r <( bash pkg/generate-requirements.sh )
27+
- pytest tests/unittests

cp-pyinstaller.bash

-10
This file was deleted.

pkg/amazonlinux2016.09/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,24 @@ ENV _HOOK_DIR="./pkg/"
173173
ENV _BINARY_LOG_LEVEL="INFO"
174174
ENV _INCLUDE_PATH=""
175175
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
176+
176177
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
177178
&& cd "$HUBBLE_SRC_PATH" \
178-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
179-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
180-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
181-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
182-
RUN eval "$(pyenv init -)" \
183-
&& cd "$HUBBLE_SRC_PATH" \
184-
&& python setup.py egg_info \
185-
&& pip install --upgrade \
186-
-r hubblestack.egg-info/requires.txt \
187-
-r optional-requirements.txt \
188-
-r package-requirements.txt
179+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
180+
181+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
182+
&& rm -rf /hubble_build/.git
183+
184+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
185+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
186+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
187+
/hubble_build/hubblestack/__init__.py \
188+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
189+
189190
RUN mkdir /data
190191
VOLUME /data
192+
191193
WORKDIR /hubble_build
194+
192195
COPY entrypoint.sh /entrypoint.sh
193196
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/amazonlinux2016.09/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/centos6/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,24 @@ ENV _HOOK_DIR="./pkg/"
174174
ENV _BINARY_LOG_LEVEL="INFO"
175175
ENV _INCLUDE_PATH=""
176176
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
177+
177178
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
178179
&& cd "$HUBBLE_SRC_PATH" \
179-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
180-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
181-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
182-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
183-
RUN eval "$(pyenv init -)" \
184-
&& cd "$HUBBLE_SRC_PATH" \
185-
&& python setup.py egg_info \
186-
&& pip install --upgrade \
187-
-r hubblestack.egg-info/requires.txt \
188-
-r optional-requirements.txt \
189-
-r package-requirements.txt
180+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
181+
182+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
183+
&& rm -rf /hubble_build/.git
184+
185+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
186+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
187+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
188+
/hubble_build/hubblestack/__init__.py \
189+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
190+
190191
RUN mkdir /data
191192
VOLUME /data
193+
192194
WORKDIR /hubble_build
195+
193196
COPY entrypoint.sh /entrypoint.sh
194197
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/centos6/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/centos7/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,24 @@ ENV _HOOK_DIR="./pkg/"
173173
ENV _BINARY_LOG_LEVEL="INFO"
174174
ENV _INCLUDE_PATH=""
175175
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
176+
176177
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
177178
&& cd "$HUBBLE_SRC_PATH" \
178-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
179-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
180-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
181-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
182-
RUN eval "$(pyenv init -)" \
183-
&& cd "$HUBBLE_SRC_PATH" \
184-
&& python setup.py egg_info \
185-
&& pip install --upgrade \
186-
-r hubblestack.egg-info/requires.txt \
187-
-r optional-requirements.txt \
188-
-r package-requirements.txt
179+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
180+
181+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
182+
&& rm -rf /hubble_build/.git
183+
184+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
185+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
186+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
187+
/hubble_build/hubblestack/__init__.py \
188+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
189+
189190
RUN mkdir /data
190191
VOLUME /data
192+
191193
WORKDIR /hubble_build
194+
192195
COPY entrypoint.sh /entrypoint.sh
193196
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/centos7/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/coreos/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -186,21 +186,24 @@ ENV _HOOK_DIR="./pkg/"
186186
ENV _BINARY_LOG_LEVEL="INFO"
187187
ENV _INCLUDE_PATH=""
188188
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
189+
189190
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
190191
&& cd "$HUBBLE_SRC_PATH" \
191-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
192-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
193-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
194-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
195-
RUN eval "$(pyenv init -)" \
196-
&& cd "$HUBBLE_SRC_PATH" \
197-
&& python setup.py egg_info \
198-
&& pip install --upgrade \
199-
-r hubblestack.egg-info/requires.txt \
200-
-r optional-requirements.txt \
201-
-r package-requirements.txt
192+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
193+
194+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
195+
&& rm -rf /hubble_build/.git
196+
197+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
198+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
199+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
200+
/hubble_build/hubblestack/__init__.py \
201+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
202+
202203
RUN mkdir /data
203204
VOLUME /data
205+
204206
WORKDIR /hubble_build
207+
205208
COPY entrypoint.sh /entrypoint.sh
206209
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/coreos/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/debian10/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,24 @@ ENV _HOOK_DIR="./pkg/"
190190
ENV _BINARY_LOG_LEVEL="INFO"
191191
ENV _INCLUDE_PATH=""
192192
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
193+
193194
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
194195
&& cd "$HUBBLE_SRC_PATH" \
195-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
196-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
197-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
198-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
199-
RUN eval "$(pyenv init -)" \
200-
&& cd "$HUBBLE_SRC_PATH" \
201-
&& python setup.py egg_info \
202-
&& pip install --upgrade \
203-
-r hubblestack.egg-info/requires.txt \
204-
-r optional-requirements.txt \
205-
-r package-requirements.txt
196+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
197+
198+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
199+
&& rm -rf /hubble_build/.git
200+
201+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
202+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
203+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
204+
/hubble_build/hubblestack/__init__.py \
205+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
206+
206207
RUN mkdir /data
207208
VOLUME /data
209+
208210
WORKDIR /hubble_build
211+
209212
COPY entrypoint.sh /entrypoint.sh
210213
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/debian10/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/debian8/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,24 @@ ENV _HOOK_DIR="./pkg/"
192192
ENV _BINARY_LOG_LEVEL="INFO"
193193
ENV _INCLUDE_PATH=""
194194
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
195+
195196
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
196197
&& cd "$HUBBLE_SRC_PATH" \
197-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
198-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
199-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
200-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
201-
RUN eval "$(pyenv init -)" \
202-
&& cd "$HUBBLE_SRC_PATH" \
203-
&& python setup.py egg_info \
204-
&& pip install --upgrade \
205-
-r hubblestack.egg-info/requires.txt \
206-
-r optional-requirements.txt \
207-
-r package-requirements.txt
198+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
199+
200+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
201+
&& rm -rf /hubble_build/.git
202+
203+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
204+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
205+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
206+
/hubble_build/hubblestack/__init__.py \
207+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
208+
208209
RUN mkdir /data
209210
VOLUME /data
211+
210212
WORKDIR /hubble_build
213+
211214
COPY entrypoint.sh /entrypoint.sh
212215
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/debian8/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

pkg/debian9/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,24 @@ ENV _HOOK_DIR="./pkg/"
190190
ENV _BINARY_LOG_LEVEL="INFO"
191191
ENV _INCLUDE_PATH=""
192192
ENV LD_LIBRARY_PATH=/opt/hubble/lib:/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64
193+
193194
RUN set -x; git clone "$HUBBLE_GIT_URL" "$HUBBLE_SRC_PATH" \
194195
&& cd "$HUBBLE_SRC_PATH" \
195-
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx \
196-
&& cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
197-
&& sed -i "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" /hubble_build/hubblestack/__init__.py \
198-
&& sed -i "s/COMMIT_NOT_SET/`git describe`/g" /hubble_build/hubblestack/__init__.py
199-
RUN eval "$(pyenv init -)" \
200-
&& cd "$HUBBLE_SRC_PATH" \
201-
&& python setup.py egg_info \
202-
&& pip install --upgrade \
203-
-r hubblestack.egg-info/requires.txt \
204-
-r optional-requirements.txt \
205-
-r package-requirements.txt
196+
&& git checkout -B hubble-build && git reset --hard "$HUBBLE_CHECKOUT" && git clean -dfx
197+
198+
RUN cp -rf "$HUBBLE_SRC_PATH" /hubble_build \
199+
&& rm -rf /hubble_build/.git
200+
201+
RUN cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.orig \
202+
&& sed -i -e "s/BRANCH_NOT_SET/${HUBBLE_CHECKOUT}/g" \
203+
-e "s/COMMIT_NOT_SET/$(cd $HUBBLE_SRC_PATH; git describe --long --always --tags)/g" \
204+
/hubble_build/hubblestack/__init__.py \
205+
&& cp /hubble_build/hubblestack/__init__.py /hubble_build/hubblestack/__init__.fixed
206+
206207
RUN mkdir /data
207208
VOLUME /data
209+
208210
WORKDIR /hubble_build
211+
209212
COPY entrypoint.sh /entrypoint.sh
210213
ENTRYPOINT [ "/bin/bash", "/entrypoint.sh" ]

pkg/debian9/entrypoint.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ fi
1919
PS4=$'-------------=: '
2020
set -x -e
2121

22-
cp -rf "$HUBBLE_SRC_PATH"/* /hubble_build/
23-
2422
# possibly replace the version file
2523
if [ -f /data/hubble_buildinfo ]; then
2624
echo >> /hubble_build/hubblestack/__init__.py

0 commit comments

Comments
 (0)