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: add docker image test workflow #332

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spacecodeur
Copy link
Contributor

Context & Description

The purpose of this PR is to propose an improvement to the initial version of the dockerization of the "source code" repository of Tuono: this improvement adds the configuration file for GitHub Actions.

An issue has been created here following the merge of the PR that included the Docker configuration..
Here is the current state I have reached so far:

  • Linux job: It works very well ! :D

  • Mac OS job:

    • I managed to make it work, but the result is not very satisfying because it only works on macOS version 13. I am using the Colima container runtime, which adds a significant layer to the process and thus impacts the build time on GitHub Actions.
    • I haven’t yet succeeded in getting the Tuono image build to work on the latest macOS version (14), mainly due to the architecture shift to ARM.
  • Windows job:

    • Without using WSL, Here is the error I am encountering:

image

It seems the current base image used in Dockerfile (docker/Dockerfile : rust:bookworm) that the official Rust image does not support Windows as host machine.

  • I’ve looked into using WSL and how to install it through a GitHub Actions workflow, but I haven’t had success so far. I’ll try again during the week.

If you’d like, I can start opening a PR for this topic. I will likely need help from Mac users to find the right setup for the GitHub Actions workflow.

@github-actions github-actions bot added the CI/CD label Jan 13, 2025
@marcalexiei marcalexiei changed the title add docker CI workflow ci: add docker image test workflow Jan 14, 2025
Copy link
Member

@marcalexiei marcalexiei left a comment

Choose a reason for hiding this comment

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

Thank you for the initial diving on testing docker.


I’ve looked into using WSL and how to install it through a GitHub Actions workflow, but I haven’t had success so far. I’ll try again during the week.

Consider to turn the PR into draft if you are still working on it.


As I write in #295 (comment), I'm fine by testing only linux env if windows and Mac turn out to so hard to work with.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please rename the file into docker-ci.yml?

Comment on lines 3 to 6
on:
push:
branches:
- 'chore-add-image-build-test-to-github-actions'
Copy link
Member

Choose a reason for hiding this comment

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

on needs refine otherwise it will never run 😄

Suggested change
on:
push:
branches:
- 'chore-add-image-build-test-to-github-actions'
on:
push:
branches:
- 'main'
pull_request:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed :D

matrix:
os:
- ubuntu-latest
- macos-13 # on intel chipset
Copy link
Member

Choose a reason for hiding this comment

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

I managed to make it work, but the result is not very satisfying because it only works on macOS version 13. I am using the Colima container runtime, which adds a significant layer to the process and thus impacts the build time on GitHub Actions.

I see on your fork that the build takes more than 30minutes to succeed so I would rather comment macOS from the os matrix.

ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
colima start
- name: Build and Run Docker Compose on linux/windows
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- name: Build and Run Docker Compose on linux/windows
- name: Build and Run Docker Compose

Comment on lines 46 to 49
- name: Check commands inside container
run: |
docker exec tuono-source-container pnpm --version || { echo "Error: pnpm is not available."; exit 1; }
docker exec tuono-source-container tuono --version || { echo "Error: tuono is not available."; exit 1; }
Copy link
Member

Choose a reason for hiding this comment

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

How about adding also a run of both pnpm and cargo tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm good point !
This way, we could potentially catch issues that depend on the OS. However, this would come at the cost of a longer CI execution time for Docker.
I'll share a comparison of the two execution times here to help decide on the matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As you can see here, the test steps ("run cargo test" and "run pnpm test") take a relatively short amount of time to complete.

Additionally, the "run pnpm test" step executes all existing tests in the packages directory. This setup ensures that if we add new tests, for instance, in the /packages/tuono directory in the future, they will automatically be included in the "pnpm" test step.

I didn't have time this week to explore running the CI on Windows or macOS. I'm unsure which OS to prioritize—macOS might be a bit more challenging for me to set up. However, feel free to share your preferences on this! :)

We could stop here for a first version, but I find it a bit disappointing to manage only one OS with Docker. Let me know what you think! :D

Copy link
Member

Choose a reason for hiding this comment

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

As you can see here, the test steps ("run cargo test" and "run pnpm test") take a relatively short amount of time to complete.

Excellent! It's great to have them working.


I didn't have time this week to explore running the CI on Windows or macOS. I'm unsure which OS to prioritize—macOS might be a bit more challenging for me to set up. However, feel free to share your preferences on this! :)

Every little help we can get is very welcome, so go ahead with the one you are more comfortable!


We could stop here for a first version,

I agree, we can merge this PR with only ubuntu os working.
Please merge main branch changes and ensure that CI is passing,
Once CI is green request a new review from me 😉


but I find it a bit disappointing to manage only one OS with Docker. Let me know what you think! :D

I understand your point.
If you want to keep investigate this further for additional OSes,
I can create new sub tasks (thanks GitHub Issues public preview 🤣)
in the linked issue to handle Windows and MacOS docker tests

@spacecodeur spacecodeur marked this pull request as draft January 14, 2025 07:43
@spacecodeur spacecodeur force-pushed the chore-add-image-build-test-to-github-actions branch from 03a16bd to be374b2 Compare January 14, 2025 07:51
@marcalexiei

This comment was marked as resolved.

@marcalexiei

This comment was marked as resolved.

@spacecodeur

This comment was marked as resolved.

@spacecodeur spacecodeur force-pushed the chore-add-image-build-test-to-github-actions branch 4 times, most recently from e50c891 to 569f05d Compare January 18, 2025 16:41
@spacecodeur spacecodeur force-pushed the chore-add-image-build-test-to-github-actions branch from 569f05d to 7e18628 Compare January 18, 2025 16:51
@Valerioageno Valerioageno linked an issue Jan 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docker]: add image build test to GitHub Actions
2 participants