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

Update containers and include CI test for container builds #62

Merged
merged 8 commits into from
Aug 15, 2023

Conversation

gunnarx
Copy link
Collaborator

@gunnarx gunnarx commented Aug 8, 2023

Significant update of the docker/container files.

Primary reason for the update:

  1. Complete and bugfix the configuration of Dockerfiles and Makefile for the containers.
  2. Introduce a Github-Actions CI workflow to ensure that building containers keeps working, and also to run pytest for IFEX in the container environment(s).

(Some) detailed changes:

  • Parameterize docker/podman/whatever frontend is desired.
  • Simplify the specification of preferred python version. Having a .dotfile to specify the version turned out to have different behavior locally vs GitHub actions, so it's simply coded in the Dockerfiles now.

Why? -> The container setup enables:

  • (now) A "guaranteed to work" method to run IFEX tools, if other installation methods fail.
  • (now) Isolated execution environment, so when updating the Python version, we can know we are testing with (only) that version on the system and not some other system-installed python files.
  • (now) Try out different ways of installing and setting up the python environment, for example pyenv (installing python, mostly) and virtualenv (installing dependencies in local env, mostly).
  • (now) Better understand if there are particulars to know for a certain distro (currently only Ubuntu and Alpine container versions)
  • (future) Prepare for possibility to test over many python versions, to catch regressions, unsupported language features, or other issues. Although, that could also be done completely within GitHub actions workflows.

NOTES:

  • The Ubuntu container version uses pyenv which installs/builds Python from source code.
  • The Alpine version uses a pre-baked binary release and a virtual environment.

It's good because it creates diversity in testing, but the original reason was to work around bugs with pyenv / compiling python from source on the alpine variant.

Gunnar Andersson added 6 commits August 8, 2023 14:00
These scripts are used to set up a working environment - primarily when
creating a container with the working environment but might be useful
also on a "native" setup.

The installation script now inserts the pyenv init (set up path etc.)
in ~/.bashrc.

But in the  install_python_version_in_pyenv.sh script we can set up PATH
to the pyenv binary directly, before using it.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
It seems that ==6.0 failed to compile wheel on the Alpine container for
unknown reason.  This compiles cleanly, so I suppose some bug was fixed.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
It now works, uses pyenv to install a python version and paths are
OK for launching ifexgen.  Fixes were mostly in previous commit.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
- Restructured Makefile to reduce duplication of code.
- Add targets to run pytest inside containers
- Fixes to Alpine container as well, so that it works...

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
(Use short names that will later work on build-badges in README)
Updated also setup-python action - seems to remove some bugs.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
According to another source, these are the required dependencies to
build python from source via pyenv.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
@gunnarx gunnarx force-pushed the container_tests branch 2 times, most recently from 1d22b0b to fb4ec84 Compare August 8, 2023 22:58
Gunnar Andersson added 2 commits August 15, 2023 15:07
This is a wrapper that the user can invoke instead of ifexgen
to execute the tool in the container installation instead of a local
installation.  The usage should be identical, hopefully.
(It existed before but is now matching the updated container setup)

EDIT: Add similar support for D-Bus generator

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
@gunnarx gunnarx changed the title Container tests Update containers and include CI test for container builds Aug 15, 2023
@gunnarx
Copy link
Collaborator Author

gunnarx commented Aug 15, 2023

NOTE: The container builds/tests are a bit heavier on network/execution time, so they run on pull requests only, compared to the traditional unit test and docs generation that runs also on pushes.

@gunnarx gunnarx merged commit 13e7fdf into COVESA:master Aug 15, 2023
3 checks passed
@gunnarx gunnarx deleted the container_tests branch August 21, 2023 16:31
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.

1 participant