Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Ubuntu 24.10 Oracular support #1818

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
104 changes: 103 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,107 @@ FROM scratch AS noble
COPY --from=noble-build /tmp/google-cloud-ops-agent.tgz /google-cloud-ops-agent-ubuntu-noble.tgz
COPY --from=noble-build /google-cloud-ops-agent*.deb /

# ======================================
# Build Ops Agent for ubuntu-oracular
# ======================================

FROM ubuntu:oracular AS oracular-build-base
ARG OPENJDK_MAJOR_VERSION

RUN set -x; apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \
autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \
build-essential cmake bison flex file systemd-dev debhelper libsystemd-dev \
devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip

SHELL ["/bin/bash", "-c"]

# Install golang
ARG TARGETARCH
ARG GO_VERSION
ADD https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz /tmp/go${GO_VERSION}.tar.gz
RUN set -xe; \
tar -xf /tmp/go${GO_VERSION}.tar.gz -C /usr/local
ENV PATH="${PATH}:/usr/local/go/bin"


FROM oracular-build-base AS oracular-build-otel
WORKDIR /work
# Download golang deps
COPY ./submodules/opentelemetry-operations-collector/go.mod ./submodules/opentelemetry-operations-collector/go.sum submodules/opentelemetry-operations-collector/
RUN cd submodules/opentelemetry-operations-collector && go mod download

COPY ./submodules/opentelemetry-java-contrib submodules/opentelemetry-java-contrib
# Install gradle. The first invocation of gradlew does this
RUN cd submodules/opentelemetry-java-contrib && ./gradlew --no-daemon -Djdk.lang.Process.launchMechanism=vfork tasks
COPY ./submodules/opentelemetry-operations-collector submodules/opentelemetry-operations-collector
COPY ./builds/otel.sh .
RUN \
unset OTEL_TRACES_EXPORTER && \
unset OTEL_EXPORTER_OTLP_TRACES_ENDPOINT && \
unset OTEL_EXPORTER_OTLP_TRACES_PROTOCOL && \
./otel.sh /work/cache/

FROM oracular-build-base AS oracular-build-fluent-bit
WORKDIR /work
COPY ./submodules/fluent-bit submodules/fluent-bit
COPY ./builds/fluent_bit.sh .
RUN ./fluent_bit.sh /work/cache/


FROM oracular-build-base AS oracular-build-systemd
WORKDIR /work
COPY ./systemd systemd
COPY ./builds/systemd.sh .
RUN ./systemd.sh /work/cache/


FROM oracular-build-base AS oracular-build-golang-base
WORKDIR /work
COPY go.mod go.sum ./
# Fetch dependencies
RUN go mod download
COPY confgenerator confgenerator
COPY apps apps
COPY internal internal


FROM oracular-build-golang-base AS oracular-build-diagnostics
WORKDIR /work
COPY cmd/google_cloud_ops_agent_diagnostics cmd/google_cloud_ops_agent_diagnostics
COPY ./builds/ops_agent_diagnostics.sh .
RUN ./ops_agent_diagnostics.sh /work/cache/


FROM oracular-build-golang-base AS oracular-build-wrapper
WORKDIR /work
COPY cmd/agent_wrapper cmd/agent_wrapper
COPY ./builds/agent_wrapper.sh .
RUN ./agent_wrapper.sh /work/cache/


FROM oracular-build-golang-base AS oracular-build
WORKDIR /work
COPY . /work

# Run the build script once to build the ops agent engine to a cache
RUN mkdir -p /tmp/cache_run/golang && cp -r . /tmp/cache_run/golang
WORKDIR /tmp/cache_run/golang
RUN ./pkg/deb/build.sh || true &> /dev/null
WORKDIR /work

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY --from=oracular-build-otel /work/cache /work/cache
COPY --from=oracular-build-fluent-bit /work/cache /work/cache
COPY --from=oracular-build-systemd /work/cache /work/cache
COPY --from=oracular-build-diagnostics /work/cache /work/cache
COPY --from=oracular-build-wrapper /work/cache /work/cache
RUN ./pkg/deb/build.sh

