-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add workflow to manually build the mini agent for testing #261
Open
thedavl
wants to merge
6
commits into
main
Choose a base branch
from
david.lee/workflow-to-build-serverless-agent-testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+68
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cdf0ba9
Create build-serverless-agent.yml
thedavl be44fd3
Update build-serverless-agent.yml
thedavl d7a1918
Update build-serverless-agent.yml
thedavl a3b7135
Update build-serverless-agent.yml
thedavl 5d74289
Merge branch 'main' into david.lee/workflow-to-build-serverless-agent…
thedavl 6f8c206
Merge branch 'main' into david.lee/workflow-to-build-serverless-agent…
morrisonlevi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Build the Serverless Agent | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: The branch to build the serverless trace mini agent off of. Defaults to main. | ||
default: main | ||
|
||
jobs: | ||
build-linux-musl: | ||
name: Build Linux Musl | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Install musl dependencies | ||
run: rustup target add x86_64-unknown-linux-musl && sudo apt-get install musl-tools | ||
- name: Build project | ||
run: cargo build --release -p datadog-serverless-trace-mini-agent --target x86_64-unknown-linux-musl | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: datadog-serverless-agent-linux-amd64 | ||
path: target/x86_64-unknown-linux-musl/release/datadog-serverless-trace-mini-agent | ||
build-windows: | ||
name: Build Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Build project | ||
run: cargo build --release -p datadog-serverless-trace-mini-agent | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: datadog-serverless-agent-windows-amd64 | ||
path: target/release/datadog-serverless-trace-mini-agent.exe | ||
upload-upx-compressed-binaries: | ||
name: Upload UPX compressed binaries | ||
needs: [build-windows, build-linux-musl] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Download artifacts from build step | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: target/release/binaries | ||
- name: UPX compress binaries | ||
run: | | ||
for file in target/release/binaries/*/* | ||
do | ||
chmod +x "$file" | ||
upx "$file" --lzma | ||
done | ||
- name: Zip binaries | ||
run: zip -r datadog-serverless-agent.zip * | ||
working-directory: target/release/binaries | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compressed-binaries | ||
path: target/release/binaries/datadog-serverless-agent.zip | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Using UPX for processes that are started repetitively can add a delay to the FaaS platform warmup. Also UPX packed executable can trigger AV and malware analysis pipelines.
Prefer to ship your binary stripped, and compressed by the archiver, like you do in the next step than artificially reduce the binary size which will run additional code to unpack from memory. To reduce your Rust binary size, I advise you to have a look to this repo - https://github.com/johnthagen/min-sized-rust