akshaychitneni commented on code in PR #2244: URL: https://github.com/apache/datafusion-ballista/pull/2244#discussion_r3760279725
########## dev/docker/chaos.Dockerfile: ########## @@ -0,0 +1,50 @@ +# syntax=docker/dockerfile:1 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# One image containing both chaos binaries, used by the Kubernetes backend in +# `chaos-testing`. The pod manifest selects the role via `command`. +# +# The binaries are compiled *inside* this build, so the image is always built +# for the container's architecture. A host `cargo build` would embed the host's +# binary (e.g. a macOS Mach-O on Apple Silicon), which fails in a Linux pod with +# "exec format error". BuildKit cache mounts keep the cargo registry and target +# dir across builds, so an incremental rebuild after a chaos-only change is fast. + +FROM rust:1-bookworm AS builder +RUN apt-get update \ + && apt-get install -y --no-install-recommends protobuf-compiler \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /src +COPY . . +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/src/target \ + cargo build -p ballista-chaos --bin chaos-scheduler --bin chaos-executor \ Review Comment: I am using the approach of building inside image instead of copying a host binary to make sure chaos harness with kind also works on local machine (macbook) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
