-
Notifications
You must be signed in to change notification settings - Fork 443
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
dependencies image as artifact #1333
Changes from 1 commit
21d35f4
9cc771c
696781a
fc613db
49f83ce
8b98217
554cb81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'OpenTelemetry-cpp dependencies image' | ||
on: | ||
schedule: | ||
- cron: "0 3 * * 6" | ||
|
||
jobs: | ||
docker_image: | ||
name: Docker Image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 300 | ||
steps: | ||
- | ||
name: checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Build Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: ci/ | ||
file: ./docker/Dockerfile | ||
build-args: BASE_IMAGE=ubuntu:latest | ||
platforms: linux/amd64 | ||
# platforms: linux/amd64,linux/arm64 | ||
push: false | ||
tags: otel-cpp | ||
load: true | ||
cache-from: type=gha | ||
# cache-to: type=gha,mode=max | ||
- | ||
name: Save Image | ||
run: | | ||
docker images | ||
docker save -o /opt/otel-cpp-deps.tar otel-cpp | ||
lalitb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- | ||
name: Upload Image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: otel-cpp-deps | ||
path: /opt/otel-cpp-deps.tar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have the estimated size of these tar-ed docker images, as GitHub cache is limited to 10GB, and we are already using some of it for Bazel builds? We can later also see if these artifacts can be stored separately in azure blob - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't find the size limit in the documentation. I think the same rule as logs should apply here. I'm going to reduce the retention period for the artifact to two weeks. The size of the artifact is about 1GB. We can reduce this size (probably to 200MB) by storing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok interesting. I also don't see it documented anywhere. I was thinking it to be part of Cache size limit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the image had everything for building the library git, cmake,... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ARG BASE_IMAGE=ubuntu:latest | ||
ARG CORES=${nproc} | ||
|
||
FROM ${BASE_IMAGE} as base | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y build-essential autoconf \ | ||
lalitb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libtool pkg-config cmake git libssl-dev curl \ | ||
libcurl4-openssl-dev libgtest-dev libgmock-dev libbenchmark-dev | ||
|
||
WORKDIR /work | ||
|
||
RUN apt-get update && apt-get install -y autoconf libtool pkg-config cmake git libssl-dev | ||
RUN if echo ${BASE_IMAGE} | grep -q "ubuntu"; then apt-get install -y build-essential; fi | ||
|
||
FROM base as grpc | ||
# install grpc and abseil | ||
esigo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ARG GRPC_VERSION=1.43.2 | ||
|
||
ADD setup_grpc.sh . | ||
RUN ./setup_grpc.sh -v GRPC_VERSION | ||
|
||
FROM base as thrift | ||
RUN apt-get install -y --no-install-recommends wget | ||
|
||
# install thrift | ||
ARG THRIFT_VERSION=0.14.1 | ||
ADD setup_thrift.sh . | ||
RUN ./setup_thrift.sh | ||
|
||
lalitb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FROM base as final | ||
ARG CORES | ||
COPY --from=grpc /usr /usr | ||
COPY --from=thrift /usr /usr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this effective if
cache-to
is not used ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no it's not, I cleaned it.