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 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 libsystemd-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add systemd-dev and debhelper here. It is also need a newer version of fluent-bit. I tried 3.1.9 and it works. Created #1819 for the fluent-bit update.

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to update fluent-bit, the current version in the repo 3.1.6 builds correctly in Ubuntu Oracular.

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
Loading