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

Build/test/release with a container action #115

Merged
merged 19 commits into from
Aug 24, 2023
Merged

Conversation

yzhang-23
Copy link
Contributor

@yzhang-23 yzhang-23 commented Aug 15, 2023

PR Type

  • Breaking change
  • Feature
  • Patch

Brief Description
This PR is about to build/test/release ParallelZone with the pre-built base image. The workflow starts at checking whether the base image needs to be re-built or not. Once the base image is ready, it is used to build a temporary building image (base + release images of dependent repos. Note: here ParallelZone has no dependent repo, however, for consistency we still "build" the building image which is identical to the base image. For other repos the building image might be different from the base images.). The key step of building/testing/releasing happens in a container created from this temporary building image, which is not necessary to save. If the building and testing processes are successful, finally two release images for gcc and clang would be pushed into the GitHub registry for future use.
The container action for building/testing/releasing here provides a template for developing similar actions for other repos.

Not In Scope

Now the version no. of necessary tools (e. g., gcc) and packages are manually provided in the workflow files. This information will be retrieved from files in NWXCmake through a workflow. I'm working on that.

PR Checklist

TODOs

  • Write a workflow to obtain the package version info from the file.

@yzhang-23 yzhang-23 enabled auto-merge August 15, 2023 21:34
@yzhang-23
Copy link
Contributor Author

The workflow build_base.yaml will be called if any of the relevant docker files has been changed.

Copy link
Member

@ryanmrichard ryanmrichard left a comment

Choose a reason for hiding this comment

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

No actions seem to have run.

.github/workflows/build_base.yaml Show resolved Hide resolved
.github/workflows/build_base.yaml Outdated Show resolved Hide resolved
@yzhang-23 yzhang-23 changed the title Build the base image for building/testing step-by-step Build/test/release with a container action Aug 22, 2023
@yzhang-23 yzhang-23 requested a review from ryanmrichard August 23, 2023 13:43
Copy link
Member

@ryanmrichard ryanmrichard left a comment

Choose a reason for hiding this comment

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

Is it possible to move the actions/ directory into the .github/ directory? I can go either way on the Dockerfile directory (assuming it can be used to build Docker images outside of CI/CD). Basically I want to keep the CI/CD stuff together and not contaminate the top-level directory any more than we need to.

@yzhang-23
Copy link
Contributor Author

yzhang-23 commented Aug 23, 2023

Is it possible to move the actions/ directory into the .github/ directory? I can go either way on the Dockerfile directory (assuming it can be used to build Docker images outside of CI/CD). Basically I want to keep the CI/CD stuff together and not contaminate the top-level directory any more than we need to.

Here the question is this type of container actions are adapted to the specific repos they take care of (everything must be happen in the same container, no separated steps), so I think it is not good to place them in .github, although I definitely want to do that. I will also welcome any better solutions.

@ryanmrichard
Copy link
Member

Is it possible to move the actions/ directory into the .github/ directory? I can go either way on the Dockerfile directory (assuming it can be used to build Docker images outside of CI/CD). Basically I want to keep the CI/CD stuff together and not contaminate the top-level directory any more than we need to.

Here the question is this type of container actions are adapted to the specific repos they take care of (everything must be happen in the same container, no separated steps), so I think it is not good to place them in .github, although I definitely want to do that. I will also welcome any better solutions.

To be clear I'm talking about the .github/ directory in this repo, not the .github repo.

@yzhang-23
Copy link
Contributor Author

Is it possible to move the actions/ directory into the .github/ directory? I can go either way on the Dockerfile directory (assuming it can be used to build Docker images outside of CI/CD). Basically I want to keep the CI/CD stuff together and not contaminate the top-level directory any more than we need to.

Here the question is this type of container actions are adapted to the specific repos they take care of (everything must be happen in the same container, no separated steps), so I think it is not good to place them in .github, although I definitely want to do that. I will also welcome any better solutions.

To be clear I'm talking about the .github/ directory in this repo, not the .github repo.

I'm sorry for misunderstanding your point! Definitely this action and the Dockerfile/ directory can be moved under .github of this repo.

@ryanmrichard
Copy link
Member

It occurs to me that this workflow (and also the current workflow) aren't building and running the Python tests. I'm fine merging this before it can run the Python tests, but I think we should fix that before going further down the stack.

@yzhang-23
Copy link
Contributor Author

It occurs to me that this workflow (and also the current workflow) aren't building and running the Python tests. I'm fine merging this before it can run the Python tests, but I think we should fix that before going further down the stack.

So, in order to run the python tests, do we need to turn on BUILD_PYBIND11_PYBINDINGS and add cmaize_add_tests() entries in the CMakeList.txt file?

@ryanmrichard
Copy link
Member

It occurs to me that this workflow (and also the current workflow) aren't building and running the Python tests. I'm fine merging this before it can run the Python tests, but I think we should fix that before going further down the stack.

So, in order to run the python tests, do we need to turn on BUILD_PYBIND11_PYBINDINGS and add cmaize_add_tests() entries in the CMakeList.txt file?

The various CMakeLists.txt files should already be setup, so yes it's mainly turning on BUILD_PYBIND11_PYBINDINGS and then dealing with the additional Python dependencies (mainly Python itself, but also some PyPI packages)

@yzhang-23
Copy link
Contributor Author

The various CMakeLists.txt files should already be setup, so yes it's mainly turning on BUILD_PYBIND11_PYBINDINGS and then dealing with the additional Python dependencies (mainly Python itself, but also some PyPI packages)

Tried turning on BUILD_PYBIND11_PYBINDINGS and installed pybind11. However, the tests py_parallelzone and test_pz_under_mpi failed on my lcal machine.

@ryanmrichard
Copy link
Member

The various CMakeLists.txt files should already be setup, so yes it's mainly turning on BUILD_PYBIND11_PYBINDINGS and then dealing with the additional Python dependencies (mainly Python itself, but also some PyPI packages)

Tried turning on BUILD_PYBIND11_PYBINDINGS and installed pybind11. However, the tests py_parallelzone and test_pz_under_mpi failed on my lcal machine.

I'd merge this PR before worrying about getting the Python tests to work.

@yzhang-23
Copy link
Contributor Author

The various CMakeLists.txt files should already be setup, so yes it's mainly turning on BUILD_PYBIND11_PYBINDINGS and then dealing with the additional Python dependencies (mainly Python itself, but also some PyPI packages)

Tried turning on BUILD_PYBIND11_PYBINDINGS and installed pybind11. However, the tests py_parallelzone and test_pz_under_mpi failed on my lcal machine.

I'd merge this PR before worrying about getting the Python tests to work.

Sure. That's just my testing try.

@yzhang-23 yzhang-23 merged commit f76992e into master Aug 24, 2023
@yzhang-23 yzhang-23 deleted the base_image_build branch August 24, 2023 15:35
@ryanmrichard
Copy link
Member

🚀 [bumpr] Bumped! New version:v0.1.10 Changes:v0.1.9...v0.1.10

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