Skip to content

[CI] Github Actions#8304

Closed
yparitcher wants to merge 13 commits into
koreader:masterfrom
yparitcher:2gha
Closed

[CI] Github Actions#8304
yparitcher wants to merge 13 commits into
koreader:masterfrom
yparitcher:2gha

Conversation

@yparitcher

@yparitcher yparitcher commented Oct 6, 2021

Copy link
Copy Markdown
Member

@Frenzie some progress here ;)

no root needed so far.

TODO

- [ ] git >= 2.18 in docker image.

  • verify cache works
    - [ ] test.sh parallelize?
  • after_success.sh will only run on master push, but we need support for the right secrets etc.
  • upload artifacts?

This change is Reviewable

@Frenzie

Frenzie commented Oct 6, 2021

Copy link
Copy Markdown
Member

but the tests (make testfront) segfaults

Oh dear, just like CircleCI. :-/

Comment thread .github/workflows/tests.yml
Comment thread .github/workflows/tests.yml Outdated
Comment thread .github/workflows/tests.yml Outdated
Comment thread .github/workflows/tests.yml
Frenzie added a commit to Frenzie/virdevenv that referenced this pull request Oct 6, 2021
@yparitcher

Copy link
Copy Markdown
Member Author

but the tests (make testfront) segfaults

Oh dear, just like CircleCI. :-/

and here i thought it was my fault :)
I am using 0.1.8 for now to make sure it works.
For the future is there any reason we are using 18.04 (bionic) instead of 20.04 (focal) in the docker image?

@Frenzie

Frenzie commented Oct 6, 2021

Copy link
Copy Markdown
Member

For the future is there any reason we are using 18.04 (bionic) instead of 20.04 (focal) in the docker image?

Yes, upwards compatibility is better than downwards. That applies for the Debian packages as well as the AppImage. They'll be compatible with basically everything newer than Ubuntu 18.04/Debian 10.

https://docs.appimage.org/introduction/concepts.html#build-on-old-systems

As a corollary, I'd like people to pick up hacking the project as easily as possible, i.e., without having to download a custom brand new CMake or some such.

Of course that's only a general guideline. Ubuntu 18.04 ships with CMake 3.10 and there are definite reasons to prefer at least 3.13 (and if you do that you might as well go straight for 3.16, which is a commonly backported version). But unless there are concrete advantages, the older the better, so to speak.

Also keep in mind @NiLuJe runs the very latest of everything, I tend to be a touch more conservative with currently Debian 11 and Kubuntu 21.10 but, ya know, it's not Debian 10 or something ;-) so the CI also ensures it actually won't break on those older systems. We already test on newer ones ourselves.

@yparitcher

Copy link
Copy Markdown
Member Author

Ok, it works now with 0.1.8
Now i need to figure out the cache permissions

@Frenzie

Frenzie commented Oct 6, 2021

Copy link
Copy Markdown
Member

and here i thought it was my fault :)

Nah, I thought #7775 was just a small change but it's been on hold because I don't know what might be going wrong. Running the same thing in Docker locally doesn't produce any segfaults on any of my systems.

PS I just realized I forgot to use a newer busted in the 0.2.2 Docker images; normally I'm not in a rush when putting them together.

@yparitcher

Copy link
Copy Markdown
Member Author

Base cache works :)
the install cache causes busted to error

