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

Build own docker images for integration tests #901

Merged
merged 13 commits into from
Aug 15, 2024

Conversation

dklimpel
Copy link
Contributor

@dklimpel dklimpel commented May 7, 2024

Checklist
  • make test-all (UNIX) passes. CI will also test this
  • unit and/or integration tests are included (if applicable)
  • documentation is changed or added (if applicable)

Description of change

Add own github workflow to build the docker images from the test and store them in a repo (ghcr.io). This can resolve the dependency on external repos in the future and ensure more up-to-date images or tests.

There are no significant changes at the Dockerfiles. I have therefore updated the md5 files so that the tests continue to run unchanged.

  • wheezy has expired repo signatures and needs a --force-yes
  • archlinux:base has moved
  • problems with pacman, but systemd-sysvcompat seems up to date
#6 [2/4] RUN pacman -Sy --noconfirm systemd-sysvcompat
#6 0.061 :: Synchronizing package databases...
#6 2.666  core downloading...
#6 2.666  extra downloading...
#6 2.671 resolving dependencies...
#6 2.838 :: There are 2 providers available for dbus-units:
#6 2.838 :: Repository core
#6 2.838    1) dbus-broker-units  2) dbus-daemon-units
#6 2.838 
#6 2.838 Enter a number (default=1): 
#6 2.838 looking for conflicting packages...
#6 2.839 
#6 2.839 Package (5)              Old Version  New Version  Net Change  Download Size
#6 2.839 
#6 2.839 core/dbus-broker                      36-2           0.35 MiB       0.15 MiB
#6 2.839 core/dbus-broker-units                36-2           0.00 MiB       0.00 MiB
#6 2.839 core/systemd             255.2-1      255.5-4       -0.47 MiB       8.00 MiB
#6 2.839 core/systemd-libs        255.2-1      255.5-4       -0.06 MiB       1.07 MiB
#6 2.839 core/systemd-sysvcompat  255.2-1      255.5-4        0.00 MiB       0.01 MiB
#6 2.839 
#6 2.839 Total Download Size:    9.22 MiB
#6 2.839 Total Installed Size:  33.84 MiB
#6 2.839 Net Upgrade Size:      -0.18 MiB
#6 2.839 
#6 2.839 :: Proceed with installation? [Y/n] 
#6 2.839 :: Retrieving packages...
#6 3.718  systemd-255.5-4-x86_64 downloading...
#6 3.718  systemd-libs-255.5-4-x86_64 downloading...
#6 3.718  dbus-broker-36-2-x86_64 downloading...
#6 3.718  systemd-sysvcompat-255.5-4-x86_64 downloading...
#6 3.718  dbus-broker-units-36-2-x86_64 downloading...
#6 3.718 checking keyring...
#6 4.912 checking package integrity...
#6 5.067 loading package files...
#6 5.075 checking for file conflicts...
#6 5.076 error: failed to commit transaction (conflicting files)
#6 5.122 dbus-broker-units: /usr/lib/systemd/system/dbus.service exists in filesystem (owned by dbus)
#6 5.122 dbus-broker-units: /usr/lib/systemd/user/dbus.service exists in filesystem (owned by dbus)
#6 5.122 Errors occurred, no packages were upgraded.
#6 ERROR: process "/bin/sh -c pacman -Sy --noconfirm systemd-sysvcompat" did not complete successfully: exit code: 1
------
 > [2/4] RUN pacman -Sy --noconfirm systemd-sysvcompat:
3.718  systemd-sysvcompat-255.5-4-x86_64 downloading...
3.718  dbus-broker-units-36-2-x86_64 downloading...
3.718 checking keyring...
4.912 checking package integrity...
5.067 loading package files...
5.075 checking for file conflicts...
5.076 error: failed to commit transaction (conflicting files)
5.122 dbus-broker-units: /usr/lib/systemd/system/dbus.service exists in filesystem (owned by dbus)
5.122 dbus-broker-units: /usr/lib/systemd/user/dbus.service exists in filesystem (owned by dbus)
5.122 Errors occurred, no packages were upgraded.
------
Dockerfile_arch:4
--------------------
   2 |     MAINTAINER @siddharthist
   3 |     
   4 | >>> RUN pacman -Sy --noconfirm systemd-sysvcompat
   5 |     RUN ln -s /does_not_exist /foo && \
   6 |         chmod 700 ~root
--------------------
ERROR: failed to solve: process "/bin/sh -c pacman -Sy --noconfirm systemd-sysvcompat" did not complete successfully: exit code: 1

Related to:

@dklimpel dklimpel marked this pull request as ready for review May 7, 2024 10:41
@dklimpel dklimpel requested a review from aelsabbahy as a code owner May 7, 2024 10:41
@dklimpel dklimpel marked this pull request as draft May 9, 2024 18:50
@dklimpel dklimpel changed the title Build own docker images and upload to ghcr Build own docker images for integration tests May 10, 2024
@dklimpel dklimpel marked this pull request as ready for review May 10, 2024 22:15
@dklimpel dklimpel mentioned this pull request May 28, 2024
3 tasks
petemounce
petemounce previously approved these changes Jun 28, 2024
Copy link
Collaborator

@petemounce petemounce left a comment

Choose a reason for hiding this comment

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

lgtm.

How would a person go about running this locally if they need to debug / reproduce what CI is doing?

.github/workflows/docker-integration-tests.yaml Outdated Show resolved Hide resolved
integration-tests/Dockerfile_arch Outdated Show resolved Hide resolved
@dklimpel
Copy link
Contributor Author

How would a person go about running this locally if they need to debug / reproduce what CI is doing?

You have this options for debugging.

petemounce
petemounce previously approved these changes Jul 1, 2024
petemounce
petemounce previously approved these changes Jul 7, 2024
Copy link
Collaborator

@petemounce petemounce left a comment

Choose a reason for hiding this comment

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

Beautiful. If GitHub agents have tree >=1.7, -J will return JSON.

Edit: But it doesn't look like they do.

@dklimpel
Copy link
Contributor Author

I have converted back to draft because I am not sure if the condtion to build after every push to master is the best way.

on:
  push:
    branches:
      - master

@dklimpel dklimpel marked this pull request as ready for review August 14, 2024 14:38
@aelsabbahy
Copy link
Member

Couple of small questions here:

  1. How do I run this once it's merged. I assume it's ad-hoc and not triggered from a branch
  2. Does this skip the build (or more importantly the push) if the git sha matches? Will it also update the .md5 file?

@dklimpel
Copy link
Contributor Author

dklimpel commented Aug 15, 2024

  • How do I run this once it's merged. I assume it's ad-hoc and not triggered from a branch

On the workflow page: https://github.com/goss-org/goss/actions/workflows/docker-integration-tests.yaml
is a button to trigger the job.
image

Does this skip the build (or more importantly the push) if the git sha matches?

Currently not

Will it also update the .md5 file?

Currently not

@aelsabbahy
Copy link
Member

Sounds good, I'll merge this. The skip can be done as a follow up enhancement.

Copy link
Member

@aelsabbahy aelsabbahy 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 clear explanation and the continued awesome work!

@aelsabbahy aelsabbahy merged commit 191fe32 into goss-org:master Aug 15, 2024
7 checks passed
@dklimpel dklimpel deleted the build_docker branch August 15, 2024 20: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