Skip to content

Commit

Permalink
Update pipeline to multi platforms build and Attestations (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
cch0 authored May 3, 2024
1 parent de4f545 commit e671031
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 10 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defaults:
run:
shell: bash


jobs:
build_image:
name: ${{ matrix.profile.platform }}-${{ matrix.profile.os }}
Expand Down Expand Up @@ -86,6 +87,12 @@ jobs:
ls -l artifacts
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: 'artifacts/demo-native-${{ matrix.profile.platform }}-${{ matrix.profile.os }}'


- name: Upload native image as a Github artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -103,7 +110,7 @@ jobs:

permissions: write-all

if: ${{ github.ref != 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' }}

steps:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The idea is to provide configuration examples to illustrate various aspects of c

## Prerequisistes

The Java release version is set to **17** in the `pom.xml` file but in order to use GraalVM, we require `22-graalce` or above.
The Java release version is set to **22** for `maven-compiler-plugin` in the `pom.xml` file.

GraalVM can be installed via sdkman

Expand Down
2 changes: 1 addition & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ From the command line,
mvn -Pnative clean native:compile
```

The **native** Maven profile is added to allow us the opportunity to build the binary when profile is active.
The **native** Maven profile is added to give us the opportunity to build the binary when this profile is active.

The executable is located at `target/demo-native`. The name is configured by `imageName` property for the **native-maven-plugin** in the `pom.xml` file.

Expand Down
14 changes: 9 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<vertx-maven-plugin.version>1.0.28</vertx-maven-plugin.version>
<graalvm-maven-plugin.version>0.10.1</graalvm-maven-plugin.version>
<logback-classic.version>1.5.3</logback-classic.version>
<base.image.version>amazoncorretto:17-alpine3.18-jdk</base.image.version>
<base.image.version>amazoncorretto:22.0.1-al2023-headless</base.image.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<main.class>com.demo.Main</main.class>
</properties>
Expand Down Expand Up @@ -79,7 +79,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>17</release>
<release>21</release>
</configuration>
</plugin>

Expand Down Expand Up @@ -108,13 +108,17 @@
<configuration>
<from>
<image>${base.image.version}</image>
<!-- uncomment this section to specify platforms -->
<!-- <platforms>
<platforms>
<platform>
<architecture>arm64</architecture>
<os>linux</os>
</platform>
</platforms> -->
<!-- uncomment this section to add additional platform -->
<!-- <platform>-->
<!-- <architecture>amd64</architecture>-->
<!-- <os>linux</os>-->
<!-- </platform>-->
</platforms>
</from>
<to>
<image>${project.artifactId}</image>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Args = --no-fallback \
-H:+UnlockExperimentalVMOptions \
-H:Log=registerResource:3 \
--trace-object-instantiation=ch.qos.logback.classic.Logger \
--initialize-at-run-time=io.netty.bootstrap.Bootstrap \
--initialize-at-run-time=io.netty.bootstrap.ChannelInitializerExtensions \
--initialize-at-run-time=io.netty.bootstrap.ServerBootstrap \
Expand Down Expand Up @@ -77,5 +76,61 @@ Args = --no-fallback \
--initialize-at-run-time=io.netty.util.concurrent.DefaultPromise \
--initialize-at-run-time=io.netty.util.concurrent.FastThreadLocalThread \
--initialize-at-run-time=io.netty.util.internal.SystemPropertyUtil \
--initialize-at-run-time=io.netty.handler.codec.http.HttpResponseDecoder
--initialize-at-run-time=io.netty.handler.codec.http.HttpResponseDecoder \
--initialize-at-run-time=io.netty.util.internal.PlatformDependent \
--initialize-at-run-time=io.netty.util.internal.PlatformDependent0 \
--initialize-at-run-time=io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder \
--initialize-at-run-time=io.netty.handler.ssl.JdkSslServerContext \
--initialize-at-run-time=io.netty.channel.DefaultChannelId \
--initialize-at-run-time=io.netty.buffer.AbstractByteBufAllocator \
--initialize-at-run-time=io.netty.handler.ssl.BouncyCastleAlpnSslUtils \
--initialize-at-run-time=io.netty.util.internal.InternalThreadLocalMap \
--initialize-at-run-time=io.netty.buffer.Unpooled \
--initialize-at-run-time=io.netty.util.internal.MacAddressUtil \
--initialize-at-run-time=io.netty.buffer.AdvancedLeakAwareByteBuf \
--initialize-at-run-time=io.netty.util.internal.StringUtil \
--initialize-at-run-time=io.netty.handler.ssl.ReferenceCountedOpenSslEngine \
--initialize-at-run-time=io.netty.util.internal.CleanerJava9 \
--initialize-at-run-time=io.netty.util.internal.CleanerJava6 \
--initialize-at-run-time=io.netty.buffer.ByteBufUtil$HexUtil \
--initialize-at-run-time=io.netty.buffer.EmptyByteBuf \
--initialize-at-run-time=io.netty.buffer.PoolArena \
--initialize-at-run-time=io.netty.buffer.UnsafeByteBufUtil \
--initialize-at-run-time=io.netty.resolver.dns.DirContextUtils \
--initialize-at-run-time=io.netty.resolver.DefaultHostsFileEntriesResolver \
--initialize-at-run-time=io.netty.util.AsciiString \
--initialize-at-run-time=io.netty.channel.MultithreadEventLoopGroup \
--initialize-at-run-time=io.netty.util.AttributeKey \
--initialize-at-run-time=io.netty.util.internal.ThreadExecutorMap \
--initialize-at-run-time=io.netty.resolver.dns.DnsServerAddressStreamProviders \
--initialize-at-run-time=io.netty.util.internal.PlatformDependent$Mpsc \
--initialize-at-run-time=io.netty.channel.ChannelOutboundBuffer$Entry \
--initialize-at-run-time=io.netty.channel.ChannelOption \
--initialize-at-run-time=io.netty.util.Recycler \
--initialize-at-run-time=io.netty.handler.codec.http.HttpMethod \
--initialize-at-run-time=io.netty.handler.codec.http.HttpHeaderNames \
--initialize-at-run-time=io.netty.handler.ssl.OpenSsl \
--initialize-at-run-time=io.netty.handler.codec.http.HttpHeaderValues \
--initialize-at-run-time=io.netty.handler.codec.http2.Http2Headers$PseudoHeaderName \
--initialize-at-run-time=io.netty.handler.codec.CodecOutputList \
--initialize-at-run-time=io.netty.channel.AbstractChannelHandlerContext$WriteTask \
--initialize-at-run-time=io.netty.buffer.PoolThreadCache$MemoryRegionCache \
--initialize-at-run-time=io.netty.handler.ssl.SslUtils \
--initialize-at-run-time=io.netty.handler.ssl.JdkSslContext \
--initialize-at-run-time=io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator \
--initialize-at-run-time=io.netty.handler.ssl.Conscrypt \
--initialize-at-run-time=io.netty.handler.ssl.PemReader \
--initialize-at-run-time=io.netty.handler.ssl.BouncyCastlePemReader \
--initialize-at-run-time=io.netty.handler.ssl.JdkAlpnSslUtils \
--initialize-at-run-time=io.netty.handler.ssl.JettyAlpnSslEngine \
--initialize-at-run-time=io.netty.util.internal.RecyclableArrayList \
--initialize-at-run-time=io.netty.handler.codec.http.HttpContentDecoder \
--initialize-at-run-time=io.netty.handler.codec.http2.WeightedFairQueueByteDistributor \
--initialize-at-run-time=io.netty.handler.codec.compression.Brotli \
--initialize-at-run-time=io.netty.handler.codec.compression.ZlibCodecFactory \
--initialize-at-run-time=io.netty.handler.codec.compression.Zstd


# --trace-class-initialization=ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.util.Loader,io.netty.buffer.PoolThreadCache,ch.qos.logback.core.model.processor.ChainedModelFilter$1,io.netty.buffer.AbstractByteBuf,io.netty.buffer.AbstractUnpooledSlicedByteBuf,ch.qos.logback.core.subst.Token,ch.qos.logback.core.subst.NodeToStringTransformer$1,io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf,io.netty.buffer.UnpooledSlicedByteBuf,ch.qos.logback.classic.spi.CallerData,ch.qos.logback.core.model.processor.ImplicitModelHandler$1,ch.qos.logback.classic.Level,io.netty.buffer.UnpooledHeapByteBuf,org.slf4j.LoggerFactory,io.netty.buffer.AbstractReferenceCountedByteBuf,ch.qos.logback.classic.Logger,ch.qos.logback.core.pattern.parser.Parser,ch.qos.logback.core.util.Duration,io.netty.buffer.UnpooledDirectByteBuf,io.netty.util.NetUtil,ch.qos.logback.core.subst.Parser$1,io.netty.buffer.ByteBufUtil,io.netty.util.ResourceLeakDetector,io.netty.util \
# --trace-class-initialization=ch.qos.logback.classic.model.processor.LogbackClassicDefaultNestedComponentRules \
# --trace-class-initialization=ch.qos.logback.core.model.processor.DefaultProcessor$1

0 comments on commit e671031

Please sign in to comment.