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

Docker workflow #1105

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Docker workflow #1105

wants to merge 6 commits into from

Conversation

rbanka1
Copy link
Contributor

@rbanka1 rbanka1 commented Feb 18, 2025

Add Docker workflow
changes:

  • created docker build and push workflow
  • created ubuntu 24.04 docker image
  • modified reuseable_fast and basic to work on docker image
  • modified pr/push to run build image when needed
  • added few installation to docker files

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

changes:
- created docker build and push workflow
- created ubuntu 24.04 docker image
- modified reuseable_fast and basic to work on docker image
- modified pr/push to run build image when needed
- added few installation to docker files
@@ -29,7 +29,10 @@ ARG UMF_DEPS="\

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev"
libnuma-dev \
libhwloc-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

libhwloc and libtbb are already included in UMF_DEPS - in all Dockerfiles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you have right, I will remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

heh, nope - you should not remove the UMF_DEPS. These ARGs are not only to list all dependencies, this is also to show which ones are required for using the library, and which are required e.g. for testing.

I believe tbb is not required to compile UMF, but it's required for tests. hwloc is required for UMF, so could be removed from test deps.

Okay that's said - there's another issue that's connected.
libhwloc-dev should be installed only on newer Ubuntu, here on Ubuntu-20.04 we should not install it and only install it via our script.
So in this OS, pls move HWLOC_DEPS up, add no UMF_DEPS, but please make a comment that hwloc is required as UMF dependency.
On other OSes, please remove the hwloc script and HWLOC_DEPS, and use UMF_DEPS equal to libhwloc-dev.

contents: read

jobs:
build-ci-container:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this job shall be limited to upstream only:

    if: github.repository == 'oneapi-src/unified-memory-framework'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure for that. As we were talking, I left it untouched

Copy link
Contributor

Choose a reason for hiding this comment

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

could you try and add that, pls? I think it should work just fine; at least we should test it.

Of course as long as you're testing you can omit adding it 😉

image: ${{ matrix.image }}
options: --user root --privileged
volumes:
- /home/runner/work/unified-memory-framework/unified-memory-framework:/home/runner/work/unified-memory-framework/unified-memory-framework
Copy link
Contributor

Choose a reason for hiding this comment

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

Can ${{github.workspace}} be used in case it differs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, i replaced it

${{matrix.extra_build_options}}

- name: Build
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
Copy link
Contributor

Choose a reason for hiding this comment

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

-j $(nproc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

strategy:
matrix:
include:
- os: windows-latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this var as there is only one OS tested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -91,6 +134,7 @@ jobs:
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

CMAKE_INSTALL_PREFIX not used, remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -29,7 +29,10 @@ ARG UMF_DEPS="\

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev"
libnuma-dev \
libhwloc-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

heh, nope - you should not remove the UMF_DEPS. These ARGs are not only to list all dependencies, this is also to show which ones are required for using the library, and which are required e.g. for testing.

I believe tbb is not required to compile UMF, but it's required for tests. hwloc is required for UMF, so could be removed from test deps.

Okay that's said - there's another issue that's connected.
libhwloc-dev should be installed only on newer Ubuntu, here on Ubuntu-20.04 we should not install it and only install it via our script.
So in this OS, pls move HWLOC_DEPS up, add no UMF_DEPS, but please make a comment that hwloc is required as UMF dependency.
On other OSes, please remove the hwloc script and HWLOC_DEPS, and use UMF_DEPS equal to libhwloc-dev.

ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
BuildDockers:
Copy link
Contributor

Choose a reason for hiding this comment

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

pls verify if detectChanges works properly when we merge a PR - pls test scenarios when you merged PR with and without any docker changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm tbh I'm not sure what has been tested here...? these were not a "test PRs" being merged into main, right? I was thinking - you push your new workflow (with building docker) into your main, then open 2 PRs on your fork and see if they are working properly (on PR). Later, test if after merging they are still working properly.

// for testing purpose I feel like you have to use different actor and set token in secrets

ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
BuildDockers:
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm tbh I'm not sure what has been tested here...? these were not a "test PRs" being merged into main, right? I was thinking - you push your new workflow (with building docker) into your main, then open 2 PRs on your fork and see if they are working properly (on PR). Later, test if after merging they are still working properly.

// for testing purpose I feel like you have to use different actor and set token in secrets

- name: Install g++-7
if: matrix.compiler.cxx == 'g++-7'
run: sudo apt-get install -y ${{matrix.compiler.cxx}}

- name: Install libhwloc
run: .github/scripts/install_hwloc.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

this step shouldn't be here - it's already covered in docker

@@ -181,11 +168,11 @@ jobs:
${{ matrix.compiler.cxx == 'icpx' && '. /opt/intel/oneapi/setvars.sh' || true }}
LD_LIBRARY_PATH="${{env.BUILD_DIR}}/lib/:${LD_LIBRARY_PATH}" ctest --output-on-failure

- name: Check coverage
- name: Check os coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change in name?

with:
registry: ghcr.io
username: bb-ur
password: ${{ secrets.BB_GHCR_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

sooo, I just realized - this job won't work on PR, as there's no access to secrets. So, if I'm changing anything in the docker there's no way it's going to pass...

please propose some solution, as this will be a blocker (GHA cache? connecting docker building with Basic/Fast jobs execution...? something else...?)

if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }}
working-directory: ${{env.BUILD_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.ubuntu_ver}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}}
Copy link
Contributor

Choose a reason for hiding this comment

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

ok, that's not good - the name of the artifact will be cov-22.04-shared... - we should definitely keep the old name with "ubuntu" in it - as we may have more OSes than just ubuntu - perhaps you should use the var as before os instead of ubuntu_ver -- so basically turn back what it was in matrix - os: ['ubuntu-20.04', 'ubuntu-22.04']

For unity, the same approach in FastBuilds - os: ['ubuntu-20.04', 'ubuntu-22.04'] instead of ubuntu_ver: <number>

ARG UMF_DEPS="\
libhwloc-dev \
libtbb-dev"
# libhwloc-dev is required
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment should be a little more verbose - saying that it's installed here via script, as the hwloc version is too old on this OS

and please move HWLOC_DEPS and # Copy hwloc here, above.

@@ -111,45 +118,25 @@ jobs:
install_tbb: 'ON'
disable_hwloc: 'OFF'
link_hwloc_statically: 'ON'
runs-on: ${{matrix.os}}

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

Copy link
Contributor

Choose a reason for hiding this comment

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

still missing tbb removal for matrix.install_tbb == 'OFF'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants