Skip to content

Commit fe3e12c

Browse files
committed
test
1 parent 26a7060 commit fe3e12c

2 files changed

Lines changed: 56 additions & 8 deletions

File tree

.github/workflows/build_publish_lambda_layer.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
GITHUB_RUBY_TOKEN: ${{ secrets.PACKAGE_GITHUB_TOKEN }}
5252
SOLARWINDS_SOURCE: ${{ github.event.inputs.solarwinds-source }}
5353
PUBLISH_DEST: ${{ github.event.inputs.publish-dest }}
54-
ALLOWED_RUBY_VERSION: ${{ github.event.inputs.ruby-version }}
54+
ALLOWED_RUBY_VERSION: '3.4'
5555

5656
- name: Show directory contents
5757
run: |
@@ -64,18 +64,59 @@ jobs:
6464
name: ruby-layer.zip
6565
path: lambda/build/ruby-layer.zip
6666

67+
build_bigdecimal_arm64:
68+
needs:
69+
- build_layer
70+
runs-on: fromJSON('{"group":"apm-arm-runner"}')
71+
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Build ruby lambda layer on arm64 machine
76+
run: |
77+
uname -a
78+
./build.sh
79+
shell: bash
80+
working-directory: lambda/
81+
env:
82+
GITHUB_RUBY_TOKEN: ${{ secrets.PACKAGE_GITHUB_TOKEN }}
83+
SOLARWINDS_SOURCE: ${{ github.event.inputs.solarwinds-source }}
84+
PUBLISH_DEST: ${{ github.event.inputs.publish-dest }}
85+
ALLOWED_RUBY_VERSION: '3.4'
86+
BIGDECIMAL: true
87+
88+
- name: extract layer zip from artifacts
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: ruby-layer.zip
92+
path: lambda/build
93+
94+
- name: Combine to single layer
95+
run: |
96+
unzip ruby-layer.zip
97+
mkdir -p bigdecimal
98+
unzip -d bigdecimal/ bigdecimal-aarch64.zip
99+
mkdir -p ruby/gems/3.4.0/extensions/aarch64-linux/
100+
mv bigdecimal/ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0/bigdecimal-*/ ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0/
101+
zip -qr ruby-layer.zip ruby/ solarwinds-apm/ otel_wrapper.rb
102+
working-directory: lambda/build
103+
104+
- name: Upload to artifact
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: ruby-layer.zip
108+
path: lambda/build/ruby-layer.zip
109+
67110
# extract the built layer from artifacts, then scan it with reverselab
68111
reverselab_scan_layer:
112+
if: false # Disable this job
69113
needs:
70-
- build_layer
114+
- build_bigdecimal_arm64
71115
runs-on: ubuntu-latest
72116

73117
outputs:
74118
apm_ruby_version: ${{ steps.version.outputs.SOLARWINDS_APM_VERSION }}
75119

76-
strategy:
77-
fail-fast: false
78-
79120
steps:
80121
- uses: actions/checkout@v4
81122

@@ -122,6 +163,7 @@ jobs:
122163
123164
# extract the built layer from artifacts, then publish it based on region
124165
publish_layer:
166+
if: false # Disable this job
125167
needs:
126168
- reverselab_scan_layer
127169
runs-on: ubuntu-latest

lambda/build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ for ruby_version in $ALLOWED_RUBY_VERSION; do
2727
done
2828

2929
cd build/
30-
mkdir solarwinds-apm && mkdir ruby && mkdir ruby/gems
30+
mkdir -p ruby/gems
3131

3232
for ruby_version in $ALLOWED_RUBY_VERSION; do
3333
unzip -q gems-$ruby_version.0.zip -d ruby/gems/
3434
done
3535

36-
cp ../otel/layer/otel_wrapper.rb . && cp ../otel/layer/wrapper solarwinds-apm/
37-
zip -qr ruby-layer.zip ruby/ solarwinds-apm/ otel_wrapper.rb
36+
if [ $BIGDECIMAL = 'true' ]; then
37+
zip -qr bigdecimal-aarch64.zip ruby/gems/3.4.0/extensions/aarch64-linux/3.4.0/bigdecimal-*/
38+
rm -rf ruby/
39+
else
40+
mkdir solarwinds-apm
41+
cp ../otel/layer/otel_wrapper.rb . && cp ../otel/layer/wrapper solarwinds-apm/
42+
zip -qr ruby-layer.zip ruby/ solarwinds-apm/ otel_wrapper.rb
43+
fi

0 commit comments

Comments
 (0)