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 2 commits into
base: main
Choose a base branch
from
Draft

Docker workflow #1105

wants to merge 2 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
# Install hwloc
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh
RUN apt-get update \
&& apt-get install -y dos2unix libtool \
Copy link
Contributor

Choose a reason for hiding this comment

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

pls define deps as above using ARG and installing it as part of RUN apt ... command above

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

&& dos2unix /opt/umf/install_hwloc.sh \
&& bash -x /opt/umf/install_hwloc.sh \
&& ldconfig \
&& rm -f /opt/umf/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.

no need for removing the script

&& apt-get install -y dos2unix libtool \
&& dos2unix /opt/umf/install_hwloc.sh \
&& bash -x /opt/umf/install_hwloc.sh \
&& ldconfig \
Copy link
Contributor

Choose a reason for hiding this comment

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

are these 3 commands required?

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 because without these commands there is a problem with windows line endings (\r)


# Install lcov
RUN apt-get update && \
apt-get install lcov -y
Copy link
Contributor

Choose a reason for hiding this comment

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

lcov is a MISC dependency (required only for coverage checking)


# Install valgrind
RUN apt-get update && \
apt-get install -y valgrind cmake hwloc libhwloc-dev libnuma-dev libtbb-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

pls move it up, to test deps

- name: Print metadata of our dll's
if: matrix.os == 'windows-latest'
run: |
get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list
Copy link
Contributor

Choose a reason for hiding this comment

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

something wrong here with EOF - there's should be just a single empty line at the end

@@ -122,10 +189,9 @@ jobs:
working-directory: ${{env.BUILD_DIR}}
run: ctest --output-on-failure --test-dir test -C Release

# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this comment?

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 restored it

fetch-depth: 0

- name: Initialize vcpkg
if: matrix.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.

we only execute tests here in this job on windows-latest - these if's are no longer needed

name: Fast builds (Linux)
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.os == 'ubuntu-latest' && 'ghcr.io/rbanka1/umf2-ubuntu-22.04:latest' || matrix.os == 'ubuntu-20.04' && 'ghcr.io/rbanka1/umf2-ubuntu-20.04:latest' }}
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 a fan on this solution - if we have e.g. 10 dockers this will become unreadable... But, I guess, we can figure it out later and leave it as is for now...

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 changed it to a more suitable solution for more dockers

FastBuild:
name: Fast builds
FastBuild_Linux:
name: Fast builds (Linux)
Copy link
Contributor

Choose a reason for hiding this comment

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

Linux should be fine (we know it's a Fast builds job based on the workflow name 😉

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.

2 participants