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

Add working spack build with build cache. #695

Merged
merged 20 commits into from
Sep 22, 2024
Merged

Conversation

cameronrutherford
Copy link
Collaborator

Closes #601

@cnpetra
Copy link
Collaborator

cnpetra commented Sep 4, 2024

FYI, one of the spack ubuntu builds fails.

@nychiang
Copy link
Collaborator

nychiang commented Sep 5, 2024

@cameronrutherford CURL cannot be found from the path (see here), but I see spack has specified to install curl.

@cameronrutherford
Copy link
Collaborator Author

@cameronrutherford CURL cannot be found from the path (see here), but I see spack has specified to install curl.

Yes... not really sure what's going on but I haven't had time to try and debug. I'm thinking if we let spack build curl this will resolve as the bug is with using external curl.

Just need to exclude it the same way we exclude finding Python..

@cnpetra
Copy link
Collaborator

cnpetra commented Sep 13, 2024

it loads curl and openssl, but now fails with
CMake Error: The source directory "/__w/hiop/hiop" does not appear to contain CMakeLists.txt.

@cameronrutherford
Copy link
Collaborator Author

spack/spack#46378 - I thought this would fix the issue. I think it's a reasonable fix to the spack package, but didn't resolve the issue.

What's frustrating here is that the error log isn't printing it's full output. I can't even see the full CMake line. I went down this path because there was an extra '' in the CMake line, but now I can't even tell what command is being invoked.

GitHub actions further complicates the problem because it's all running inside a VM, so unless I spend money on Azure it's hard to reproduce.

I will take a look again later with a fresh perspective and see what I can figure out. Confusing why we are only seeing this sort of issue with HiOp, not ExaGO or other packages...

@cnpetra
Copy link
Collaborator

cnpetra commented Sep 16, 2024

This time fails with
CMake Error: The source directory "/home/runner/work/hiop/hiop" does not appear to contain CMakeLists.txt.
Looks like it is a path concatenation issue.

If it is too cumbersome to make this work, then I suggest to disable this build. All the functionality is tested by the LLNL CI.

@cameronrutherford
Copy link
Collaborator Author

This time fails with CMake Error: The source directory "/home/runner/work/hiop/hiop" does not appear to contain CMakeLists.txt. Looks like it is a path concatenation issue.

If it is too cumbersome to make this work, then I suggest to disable this build. All the functionality is tested by the LLNL CI.

I can't believe I missed it, but we simply weren't cloning the repo in the spack pipelines. The pipelines are really flying here and complete in ~5 minutes

@cameronrutherford
Copy link
Collaborator Author

MPI CPU builds are running, passing tests and being pushed to a buildcahe for each branch in your repo. All in under 5 minutes if we don't have to re-build dependencies!

Copy link
Collaborator

@nychiang nychiang left a comment

Choose a reason for hiding this comment

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

LGTM. It turns out I need to update my knowledge from Cameron.

skopeo inspect \
docker://$OCI_URL \
--raw \
--creds "${{ env.USERNAME }}:${{ secrets.GITHUB_TOKEN }}" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

where do we provide the token?
I'd like to learn more about how you create the user hiop-bot and the dependencies in the container, but we can do it offline.

Copy link
Collaborator Author

@cameronrutherford cameronrutherford left a comment

Choose a reason for hiding this comment

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

Hopefully this clarifies your question @nychiang

jobs:
base_image_build:
runs-on: ubuntu-24.04
permissions:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nychiang tokens are automatically created by pipelines with permissions based on this YAML config.

TMPDIR: /opt/spack-cache
# Our repo name contains upper case characters, so we can't use ${{ github.repository }}
IMAGE_NAME: hiop
USERNAME: hiop-bot
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nychiang name is arbitrary. You can pick a different name 😁

&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get install -y --no-install-recommends \
gfortran \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nychiang gfortran was needed to launch MPI based applications when I was doing this for ExaGO.

I admittedly didn't pull/test the HiOp images, but this is covered in the tutorial I followed https://github.com/spack/spack-tutorial/blob/main/tutorial_binary_cache.rst#creating-runnable-container-images

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Figuring out the dependencies was admittedly trial and error.

For ExaGo, I was running MPI enabled OPFLOW to get our --version output, and logically added to the base image from the error messages I got.

@cnpetra cnpetra merged commit 5bbe218 into develop Sep 22, 2024
6 checks passed
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.

Spack CI failures
3 participants