Skip to content

Add --force-rm flag #9727

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions frameworks/Rust/hyper/hyper.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
FROM rust:1.85 AS hyper

WORKDIR /src
COPY . .
RUN RUSTFLAGS="-C target-cpu=native" cargo install --path . --locked
ENV RUSTFLAGS="-C target-cpu=native"

# Cache dependency builds (requires passing --force-rm False to tfb command)
COPY Cargo.toml Cargo.lock /src/
RUN mkdir src \
&& echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs \
&& cargo build --release \
&& rm -rfv src/ target/release/hyper-techempower* target/release/deps/hyper_techempower*

COPY . /src/
RUN cargo install --path . --locked
EXPOSE 8080
CMD ["hyper-techempower"]
HEALTHCHECK CMD curl --fail http://localhost:8080/ping || exit 1
4 changes: 4 additions & 0 deletions toolset/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def main(argv=None):
nargs='*',
default=None,
help='Extra docker arguments to be passed to the test container')
parser.add_argument(
'--force-rm',
default=True,
help='Remove intermediate docker containers after running.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if we're going to do this in the aim of improving ergonomics for contributors who need to quickly iterate implementations again and again and want those layers to persist between attempts, then this should be False by default, and we need to update our CI scripts to forcibly set to True (and our continuous scripts).


# Network options
parser.add_argument(
Expand Down
1 change: 1 addition & 0 deletions toolset/utils/benchmark_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, args):
self.cpuset_cpus = args.cpuset_cpus
self.test_container_memory = args.test_container_memory
self.extra_docker_runtime_args = args.extra_docker_runtime_args
self.force_rm_intermediate_docker_layers = args.force_rm

if self.network_mode is None:
self.network = 'tfb'
Expand Down
2 changes: 1 addition & 1 deletion toolset/utils/docker_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __build(self, base_url, path, build_log_file, log_prefix, dockerfile,
path=path,
dockerfile=dockerfile,
tag=tag,
forcerm=True,
forcerm=self.benchmarker.config.force_rm_intermediate_docker_layers,
timeout=3600,
pull=True,
buildargs=buildargs,
Expand Down
Loading