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

Create a dedicated docker image for ArcticDB development #2086

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
43 changes: 0 additions & 43 deletions .github/actions/setup_deps/action.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/analysis_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
run_all_benchmarks:
type: boolean
default: false
dev_image_tag:
description: Tag of the ArcticCB development image to use for benchmark and code coverage flows
type: string
default: latest

schedule: # Schedule the job to run at 12 a.m. daily
- cron: '0 0 * * *'
Expand Down Expand Up @@ -45,6 +49,7 @@ jobs:
commit: ${{ matrix.commits }}
run_all_benchmarks: ${{ inputs.run_all_benchmarks || false }}
run_on_pr_head: ${{ github.event_name == 'pull_request_target' }}
dev_image_tag: ${{ inputs.dev_image_tag }}

publish_benchmark_results_to_gh_pages:
name: Publish benchmark results to gh-pages
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/benchmark_commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
run_all_benchmarks: {required: true, type: boolean, description: Run all benchmarks or just the one for the given commit}
commit: {required: true, type: string, description: commit hash that will be benchmarked}
run_on_pr_head: {required: false, default: false, type: boolean, description: Specifies if the benchmark should run on PR head branch}
dev_image_tag: {required: false, default: 'latest', type: string, description: Tag of the ArcticDB development image}
jobs:
start_ec2_runner:
uses: ./.github/workflows/ec2_runner_jobs.yml
Expand All @@ -19,7 +20,7 @@ jobs:
always() &&
!cancelled()
runs-on: ${{ needs.start_ec2_runner.outputs.label }}
container: quay.io/pypa/manylinux_2_28_x86_64:latest
container: ghcr.io/man-group/arcticdb-dev:${{ inputs.dev_image_tag }}
env:
# this is potentially overflowing the cache, so should be looked into after we address issue #1057
SCCACHE_GHA_VERSION: ${{vars.SCCACHE_GHA_VERSION || 1}} # Setting this env var enables the caching
Expand All @@ -31,11 +32,6 @@ jobs:
defaults:
run: {shell: bash}
steps:
- name: Initialize LFS
shell: bash -l {0}
run: |
dnf install -y git-lfs

- uses: actions/[email protected]
with:
lfs: 'true'
Expand All @@ -48,9 +44,6 @@ jobs:
uses: mozilla-actions/[email protected]
with:
version: "v0.4.0"

- name: Install deps
uses: ./.github/actions/setup_deps

- name: Extra envs
shell: bash -l {0}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
description: Override CMAKE preset type
type: choice
options: ["-", debug, release]
dev_image_tag:
description: Tag of the ArcticCB development image to use for the Linux C++ tests build
type: string
default: latest
run-name: Building ${{github.ref_name}} on ${{github.event_name}} by ${{github.actor}}
concurrency:
group: ${{github.ref}}
Expand Down Expand Up @@ -52,7 +56,7 @@ jobs:
mongodb:
image: "mongo:4.4"
container:
image: quay.io/pypa/manylinux_2_28_x86_64
image: ghcr.io/man-group/arcticdb-dev:${{inputs.dev_image_tag || 'latest'}}
volumes:
- /:/mnt
windows_matrix:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ jobs:
maximum-size: 6GB
disk-root: "D:" # This is also the checkout directory. Total size 12GB.
continue-on-error: true

- name: Install deps
if: matrix.os == 'linux' && inputs.job_type != 'build-python-wheels'
uses: ./.github/actions/setup_deps

- name: Extra envs
# This has to come after msvc-dev-cmd to overwrite the bad VCPKG_ROOT it sets
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/dev_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker Image for Development
on:
# should support manual trigger and PRs to the Dockerfile
push:
paths:
- 'docker/**'
- '.github/workflows/dev_docker_image.yml'
Copy link
Collaborator

@phoebusm phoebusm Dec 19, 2024

Choose a reason for hiding this comment

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

I don't see the other jobs depend on Docker Image for Development job. So changes in the dev docker creation won't be reflected until the image got pushed in Docker Image for Development job.

I feel like the checksum checking method in cibw_docker_image.yml for triggering the creation of new docker image a better alternative

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We make changes to this docker very infrequently so I prefer to keep the flows a bit simpler and to not add dependencies between them unless it is needed.
Also this image will be used in other repos as well so it has to be tested manually in any case.

Copy link
Collaborator

@phoebusm phoebusm Dec 19, 2024

Choose a reason for hiding this comment

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

Yes I am torn. I understand this docker image won't be changed frequently so it's hard to justify complicating already complicated wheel building process.
At the same time, if any changes made to this docker image, the CI can't tell us whether it works until the change is merged and tag latest is updated. Only manual test evidence can be relied on. This kinda defy the purpose of CI.
I'll approve it and leave it to @poodlewars for thoughts

Copy link
Collaborator

@poodlewars poodlewars Dec 19, 2024

Choose a reason for hiding this comment

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

It would be nice to be able to run the CI with a candidate new image. How about a run parameter to choose the image tag rather than hardcoding latest? Would then be easy to try out a CI run with a candidate image.

Or having downstream jobs depend on this one sounds reasonable too. Either way works as long as it's all documented and easy for people to figure out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point , I've added a parameter to override the default tag

workflow_dispatch:

jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/[email protected]

- name: Choose image tag
run: |
sha=$(git rev-parse --short HEAD)
image_ver="$(date '+%Y%m%d')-${sha}"
image_name="ghcr.io/man-group/arcticdb-dev"
echo -e "image_ver=$image_ver\nimage_name=$image_name\noutput_tag=$image_name:$image_ver" | tee -a $GITHUB_ENV

- name: Build Docker image
run: |
docker build -t $image_name . -f docker/Dockerfile

- name: Login to GHCR
run: docker login ghcr.io -u token -p "${{secrets.GITHUB_TOKEN}}"

- name: Publish Docker versioned image to GHCR
run: |
docker tag $image_name $image_name:$image_ver
docker push $image_name:$image_ver

- name: Publish Docker image to GHCR as latest
if: github.ref == 'refs/heads/master'
run: |
docker tag $image_name $image_name:latest
docker push $image_name:latest
26 changes: 26 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM quay.io/pypa/manylinux_2_28_x86_64

RUN dnf update -y
RUN dnf remove -y 'gcc-toolset-*'
RUN dnf install -y zip flex bison gcc-toolset-10 gcc-toolset-10-gdb gcc-toolset-10-libatomic-devel krb5-devel cyrus-sasl-devel openssl-devel \
unzip tar epel-release jq wget libcurl-devel git-lfs \
python3.11-devel python3.11-pip perl-IPC-Cmd

RUN dnf groupinstall -y 'Development Tools'
RUN dnf install -y mono-complete

RUN dnf clean all

RUN wget -nv https://github.com/mozilla/sccache/releases/download/v0.8.2/sccache-v0.8.2-x86_64-unknown-linux-musl.tar.gz
RUN tar xvf sccache*.tar.gz
RUN mv sccache-*/sccache .
RUN chmod 555 sccache

RUN cp sccache /usr/local/bin/

ENV CC=/opt/rh/gcc-toolset-10/root/bin/gcc
ENV CMAKE_C_COMPILER=/opt/rh/gcc-toolset-10/root/bin/gcc
ENV CXX=/opt/rh/gcc-toolset-10/root/bin/g++
ENV CMAKE_CXX_COMPILER=/opt/rh/gcc-toolset-10/root/bin/g++
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-10/root/usr/lib64:/opt/rh/gcc-toolset-10/root/usr/lib:/opt/rh/gcc-toolset-10/root/usr/lib64/dyninst
ENV PATH=/opt/rh/devtoolset-10/root/usr/bin:/opt/python/cp311-cp311/bin:${PATH}
Loading