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

chore: Add docker images for building the different platforms #11397

Merged
merged 26 commits into from
Jan 16, 2025

Conversation

ermshiperete
Copy link
Contributor

@ermshiperete ermshiperete commented May 8, 2024

This change adds the ability to build several docker images which can be used to build the different platforms (core, linux, web, android) and run tests. This can be used on a developer's machine but also on CI.

This change also updates the minimum node version to Node 20 as a temporary step until we try if we can use Node 22. This is necessary because the latest release of Node 18 still comes with the buggy npm that crashes the network. A better solution might have been to use nvm in the docker images (which would allow to easily update to the latest npm), but that would have required more changes and I decided to do it this way for now in order to finish this PR.

@keymanapp-test-bot skip

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented May 8, 2024

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S1 milestone May 8, 2024
@darcywong00 darcywong00 modified the milestones: A18S1, A18S2 May 11, 2024
@mcdurdin mcdurdin modified the milestones: A18S2, A18S3 May 24, 2024
@mcdurdin mcdurdin modified the milestones: A18S3, A18S4 Jun 7, 2024
@ermshiperete ermshiperete force-pushed the chore/linux/cicontainer branch 2 times, most recently from 90fe8aa to 1e10c81 Compare June 14, 2024 07:14
@darcywong00 darcywong00 modified the milestones: A18S4, A18S5 Jun 21, 2024
This updates the minimum required node version to Node 20. The latest
version of Node 18 still contains the npm bug
(npm/cli#7072) whereas Node 20 got updated to
a npm version that contains a fix. Node 20 is known to work with our
current code, so this change updates to that as an intermediate step
before we investigate if we can update to Node 22 as discussed for
Keyman 18.
This change allows to build a docker image that can build Keyman
for Linux with test coverage reports, and installs the necessary
dependencies for running integration tests.
@ermshiperete ermshiperete force-pushed the chore/linux/cicontainer branch from 1e10c81 to 8a4cdce Compare July 4, 2024 14:39
@github-actions github-actions bot added the core/ Keyman Core label Jul 4, 2024
@ermshiperete ermshiperete changed the base branch from master to fix/core/build July 4, 2024 14:40
@ermshiperete ermshiperete marked this pull request as ready for review July 4, 2024 14:41
@ermshiperete ermshiperete requested a review from mcdurdin as a code owner July 4, 2024 14:41
Also add test action to build.sh which builds all images and then tests
them by running configure,build,test on each.

Also add new dependencies to web image which Playwright requires.
These changes bring us one step further, but the build is still failing.
Setting permissions is now done in the base image.
@mcdurdin mcdurdin modified the milestones: A18S10, 19.0 Sep 13, 2024
@github-actions github-actions bot added the core/ Keyman Core label Jan 8, 2025
$HOME/tmp/gradlew --quiet && \
rm -rf $HOME/tmp

ENTRYPOINT [ "/usr/bin/bashwrapper" ]
Copy link
Contributor

@rc-swag rc-swag Jan 9, 2025

Choose a reason for hiding this comment

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

Does this file need to be fully deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it's replaced by this PR. Splitting it in multiple Dockerfiles has the advantage that we notice if we have the documented dependencies wrong for a platform. Previously it was possible that e.g. the dependencies for Android were wrong in the documentation, but the build still worked locally because for Linux you already installed the missing dependencies. Now when you tried to set up a build agent that only builds Android things would fail.

@ermshiperete ermshiperete requested a review from mcdurdin January 9, 2025 16:10
@ermshiperete ermshiperete modified the milestones: 19.0, A18S19 Jan 9, 2025
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

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

nice! especially like the parameterization of the dockerfiles

Comment on lines -59 to +60
std::unique_ptr<uint8_t> data(new uint8_t[0]);

// Execute
auto status = km_core_keyboard_load_from_blob(kmxfile.stem().c_str(), data.get(), 0, &this->keyboard);
auto status = km_core_keyboard_load_from_blob(kmxfile.stem().c_str(), nullptr, 0, &this->keyboard);
Copy link
Member

Choose a reason for hiding this comment

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

Why is this change in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because the tests failed to compile in the container. Don't know why only in the container and not elsewhere, but that's why it's in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

ugh, that's not good.

@ermshiperete ermshiperete merged commit b84b651 into master Jan 16, 2025
28 checks passed
@ermshiperete ermshiperete deleted the chore/linux/cicontainer branch January 16, 2025 11:31
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 18.0.168-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants