Skip to content

ci: Update workflow to use pre-built docker containers - Part 2 #895

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arunkarthik-akkart
Copy link
Contributor

Description of changes:

Currently the github actions workflow installs all the packages during runtime. Instead we want to install all the packages except aws-ofi-nccl plugin within a docker container and use this container during runtime.

This commit updates the PR-CI to use the pre-built containers instead of installing the stack during runtime.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


- name: Call `autoreconf -ivf`
shell: bash
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we suddenly need this?

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 added "shell: bash" because matrix variable comparisons weren't working correctly in the container environment. For example:

if [ "${{ matrix.sdk }}" = "neuron" ]

wasn't being evaluated properly with the container's default shell.

But I moved this setting to workflow-level default instead of specifying it per step:

defaults:
  run:
    shell: bash

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. what's the default shell?
  2. What changed that this is a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. What's the default shell?
    In GitHub runners (Ubuntu 22.04): Default is /bin/bash
    In Docker containers: Default is /bin/sh

  2. What changed that this is a problem?
    Previously, we were running directly on GitHub runners where /bin/bash was the default shell. When we moved to containerized builds, we're now running in containers where /bin/sh is the default shell. This becomes a problem because:

The string comparison == operator works in bash but not in sh
Our matrix variable evaluations like:
if [ "${{ matrix.sdk }}" == "neuron" ]
were using bash-specific syntax that isn't POSIX-compliant

The solution was to either:

  1. Explicitly specify shell: bash to maintain the same shell environment we had before
  2. Use POSIX-compliant syntax (= instead of ==)

Here I have add shell: bash to maintain consistency with our previous environment and ensure all bash features are available.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather do (2).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I have made the change (2).

@arunkarthik-akkart arunkarthik-akkart force-pushed the ci/containerize-ci branch 4 times, most recently from f9b7125 to 342a453 Compare May 28, 2025 19:15
rauteric
rauteric previously approved these changes May 29, 2025
@rauteric
Copy link
Contributor

Also, please add the obligatory "Signed-off-by" to your commit message.

Currently the github actions workflow installs all the packages
during runtime. Instead we want to install all the packages except
aws-ofi-nccl plugin within a docker container and use this
container during runtime.

This commit updates the PR-CI to use the pre-built containers
instead of installing the stack during runtime.

Signed-off-by: Arun Karthik <[email protected]>
@arunkarthik-akkart
Copy link
Contributor Author

Also, please add the obligatory "Signed-off-by" to your commit message.

Done

@arunkarthik-akkart
Copy link
Contributor Author

bot:aws:retest

@arunkarthik-akkart
Copy link
Contributor Author

bot:aws:retest

Comment on lines +219 to +255
env:
CC: clang
CXX: clang++
run: |
# Ensure exit on real errors, but continue on exit code 2
set +e

# Create directories first
mkdir -p /workspace/codechecker_Results
mkdir -p /workspace/codechecker_Results_HTML
mkdir -p ./codechecker_Results_HTML

# Step 1: Log command
CodeChecker log \
-o /workspace/codechecker_Results.json \
-b "make V=1"
if [ $? -ne 0 ]; then exit 1; fi

# Step 2: Analyze command
CodeChecker analyze \
/workspace/codechecker_Results.json \
-o /workspace/codechecker_Results \
--jobs "$(nproc)" \
--config .github/codechecker.yaml \
--ctu \
--ctu-all
if [ $? -ne 0 ]; then exit 1; fi

# Step 3: Parse command - allow exit code 2
CodeChecker parse \
/workspace/codechecker_Results \
--export html \
--output /workspace/codechecker_Results_HTML
parse_exit=$?
if [ $parse_exit -ne 0 ] && [ $parse_exit -ne 2 ]; then
exit 1
fi

Choose a reason for hiding this comment

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

I understand removing setup codes as that is now embedded into our docker image, but how come there's a need to add additional run's specifically for the CodeChecker workflow?

Is the new docker image incompatible with whisperity/codechecker-analysis-action?

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.

5 participants