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

fix(ci): required ubuntu 24 runner forward ports as 24 is now latest #422

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikehardy
Copy link
Member

@mikehardy mikehardy commented Oct 10, 2024

The need for this was noticed when a simple dependabot PR failed:

= note: /usr/bin/ld: cannot find -llzma: No such file or directory

https://github.com/ankidroid/Anki-Android-Backend/actions/runs/11278308705/job/31366466007?pr=421#step:13:40

...which led to a quick look at the runner image in use, noticed it was ubuntu-24 now and saw it just rolled out https://github.com/actions/runner-images/blob/ubuntu24/20241006.1/images/ubuntu/Ubuntu2404-Readme.md

Success criteria for merge is that the Ubuntu runner goes green in CI with runner image 24

that should allow enough space to run without liberating disk manually
@mikehardy mikehardy added the pending-merge Waiting on CI or question responses to merge, but otherwise ready label Oct 10, 2024
@mikehardy
Copy link
Member Author

Confirmed expected ubuntu-24 runner image:

Runner Image
  Image: ubuntu-24.04
  Version: 20241006.1.0

https://github.com/ankidroid/Anki-Android-Backend/actions/runs/11279185141/job/31369310967?pr=422#step:1:8

But xz-utils was apparently already installed, at the correct version 🤔

https://github.com/ankidroid/Anki-Android-Backend/actions/runs/11279185141/job/31369310967?pr=422#step:3:48

xz-utils is already the newest version (5.6.1+really5.4.5-1build0.1).
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.

So I expect this to fail again with -llzma: No such file or directory and I'll have to do something different

@mikehardy
Copy link
Member Author

Definitely installed something new at least, when using liblzma-dev as package name to install, and that did the trick, we got past that point in the build

Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  liblzma-doc
The following NEW packages will be installed:
  liblzma-dev
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.

@david-allison
Copy link
Member

david-allison commented Oct 10, 2024

We've possibly hardcoded a path?

/usr/bin/sh -c \printf 'hw.cpu.ncore=2
' >> /home/runner/.android/avd/test.avd/config.ini
/usr/bin/sh: 1: cannot create /home/runner/.android/avd/test.avd/config.ini: Directory nonexistent

@mikehardy
Copy link
Member Author

mikehardy commented Oct 10, 2024

I'm still working through this. The emulator runner isn't working with ubuntu-latest == ubuntu24 yet, there is an issue upstream

There was also this nugget in the log which I'm working through:

Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.

Got a few things local but I'm working on this in parallel with a few other things for other repos so it'll be stop starty

but I'm on it

@mikehardy mikehardy force-pushed the ubuntu-24-fix branch 2 times, most recently from 79d9c14 to 00d4079 Compare October 10, 2024 18:36
@mikehardy
Copy link
Member Author

I may have a local fix for the upstream issue but I need to close/reopen so that my fork of the action is on the allowed list

ubuntu-latest == 24 means that command line tools have been updated
a bit, enough to have a "latest" symlink in place on the image, but
not enough to be actually current

also a recent change in the upstream runner isn't safe enough with the
way it chowns files

finally, ubuntu-24 wants more AVD-related env vars set for things to work
correctly

I have forked the upstream action and fixed these things but they won't
merge for a while
@mikehardy
Copy link
Member Author

upstream issue on emulator runner will likely resolve soon, but now I've got rsdroid.so not found when running the emulator test

@david-allison does this look familiar to you at all?


net.ankiweb.rsdroid.BackendIntegrationTests > schedTimingTodayCall[emulator-5554 - 6.0] FAILED 
	java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/net.ankiweb.rsdroid.instrumented.test-1/base.apk", zip file "/data/app/net.ankiweb.rsdroid.instrumented-1/base.apk"],nativeLibraryDirectories=[/data/app/net.ankiweb.rsdroid.instrumented.test-1/lib/x86_64, /data/app/net.ankiweb.rsdroid.instrumented-1/lib/x86_64, /vendor/lib64, /system/lib64]]] couldn't find "librsdroid.so"
	at java.lang.Runtime.loadLibrary(Runtime.java:367)

I don't have an Ubuntu 24 env laying around at the moment to check myself, but I worry that similar to liblzma not being on the system, this could be a subtle linkage issue.

Or it could just be some obvious failure that the build system silently glosses over - there doesn't seem to be a lot of "did the expected products from this stage actually get produced correctly?" type verification as the build works

@david-allison
Copy link
Member

Do we have the .so so we can test it manually?

Not enough information from that error to know where the issue came from

@mikehardy
Copy link
Member Author

No, the workflow would need some hackery to post it as an artifact or similar, which would require finding out exactly where it is, at which point it's probably faster to spin up an ubuntu 24 vm locally but I won't have time for that for a while unfortunately

@mikehardy
Copy link
Member Author

Oh! I see that you actually do upload those artifacts, you must have set that up long ago, I see it on another run https://github.com/ankidroid/Anki-Android-Backend/actions/runs/11297029758?pr=423 so perhaps we have the .so

This isn't the highest priority (I pinned the runner to ubuntu-22 today on main) so will catch this as I can, or feel free anyone else reading this...

@mikehardy mikehardy removed the pending-merge Waiting on CI or question responses to merge, but otherwise ready label Oct 11, 2024
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.

2 participants