Skip to content

Commit

Permalink
build/test: reduce make usage (#3910)
Browse files Browse the repository at this point in the history
Calling make directly does some extra work that is not needed.
For example it rebuilds all protobufs etc, we check in a separate
build step that those files are still up to date.

Also remove the nobuild option in the acceptance libs, it's always
true.
  • Loading branch information
lukedirtwalker authored Oct 21, 2020
1 parent c312887 commit c6d38f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
5 changes: 2 additions & 3 deletions acceptance/common/scion.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def topology(self, topo_file: str, *args: str):
pass

@LogExec(logger, 'running topology')
def run(self, nobuild=True):
def run(self):
""" Run the scion infrastructure. """
args = ['nobuild'] if nobuild else []
self.scion_sh('run', *args)
self.scion_sh('run', 'nobuild')

@abstractmethod
def execute(self, isd_as: ISD_AS, cmd: str, *args: str) -> str:
Expand Down
9 changes: 8 additions & 1 deletion acceptance/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ stop_infra() {
./scion.sh stop
}

build_binaries() {
rm bin/*
bazel build //:scion //:scion-ci
tar -kxf bazel-bin/scion.tar -C bin
tar -kxf bazel-bin/scion-ci.tar -C bin
}

build_docker_tester() {
make -C docker test
}
Expand All @@ -52,7 +59,7 @@ global_setup() {
run_command stop_infra ${out_dir:+$out_dir/global_setup_pre_clean.out}
find logs -mindepth 1 -maxdepth 1 -not -path '*/\.*' -exec rm -r {} +
print_green "[-->-------]" "Building local code"
run_command make ${out_dir:+$out_dir/global_setup_make.out}
run_command build_binaries ${out_dir:+$out_dir/global_setup_make.out}
print_green "[--->------]" "Building per-app docker images"
run_command build_docker_perapp ${out_dir:+$out_dir/global_setup_docker_perapp.out}
print_green "[---->-----]" "Building tester docker images"
Expand Down
9 changes: 8 additions & 1 deletion scion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ cmd_topology() {
fi
}

build_binaries() {
rm bin/*
bazel build //:scion //:scion-ci
tar -kxf bazel-bin/scion.tar -C bin
tar -kxf bazel-bin/scion-ci.tar -C bin
}

cmd_run() {
if [ "$1" != "nobuild" ]; then
echo "Compiling..."
make -s || exit 1
build_binaries || exit 1
if is_docker_be; then
echo "Build perapp images"
./tools/quiet make -C docker prod
Expand Down

0 comments on commit c6d38f2

Please sign in to comment.