Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/test: reduce make usage #3910

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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