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

Migrate CI to GitHub Actions #1176

Merged
merged 2 commits into from
May 5, 2021
Merged

Migrate CI to GitHub Actions #1176

merged 2 commits into from
May 5, 2021

Conversation

fushar
Copy link
Contributor

@fushar fushar commented Apr 14, 2021

Migrating CI to GitHub's native CI tools (GitHub actions) so that we don't need to rely on external site (Travis) anymore.


This change is Reviewable

@fushar
Copy link
Contributor Author

fushar commented Apr 14, 2021

Sample CI job results: https://github.com/ioi-2022/cms/actions/runs/747025045

cmstestsuite/unit_tests/io/rpc_test.py Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
@andreyv
Copy link
Member

andreyv commented Apr 19, 2021

Hi,

Thanks for the PR, the idea sounds great. I'll take a look at the details a little bit later.

@fushar fushar closed this Apr 20, 2021
@fushar fushar deleted the gh-actions branch April 20, 2021 22:32
@fushar fushar restored the gh-actions branch April 23, 2021 02:28
@fushar fushar reopened this Apr 23, 2021
Copy link
Member

@andreyv andreyv left a comment

Choose a reason for hiding this comment

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

Please see some comments below.

I noticed the following in the new build log, too:

  • Multiple warnings such as
    Using legacy 'setup.py install' for netifaces, since package 'wheel' is not installed.
    
  • Python packages, and CMS itself (!), are installed to, e.g., /opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages, which doesn't really look like a user directory. Not sure if this is the intended way.

I will also be running some experiments with Github Actions to better understand the problems with the user group and isolate, and the warnings as well.

.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
cmstestsuite/unit_tests/io/rpc_test.py Show resolved Hide resolved
@fushar
Copy link
Contributor Author

fushar commented May 3, 2021

Will take a look at other comments later this week!

It can happen that the CMS user's primary group name doesn't match the
user name (in case of a pre-existing user), so we should use the actual
group name for setting file permissions.

We don't try to always create and use a "cmsuser" group instead, because
this wouldn't work within a single CI session.
@andreyv
Copy link
Member

andreyv commented May 4, 2021

I also investigated this further today and found the cause. In the CI environment, the user is runner and its primary group is docker (as you mentioned). But the CMS code assumed in multiple places that the CMS user's name and group name are the same. Thus, file permissions were being set up for runner:runner instead of runner:docker.

After fixing this problem I could remove the three workaround actions in the .yml file.

Regarding the pip warnings, wheel should be installed manually [1], so I added a corresponding command to install/upgrade pip, setuptools and wheel as well.

I don't have permissions to edit this branch, but you can see the new changes in 80091ce and 5678b3f. The CI now passes.

I'm inclined to merge this tomorrow unless you have any additional comments. And thanks for preparing the PR!

[1] https://docs.github.com/en/actions/guides/building-and-testing-python

@fushar
Copy link
Contributor Author

fushar commented May 4, 2021

Ah, thanks for investigating and fixing the issue!

I've cherry-picked your fix and included the commit in this branch. The CI passed here: https://github.com/ioi-2022/cms/actions/runs/810455275. Now this PR should be good to go 😄

@andreyv andreyv merged commit ed4e05f into cms-dev:master May 5, 2021
@andreyv
Copy link
Member

andreyv commented May 5, 2021

Merged, thanks :)

@fushar fushar deleted the gh-actions branch June 26, 2021 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants