Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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.')

# 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