Skip to content

Commit

Permalink
Merge pull request #398 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 b49d29f + e520bdc commit 7e3cd29
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 41 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/java-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/[email protected]
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/google-stackdriver@${{ steps.package.outputs.digest }}
id: paketo-buildpacks/google-stackdriver
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/[email protected]
with:
pack-version: 0.34.2
- name: Enable pack Experimental
if: ${{ false }}
run: |
Expand Down
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
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.

bin/
linux/
dependencies/
package/
scratch/

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ The buildpack will do the following for NodeJS applications:
* If main module does not already require `@google-cloud/profiler` module, prepends the main module with `require('@google-cloud/profiler').start();`
* Sets `$GOOGLE_APPLICATION_CREDENTIALS` to the path of the `ApplicationCredentials` secret

## 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.

## Configuration

| Environment Variable | Description |
Expand Down
10 changes: 9 additions & 1 deletion buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ api = "0.7"
uri = "https://github.com/paketo-buildpacks/google-stackdriver/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.configurations]]
Expand Down Expand Up @@ -79,3 +79,11 @@ api = "0.7"

[[stacks]]
id = "*"

[[targets]]
arch = "amd64"
os = "linux"

[[targets]]
arch = "arm64"
os = "linux"
20 changes: 13 additions & 7 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/google-stackdriver/v5/cmd/helper
GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/google-stackdriver/v5/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:-none}" != "none" ]; then
$COMPRESS bin/helper bin/main
$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 7e3cd29

Please sign in to comment.