FROM scratch AS oracular
COPY --from=oracular-build /tmp/google-cloud-ops-agent.tgz /google-cloud-ops-agent-ubuntu-oracular.tgz
COPY --from=oracular-build /google-cloud-ops-agent*.deb /

FROM scratch
COPY --from=centos8 /* /
COPY --from=rockylinux9 /* /
Expand All @@ -1023,4 +1124,5 @@ COPY --from=sles12 /* /
COPY --from=sles15 /* /
COPY --from=focal /* /
COPY --from=jammy /* /
COPY --from=noble /* /
COPY --from=noble /* /
COPY --from=oracular /* /
12 changes: 12 additions & 0 deletions dockerfiles/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ RUN ln -fs /usr/lib/systemd /lib/systemd` + installJava + installCMake,
tar_distro_name: "ubuntu-noble",
package_extension: "deb",
},
{
from_image: "ubuntu:oracular",
target_name: "oracular",
install_packages: `RUN set -x; apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git systemd \
autoconf libtool libcurl4-openssl-dev libltdl-dev libssl-dev libyajl-dev \
build-essential cmake bison flex file systemd-dev debhelper libsystemd-dev \
devscripts cdbs pkg-config openjdk-${OPENJDK_MAJOR_VERSION}-jdk zip`,
package_build: "RUN ./pkg/deb/build.sh",
tar_distro_name: "ubuntu-oracular",
package_extension: "deb",
},
}

func getDockerfileFooter() string {
Expand Down
2 changes: 1 addition & 1 deletion kokoro/config/build/presubmit/bullseye_aarch64.gcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../common.gcl' as common
config build = common.build {
params {
environment {
DISTRO = 'bullseye'
DISTRO = 'oracular'
PKGFORMAT = 'deb'
}
}
Expand Down
2 changes: 1 addition & 1 deletion kokoro/config/build/presubmit/bullseye_x86_64.gcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../common.gcl' as common
config build = common.build {
params {
environment {
DISTRO = 'bullseye'
DISTRO = 'oracular'
PKGFORMAT = 'deb'
}
}
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that bullseye-aarch64 went EOL and these tests didn't actually run (this might be why we're not seeing the postgres failures on this PR). We should apply these temporary changes to e.g. bookworm instead of bullseye (and we should also get rid of all of the bullseye-aarch64 stuff in a separate PR later).

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'common.gcl' as common
config build = common.ops_agent_test {
params {
environment {
TARGET = 'bullseye'
TARGET = 'oracular'
ARCH = 'aarch64'
}
}
Expand Down
2 changes: 1 addition & 1 deletion kokoro/config/test/ops_agent/presubmit/bullseye_x86_64.gcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'common.gcl' as common
config build = common.ops_agent_test {
params {
environment {
TARGET = 'bullseye'
TARGET = 'oracular'
ARCH = 'x86_64'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'common.gcl' as common
config build = common.third_party_apps_test {
params {
environment {
TARGET = 'bullseye'
TARGET = 'oracular'
ARCH = 'aarch64'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'common.gcl' as common
config build = common.third_party_apps_test {
params {
environment {
TARGET = 'bullseye'
TARGET = 'oracular'
ARCH = 'x86_64'
}
}
Expand Down
16 changes: 16 additions & 0 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ targets:
- ubuntu-os-cloud:ubuntu-2004-lts-arm64
exhaustive:
- ubuntu-os-cloud:ubuntu-minimal-2004-lts-arm64
oracular:
package_extension:
deb
architectures:
x86_64:
test_distros:
representative:
- ubuntu-os-cloud:ubuntu-2410-amd64
exhaustive:
- ubuntu-os-cloud:ubuntu-minimal-2410-amd64
aarch64:
test_distros:
representative:
- ubuntu-os-cloud:ubuntu-2410-arm64
exhaustive:
- ubuntu-os-cloud:ubuntu-minimal-2410-arm64
jammy:
package_extension:
deb
Expand Down
Loading