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

ci: migrate ci setup from circle ci to github actions #464

Merged
merged 20 commits into from
Jul 24, 2024
Merged

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Jul 5, 2024

In this PR, we migrate the CI from CircleCI to GitHub Actions.

The important difference in the GitHub Actions setup is that we're running the Linux ARM64 builds on self-hosted GitHub Actions runners.

Code style checks, builds, and tests have been tested in CI - see https://github.com/filecoin-project/filecoin-ffi/actions/runs/9857064865

Publishing will only be verified after the merge.

Before the merge, we have to stop building in CircleCI and change the Required workflows setting.

Once we verify the new workflow works as expected, we're going to remove the CircleCI configuration altogether.

As requested, the GitHub Actions release workflow supports releasing from an arbitrary historical refs using the workflow dispatch trigger with ref input.

@galargh galargh changed the title WIP: ci: migrate ci setup from circle ci to github actions ci: migrate ci setup from circle ci to github actions Jul 9, 2024
@galargh galargh requested a review from laurentsenta July 9, 2024 13:23
var sigs []Signature
var pubks []PublicKey
for i := 0; i < size; i++ {
msg := Message(fmt.Sprintf("cats cats cats cats %d %d %d dogs", i, i, i))
msgs = append(msgs, msg)
Copy link

@laurentsenta laurentsenta Jul 9, 2024

Choose a reason for hiding this comment

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

We're touching a test, is a typo or expected? I guess that breaks some linting rules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the linting rules started failing. The issue made sense to me so I fixed it. I suspect we're using newer version of some linting tool or something like that.

Copy link
Member

Choose a reason for hiding this comment

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

https://hub.docker.com/layers/cimg/go/1.21.2-node/images/sha256-59b3fff1c4745e9195ea35eef2cfbee4cb0b562616869e304b581644020ad4b8 - golangci-lint v1.54.2 vs v1.56.2

but, I don't see any version of golangci-lint failing on this file. staticcheck does but I don't see it being used here?

Copy link
Member

Choose a reason for hiding this comment

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

btw I'm not objecting to this fix, just interested in why this is showing up for this diff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the failing run before I added this change - https://github.com/filecoin-project/filecoin-ffi/actions/runs/9805936223/job/27076653921

It does come from staticcheck as you pointed out. I wonder why we weren't running it in CircleCI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is listed in the linters list there, too. Honestly, I'm not sure why it wasn't flagging this issue.

Copy link
Member

@rvagg rvagg Jul 12, 2024

Choose a reason for hiding this comment

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

make go-lint only runs golangci-lint. So how about we add staticcheck install to this workflow and to the Makefile too so we have it properly covered

Needs investigation, golangci-lint is invoking staticcheck, I wonder if we need it installed for that to happen or if there's some config we're missing. Maybe we should just import the lotus config and be done with it. I'll try and get to figuring this out unless someone has a chance before me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is running in GHA - that's why I had to add the fix - so I wonder how much time we want to spend investigating this.

Copy link
Member

Choose a reason for hiding this comment

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

apparently golangci-lint has "staticcheck" but not quite the same as "staticcheck", so this is even more confusing ..

it's a good fix, so not a big deal, it would just be god to understand this and maybe fix our linting to do a better job

not a blocker for this PR

@galargh galargh marked this pull request as ready for review July 10, 2024 12:51
@galargh galargh requested review from BigLep and rvagg July 10, 2024 12:51
@galargh galargh requested a review from rjan90 July 10, 2024 12:52
Comment on lines +9 to +16
wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget -q https://developer.download.nvidia.com/compute/cuda/12.5.1/local_installers/cuda-repo-ubuntu2204-12-5-local_12.5.1-555.42.06-1_arm64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-5-local_12.5.1-555.42.06-1_arm64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-5-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-5
sudo mkdir -p /usr/lib/aarch64-linux-gnu/stubs
Copy link
Member

Choose a reason for hiding this comment

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

This is all new for GHA, is the arm64 image available to us different enough that there's no cuda available already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're using an almost clean Ubuntu image for Linux arm64 self-hosted runners. We can add installing a version of cuda-toolkit in the machine image to the self-hosted runners backlog if you think it'd be good to have a default available on a machine. One question I have is how much we care about the version of the toolkit.

Copy link
Member

Choose a reason for hiding this comment

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

I'd like to hear @vmx on this; it's his area, cuda and nvidia driver versions for me are just a source of frustration rather than something I know a whole lot about!

Copy link
Contributor

Choose a reason for hiding this comment

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

For development I recommend installing CUDA drivers from the NVIDIA website as the distro ones often don't work well (for whatever reason). Though for CI, I think using the distro packages could work (KISS). If it works for Linux, it should also work for ARM (I hope).

We should support old enough versions and for filecoin-ffi it's more of a sanity check. So whatever the CUDA version is, as long as the tests pass, we are good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it; I'd move on with installing it on linux arm during the run first, and once we add A version of it to the base image, we'll come back here and remove that step.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@rvagg
Copy link
Member

rvagg commented Jul 11, 2024

Looks pretty close to circle config. Not at all clearer though! I worry a little about future maintainability of complex GHA configs like this, but I'm not sure what can be done in lieu of a better config language for GHA.

Co-authored-by: Rod Vagg <rod@vagg.org>
@BigLep
Copy link
Member

BigLep commented Jul 11, 2024

For the record, this closes #463

@rvagg
Copy link
Member

rvagg commented Jul 15, 2024

@vmx should be back this week and hopefully he can do a quick review on the relevant bits of this, particularly commenting on the cuda bits in the discussion above, and then we should be good to 🚢

Comment on lines +17 to +18
sudo ln -s /usr/local/cuda-12.5/lib64/stubs/libcuda.so /usr/lib/aarch64-linux-gnu/stubs/libcuda.so.1
sudo ln -s /usr/local/cuda-12.5/lib64/stubs/libcuda.so /usr/lib/aarch64-linux-gnu/stubs/libcuda.so
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if that's really needed. It looks a bit like a direct port from the CircleCI config. I'd expect the files to be accessible through /usr/local/cuda/lib64/stubs/libcuda.so (not that there's no specific cuda version in the path). And then later below, it should be enough to put the LD_LIBRARY_PATH to usr/local/cuda/lib64/stubs/ (if that's needed at all, perhaps it's already found automatically).

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've tried the suggestion in #472, but it doesn't seem to cut it, unfortunately.

Copy link
Contributor

@vmx vmx left a comment

Choose a reason for hiding this comment

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

I've left comments, but generally it looks good and as long it's green I think it's good to be merged. Hence I'm approving it.

@BigLep
Copy link
Member

BigLep commented Jul 22, 2024

@galargh : anything blocking from getting this merged?

@BigLep
Copy link
Member

BigLep commented Jul 23, 2024

@rvagg : per Slack, @galargh believes this is good to merge. Can you please handle?

@rvagg rvagg merged commit d751003 into master Jul 24, 2024
14 of 15 checks passed
@rvagg rvagg deleted the ipdx/ci-migration branch July 24, 2024 03:08
@galargh
Copy link
Contributor Author

galargh commented Jul 24, 2024

Thanks for merging. I've now disabled CircleCI in this repo. Please ping me when you prepare to create a new tag here, we'll verify if publishing from GitHub Actions works as expected.

@rvagg
Copy link
Member

rvagg commented Jul 25, 2024

#476 getting rid of circle config so it stops showing up in PRs; I assume this is the appropriate next step here.

Please ping me when you prepare to create a new tag here

Not sure how much we have queued that'll need it, maybe there's a new ref-fvm upgrade coming down the pipe but I don't think it's imminent.

@rvagg
Copy link
Member

rvagg commented Jul 25, 2024

Of course we could just make a new tag, I don't think there'd be a problem with that now that we've got Lotus 1.28.0 done, a tag just for the sake of testing CI wouldn't be a bad thing I think. @rjan90 what do you think?

@rjan90
Copy link
Contributor

rjan90 commented Jul 25, 2024

Of course we could just make a new tag, I don't think there'd be a problem with that now that we've got Lotus 1.28.0 done, a tag just for the sake of testing CI wouldn't be a bad thing I think. @rjan90 what do you think?

Agree that we can just create a tag for testing CI, but let us schedule it after the Mainnet upgrade on 2024-08-06, just to prevent any user confusion around which release to pull in for other teams depending on Filecoin-FFI for the coming nv23 upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

6 participants