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.

10 changes: 1 addition & 9 deletions .github/workflows/benchmark_commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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:latest
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 +31,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 +43,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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
mongodb:
image: "mongo:4.4"
container:
image: quay.io/pypa/manylinux_2_28_x86_64
image: ghcr.io/man-group/arcticdb-dev:latest
phoebusm marked this conversation as resolved.
Show resolved Hide resolved
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
39 changes: 39 additions & 0 deletions .github/workflows/dev_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: Publish Docker image to GHCR
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
run: |
docker login ghcr.io -u token -p "${{secrets.GITHUB_TOKEN}}"
docker tag $image_name $image_name:$image_ver
docker push $image_name:$image_ver

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