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

Drop ECR for testing builds and Add 22.04 Support #201

Merged
merged 16 commits into from
Oct 22, 2024

Conversation

feanil
Copy link
Contributor

@feanil feanil commented Oct 2, 2024

This PR simplifies the build and CI for codejail to make it easire to understand the testing and make it easier to test on multiple versions of Ubuntu.

Once this lands, the codejail code will support working on both Ubuntu 20.04 and Ubuntu 22.04 as long as the instructions in the readme are followed for setup. Especially with respect the sudo PAM config: 47842d9

We no longer support Python 3.8 so we don't need to build or test with
it.
@feanil feanil changed the title feanil/publish ubuntu images Drop ECR for testing builds Oct 2, 2024
Rather than relying on a different build workflow to have run on master,
build the image(s) we need for testing within this workflow.  To reduce
test time, use the github actions cache to cache intermediate layers.

See https://docs.docker.com/build/cache/backends/gha/ for mre details.
Since we're now building the image(s) we need as a part of CI, we have
no need for these docker images to be published to the 2U Tools Elastic
Container Registry.
We want to be able to test codejail on multiple different versions of
ubuntu and since we use docker containers to do this testing, we want to
make sure this will work with different versions of the built image as
well as different base versions of ubuntu.
@feanil feanil force-pushed the feanil/publish_ubuntu_images branch from 2398892 to 3a3bf93 Compare October 2, 2024 17:23
In the 24.04 image, the ubuntu user and group already exists in the
default image so we don't need to create it ourselves.
@feanil feanil force-pushed the feanil/publish_ubuntu_images branch 5 times, most recently from 297f899 to 28d97c6 Compare October 17, 2024 18:05
@feanil
Copy link
Contributor Author

feanil commented Oct 18, 2024

@MoisesGSalas this is about how far I've gotten, I think it makes sense to land this without 24.04 for now and then try to fix that as a separate PR in the future. It looks like something has changed either with docker or with apparmor in that version causing it to not enforce the network limits. Can you review this and let me know if you have any concerns. The commit messages should generally explain things but please ask any questions you might have.

@feanil feanil marked this pull request as ready for review October 21, 2024 13:14
@MoisesGSalas
Copy link
Contributor

@feanil, I will take a look later tomorrow. But I'm wondering if running the tests directly in the runner without docker (thinking of this network issue) would be easier/better?

I found this repo that seems to use apparmor just fine in the CI runner.

This drops a burch of config variables that pylint is no longer aware
of.
The new warnings don't show anything that we're uncomfortable with so
ignore them rather than fixing them in this case.  It's riskier to
change the method signatures or the types of exceptions thrown from this
critical bit of code.
Importing all of numpy loads OpenBlas which spawns many worker threads
behind the scenes.  Increasing the number of threads didn't seem to
work. I got up to 30 before deciding that it would be better for the
test to just limit the number of OpenBLAS threads.

The addition of the following code seems to resolve the issue:

```
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
```

Reference: https://stackoverflow.com/questions/52026652/openblas-blas-thread-init-pthread-create-resource-temporarily-unavailable
This was happening automatically in previous versions of ubuntu but
seems to not be happening correctly with the most recent profiles so
making it part of the profile.

There is a known issue with this and docker containers.
Codejail now supports running with ubunt 22.04 as well as ubuntu 20.04
This is not necessary for fixing issues but is good maintenance to do.
@feanil feanil force-pushed the feanil/publish_ubuntu_images branch from 55bcf27 to 9a36bbd Compare October 21, 2024 18:45
@feanil
Copy link
Contributor Author

feanil commented Oct 21, 2024

@MoisesGSalas that's something we can consider so that we can just test the profiles without the docker related confusion but since we use docker as a part of tutor, it's useful to also test inside containers so I'm of two minds on the issue. For now let's focus on landing this for 22.04 and we can come back to 24.04 after the release.

@feanil feanil force-pushed the feanil/publish_ubuntu_images branch from 9a36bbd to 1b99481 Compare October 21, 2024 19:46
Copy link

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Thanks for walking me through it! I can't find anything to object to.

Copy link
Contributor

@MoisesGSalas MoisesGSalas left a comment

Choose a reason for hiding this comment

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

Just one small comment

.github/workflows/ci.yml Show resolved Hide resolved
Copy link
Contributor

@MoisesGSalas MoisesGSalas left a comment

Choose a reason for hiding this comment

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

Thanks for coming to the rescue, @feanil. The errors in the newer ubuntu versions were really tricky to pinpoint when I tried tackling the upgrade

@feanil feanil merged commit 0c5e04d into master Oct 22, 2024
4 checks passed
@feanil feanil deleted the feanil/publish_ubuntu_images branch October 22, 2024 18:37
@feanil feanil changed the title Drop ECR for testing builds Drop ECR for testing builds and Add 22.04 Support Oct 22, 2024
@feanil feanil mentioned this pull request Oct 22, 2024
2 tasks
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