forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antithesis] Enable workload instrumentation (ava-labs#3059)
Signed-off-by: marun <[email protected]> Co-authored-by: Stephen Buttolph <[email protected]>
- Loading branch information
1 parent
ae4f884
commit 8d18b61
Showing
13 changed files
with
282 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/antithesis/avalanchego/Dockerfile.builder-instrumented
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# The version is supplied as a build argument rather than hard-coded | ||
# to minimize the cost of version changes. | ||
ARG GO_VERSION | ||
|
||
# Antithesis: Getting the Antithesis golang instrumentation library | ||
FROM docker.io/antithesishq/go-instrumentor AS instrumentor | ||
|
||
# ============= Instrumentation Stage ================ | ||
FROM golang:$GO_VERSION-bullseye | ||
|
||
WORKDIR /build | ||
# Copy and download avalanche dependencies using go mod | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
# Copy the code into the container | ||
COPY . . | ||
|
||
# Ensure pre-existing builds are not available for inclusion in the final image | ||
RUN [ -d ./build ] && rm -rf ./build/* || true | ||
|
||
# Keep the commit hash to easily verify the exact version that is running | ||
RUN git rev-parse HEAD > ./commit_hash.txt | ||
|
||
# Copy the instrumentor and supporting files to their correct locations | ||
COPY --from=instrumentor /opt/antithesis /opt/antithesis | ||
COPY --from=instrumentor /opt/antithesis/lib /lib | ||
|
||
# Create the destination output directory for the instrumented code | ||
RUN mkdir -p /avalanchego_instrumented | ||
|
||
# Park the .git file in a safe location | ||
RUN mkdir -p /opt/tmp/ | ||
RUN cp -r .git /opt/tmp/ | ||
|
||
# Instrument avalanchego | ||
RUN /opt/antithesis/bin/goinstrumentor \ | ||
-stderrthreshold=INFO \ | ||
-antithesis /opt/antithesis/instrumentation \ | ||
. \ | ||
/avalanchego_instrumented | ||
|
||
WORKDIR /avalanchego_instrumented/customer | ||
RUN go mod download | ||
RUN ln -s /opt/tmp/.git .git |
17 changes: 17 additions & 0 deletions
17
tests/antithesis/avalanchego/Dockerfile.builder-uninstrumented
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# The version is supplied as a build argument rather than hard-coded | ||
# to minimize the cost of version changes. | ||
ARG GO_VERSION | ||
|
||
FROM golang:$GO_VERSION-bullseye | ||
|
||
WORKDIR /build | ||
# Copy and download avalanche dependencies using go mod | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
# Copy the code into the container | ||
COPY . . | ||
|
||
# Ensure pre-existing builds are not available for inclusion in the final image | ||
RUN [ -d ./build ] && rm -rf ./build/* || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.