Run .ci/test.sh
************ CMAKE_MAKE_PROGRAM: "/usr/bin/ninja" **********
ln -sf ../../.busted koreader-emulator-x86_64-linux-gnu/koreader
# sdr files may have unexpected impact on unit testing
rm -rf spec/unit/data/*.sdr
cd koreader-emulator-x86_64-linux-gnu/koreader && ./luajit /home/ko/.luarocks/bin/busted \
	--sort-files \
	--output=gtest \
	--exclude-tags=notest  
/bin/bash: line 3:  2348 Illegal instruction     (core dumped) ./luajit /home/ko/.luarocks/bin/busted --sort-files --output=gtest --exclude-tags=notest
Makefile:138: recipe for target 'testfront' failed
make: *** [testfront] Error 132
Error: Process completed with exit code 2.

@yparitcher

Copy link
Copy Markdown
Member Author

Cached action takes ~6min to run

@yparitcher yparitcher marked this pull request as ready for review October 7, 2021 14:42
@Frenzie Frenzie mentioned this pull request Oct 24, 2021
@yparitcher yparitcher force-pushed the 2gha branch 7 times, most recently from a5f9ea2 to 8fed406 Compare October 26, 2021 18:28
@yparitcher

Copy link
Copy Markdown
Member Author

@Frenzie
The basics of this PR work, but i am losing hope for getting the new docker images working.
@NiLuJe
Could luajit be giving illegal instruction errors because the different cloud machines have different --march=native, so when it is cached between runs it fails?

@Frenzie

Frenzie commented Oct 26, 2021

Copy link
Copy Markdown
Member

@yparitcher There should be a similar mechanism as in CircleCI to prevent that. Note the {{ arch }}. I'm fairly sure dumping the cache was also one of the first things I tried when I first saw this issue in CircleCI (not because of different arch, see above, but because of the different compilers in the Docker images). I can experiment with that some more if you like; I shelved it in favor of this PR.

- save_cache:
key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }}

@NiLuJe

NiLuJe commented Oct 26, 2021

Copy link
Copy Markdown
Member

That's an interesting thought, yeah. Might be worth trying to force a dumb -march=x64 (or whatever the actual sane lowest common denominator is ;p).

@yparitcher

yparitcher commented Oct 26, 2021 via email

Copy link
Copy Markdown
Member Author

Comment thread .github/workflows/tests.yml
Comment thread .github/workflows/tests.yml Outdated
@yparitcher

yparitcher commented Oct 27, 2021

Copy link
Copy Markdown
Member Author

The translations/docs require a PAT to be able to commit to a different repo
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
https://docs.github.com/en/actions/security-guides/encrypted-secrets
I don't have admin access to try to create one.

@Frenzie

Frenzie commented Oct 27, 2021

Copy link
Copy Markdown
Member

Bus factor - 1.

@yparitcher

Copy link
Copy Markdown
Member Author

Bus factor - 1.

With great power comes great responsibility.

@Frenzie

Frenzie commented Oct 27, 2021

Copy link
Copy Markdown
Member

Yup! :-)

@yparitcher

yparitcher commented Oct 28, 2021

Copy link
Copy Markdown
Member Author

See koreader/doc#1 for a GHA that will allow us to triiger a doc build without having to pass around secrets

@yparitcher

Copy link
Copy Markdown
Member Author

@Frenzie
@ anyone who can help with security :)

github action are run with a GITHUB_TOKEN that only has permissions in the current repo.
In order to commit in a different repo on can:
make a user PAT, however the drawback is that if the person leaves the org it will stop working, and there are no ganular permissions, the PAT an access any repo of the user.

With a organization Github Apps one can give the app only repo permissions and these permissions will only be applied to the repos the app is installed to.

Based on the above, I have a few questions/ suggestions.

  1. I would like to make a "commit" Github App and install it in the doc and translation repos. this can then be used by a workflow in the koreader repo to commit with the auth of the app. For details see this blog post and my sample action
  2. Can we change the default permission for the GITHUB_TOKEN to read only as i don't think we are using github actions anywhere to write
  3. Do we still use Travis anywhere in the org? If not can we Deauth its third party integration?

@yparitcher

yparitcher commented Oct 28, 2021

Copy link
Copy Markdown
Member Author

BTW even with the 0.1x it still the test still fail intermittently with "illegal instruction", so if someone can figure out how to make a generic x64 build it would be nice to test.

Edit: weirdly the action run on my fork for the same commit succeeded

@Frenzie

Frenzie commented Oct 28, 2021

Copy link
Copy Markdown
Member

Do we still use Travis anywhere in the org? If not can we Deauth its third party integration?

Yes but also no. Travis committed suicide and while you'd think the new Travis would be a drop in replacement it either isn't or it just doesn't work for me. But in any case travis*.org* is defunct.

Put another way, there are some things not converted to GHA yet.

@Frenzie

Frenzie commented Oct 28, 2021

Copy link
Copy Markdown
Member

@yparitcher DEBIAN=1 ./kodev build should do that, shouldn't it?

@yparitcher

Copy link
Copy Markdown
Member Author

superseded by #8428

@yparitcher yparitcher closed this Dec 26, 2021
@yparitcher yparitcher deleted the 2gha branch December 27, 2021 02:21
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