Skip to content

Commit

Permalink
Merge pull request #108 from paketo-buildpacks/arm64
Browse files Browse the repository at this point in the history
Add ARM64 Support
  • Loading branch information
dmikusa authored Aug 26, 2024
2 parents 2c54de9 + 96fce86 commit d02ac59
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .github/pipeline-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ github:
username: ${{ secrets.JAVA_GITHUB_USERNAME }}
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}

helpers:
"bin/helper": "$GOMOD/cmd/helper"

codeowners:
- path: "*"
owner: "@paketo-buildpacks/app-monitoring-maintainers"
Expand Down
2 changes: 1 addition & 1 deletion .github/pipeline-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.39.0
1.40.0
21 changes: 5 additions & 16 deletions .github/workflows/pb-create-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,13 @@ jobs:
set -euo pipefail
go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest
- uses: buildpacks/github-actions/setup-tools@v5.6.0
- uses: buildpacks/github-actions/setup-tools@v5.7.2
with:
crane-version: 0.19.1
yj-version: 5.1.0
- name: Install pack
run: |
#!/usr/bin/env bash
# this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box
# TODO to revisit when the official one is out
set -euo pipefail
echo "Installing pack experimental"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack
chmod +x "${HOME}"/bin/pack
- uses: buildpacks/github-actions/setup-pack@v5.7.2
with:
pack-version: 0.34.2
- name: Enable pack Experimental
if: ${{ false }}
run: |
Expand Down Expand Up @@ -219,7 +208,7 @@ jobs:
DIGEST: ${{ steps.package.outputs.digest }}
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
- if: ${{ true }}
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.6.0
uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.7.2
with:
address: docker.io/paketobuildpacks/aternity@${{ steps.package.outputs.digest }}
id: paketo-buildpacks/aternity
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,9 @@ jobs:
set -euo pipefail
go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest
- name: Install pack
run: |
#!/usr/bin/env bash
# this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box
# TODO to revisit when the official one is out
set -euo pipefail
echo "Installing pack experimental"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack
chmod +x "${HOME}"/bin/pack
- uses: buildpacks/github-actions/setup-pack@v5.7.2
with:
pack-version: 0.34.2
- name: Enable pack Experimental
if: ${{ false }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-update-appinternals-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
set -euo pipefail
go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest
- uses: buildpacks/github-actions/setup-tools@v5.6.0
- uses: buildpacks/github-actions/setup-tools@v5.7.2
with:
crane-version: 0.19.1
yj-version: 5.1.0
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2022 the original author or authors.
# Copyright 2018-2020 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,8 @@
# limitations under the License.

bin/
linux/
dependencies/
package/
scratch/

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ The buildpack will do the following for Java applications:
* Contributes a Java agent to a layer and configures `$JAVA_TOOL_OPTIONS` to use it
* Transforms the contents of the binding secret to environment variables with the pattern `<KEY>=<VALUE>`

## Notes

While this buildpack is packaged to support ARM64 there are no upstream bindings for Aternity on ARM64. If you try to use this buildpack on ARM64 it will fail attempting to download ARM64 binaries that do not exist. Please contact the vendor if you'd like to see ARM64 support. The buildpack is positioned to support it as soon as it is available upstream.

## Bindings
The buildpack optionally accepts the following bindings:

### Type: `dependency-mapping`
|Key | Value | Description
|----------------------|---------|------------
|`<dependency-digest>` | `<uri>` | If needed, the buildpack will fetch the dependency with digest `<dependency-digest>` from `<uri>`
| Key | Value | Description |
| --------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| `<dependency-digest>` | `<uri>` | If needed, the buildpack will fetch the dependency with digest `<dependency-digest>` from `<uri>` |

## License

Expand Down
18 changes: 10 additions & 8 deletions buildpack.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2022 the original author or authors.
# Copyright 2018-2024 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@ api = "0.7"
uri = "https://github.com/paketo-buildpacks/aternity/blob/main/LICENSE"

[metadata]
include-files = ["LICENSE", "NOTICE", "README.md", "bin/build", "bin/detect", "bin/helper", "bin/main", "buildpack.toml"]
include-files = ["LICENSE", "NOTICE", "README.md", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/main", "linux/amd64/bin/helper", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/main", "linux/arm64/bin/helper", "buildpack.toml"]
pre-package = "scripts/build.sh"

[[metadata.dependencies]]
Expand All @@ -37,18 +37,20 @@ api = "0.7"
name = "Aternity AppInternals Java Agent"
purl = "pkg:generic/aternity-appinternals-java-agent@11.8.5?arch=amd64"
sha256 = "8242054c1828196a5605ac8225f2fdf3a947931c3e4db6e2e4b26df70bbaffe0"
stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"]
stacks = ["*"]
uri = "https://pcf-instrumentation-download.steelcentral.net/riverbed-appinternals-agent-11.8.5_BL527.zip"
version = "11.8.5"

[[metadata.dependencies.licenses]]
uri = "https://www.riverbed.com/document/legal/riverbed-end-user-license-agreement.pdf"

[[stacks]]
id = "io.buildpacks.stacks.bionic"
id = "*"

[[stacks]]
id = "io.paketo.stacks.tiny"
[[targets]]
arch = "amd64"
os = "linux"

[[stacks]]
id = "*"
[[targets]]
arch = "arm64"
os = "linux"
22 changes: 14 additions & 8 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/usr/bin/env bash

set -euo pipefail

GOOS="linux" go build -ldflags='-s -w' -o bin/helper github.com/paketo-buildpacks/aternity/v4/cmd/helper
GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/aternity/v4/cmd/main
GOMOD=$(head -1 go.mod | awk '{print $2}')
GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o "linux/amd64/bin/helper" "$GOMOD/cmd/helper"
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o "linux/arm64/bin/helper" "$GOMOD/cmd/helper"
GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main"
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main"

if [ "${STRIP:-false}" != "false" ]; then
strip bin/helper bin/main
strip linux/amd64/bin/helper linux/arm64/bin/helper
strip linux/amd64/bin/main linux/arm64/bin/main
fi

if [ "${COMPRESS:-false}" != "false" ]; then
upx -q -9 bin/helper bin/main
if [ "${COMPRESS:-none}" != "none" ]; then
$COMPRESS linux/amd64/bin/helper linux/arm64/bin/helper
$COMPRESS linux/amd64/bin/main linux/arm64/bin/main
fi

ln -fs main bin/build
ln -fs main bin/detect
ln -fs main linux/amd64/bin/build
ln -fs main linux/arm64/bin/build
ln -fs main linux/amd64/bin/detect
ln -fs main linux/arm64/bin/detect

0 comments on commit d02ac59

Please sign in to comment.