Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

set -xe

DIR="$(dirname "$(readlink -f "$0")")"

pushd "${DIR}"
function cleanup() {
popd
}
trap cleanup EXIT

BUILD_IMG="${APP_REGISTRY:-quay.io}/${APP_NAMESPACE:-cryostat}/${APP_NAME:-cryostat-agent-init}"
BUILD_TAG="${APP_VERSION:-$(mvn -f "${DIR}/pom.xml" help:evaluate -B -q -DforceStdout -Dexpression=project.version)}"

"${DIR}/mvnw" -B -U -Psnapshots clean install

podman manifest create "${BUILD_IMG}:${BUILD_TAG}"

for arch in ${ARCHS:-amd64 arm64}; do
echo "Building for ${arch} ..."
podman build --pull=missing --platform="linux/${arch}" -t "${BUILD_IMG}:linux-${arch}" -f "${DIR}/src/main/container/Dockerfile" "${DIR}"
podman manifest add "${BUILD_IMG}:${BUILD_TAG}" containers-storage:"${BUILD_IMG}:linux-${arch}"
done

for tag in ${TAGS}; do
podman tag "${BUILD_IMG}:${BUILD_TAG}" "${BUILD_IMG}:${tag}"
done

if [ "${PUSH_MANIFEST}" = "true" ]; then
podman manifest push "${BUILD_IMG}:${BUILD_TAG}" "docker://${BUILD_IMG}:${BUILD_TAG}"
for tag in ${TAGS}; do
podman manifest push "${BUILD_IMG}:${tag}" "docker://${BUILD_IMG}:${tag}"
done
fi

echo "Image: ${BUILD_IMG}:${BUILD_TAG}"
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<org.apache.httpcomponents.httpclient.version>4.5.14</org.apache.httpcomponents.httpclient.version>
<org.apache.httpcomponents.httpmime.version>${org.apache.httpcomponents.httpclient.version}</org.apache.httpcomponents.httpmime.version>
<com.fasterxml.jackson.version>2.20.0</com.fasterxml.jackson.version>
<io.smallrye.config.version>3.10.2</io.smallrye.config.version>
<io.smallrye.config.version>3.10.2</io.smallrye.config.version><!-- latest version which supports JDK 11 -->
<org.slf4j.version>2.0.17</org.slf4j.version>
<org.projectnessie.cel.bom.version>0.5.2</org.projectnessie.cel.bom.version>
<com.google.protobuf-java.version>4.31.1</com.google.protobuf-java.version>
Expand Down Expand Up @@ -221,16 +221,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config</artifactId>
<version>${io.smallrye.config.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.redhat.insights</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/cryostat/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
import dagger.Component;
import io.smallrye.config.SmallRyeConfig;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.microprofile.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import picocli.CommandLine;
Expand Down Expand Up @@ -372,7 +372,7 @@ private static void setupInsightsIfEnabled(
@Singleton
@Component(modules = {MainModule.class})
interface Client {
Config config();
SmallRyeConfig config();

@Named(ConfigModule.CRYOSTAT_AGENT_FLEET_SAMPLING_RATIO)
double fleetSamplingRatio();
Expand Down
Loading
Loading