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: generic improvement and cleanup of workflow #20

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ jobs:
strategy:
fail-fast: ${{ github.event_name == 'pull_request' }}
matrix:
container_flavor:
- master
- worker
include:
- container_flavor: master
container_verify_string: "buildmaster configured in /master"
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this approach get hairy once we would like to add more checks/tests?

Copy link
Member Author

@Ansuel Ansuel Nov 14, 2023

Choose a reason for hiding this comment

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

Mhhh yes...

I wonder if the test will be done all on logs tho...

If we will check that then we might consider adding all the check on a shell script and just run it here.

But you are right if the intention is to add additional stuff then I think the current way of keep the master and worker split is the only way...

MAYBE I can split the get log part/generalize the command to run the container?

Copy link
Member

Choose a reason for hiding this comment

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

Well its actually very lame testing, but better then no testing.

In the long term I planned to look into labgrid's DockerStrategy and use that for more advanced QA, the similar approach could be then re-used for SDK/ImageBuilder/rootfs container testing in the openwrt/docker repository etc.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could keep it as it is proposed now and improve later (tm)

Copy link
Member

@ynezz ynezz Nov 14, 2023

Choose a reason for hiding this comment

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

buildbot.errors.PluginDBError: Requirements are not satisfied for buildbot.www:base: The 'zope-interface>=5' distribution was not found and is required by Twisted

Murphy's law? :P https://github.com/openwrt/buildbot/actions/runs/6867270540/job/18678271015#step:5:51

(BTW its not caused by this PR)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I notice the same while testing this pr. Thing it's there from a lot :(

Copy link
Member Author

Choose a reason for hiding this comment

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

About Murphy's law... I had to rerun the test as for some reason the github instance lost connection ahahaha

- container_flavor: worker
container_test_command: "--env BUILDWORKER_NAME=X --env BUILDWORKER_PASSWORD=Y"
container_verify_string: "worker configured in /builder"

steps:
- name: Checkout
Expand All @@ -76,21 +79,12 @@ jobs:
BUILDBOT_VERSION=${{ env.BUILDBOT_VERSION }}
OPENWRT_VERSION=${{ env.GIT_SHA_SHORT }}

- name: Test master Docker container
if: matrix.container_flavor == 'master'
- name: Test ${{ matrix.container_flavor }} Docker container
run: |
docker run --detach --name test-master local/master
docker run --detach ${{ matrix.container_test_command }} --name test-${{ matrix.container_flavor }} local/${{ matrix.container_flavor }}
sleep 5
docker logs test-master | tee master.log
grep "buildmaster configured in /master" master.log

- name: Test worker Docker container
if: matrix.container_flavor == 'worker'
run: |
docker run --detach --env BUILDWORKER_NAME=X --env BUILDWORKER_PASSWORD=Y --name test-worker local/worker
sleep 5
docker logs test-worker | tee worker.log
grep "worker configured in /builder" worker.log
docker logs test-${{ matrix.container_flavor }} | tee ${{ matrix.container_flavor }}.log
grep "${{ matrix.container_verify_string }}" ${{ matrix.container_flavor }}.log

- name: Docker meta
id: meta
Expand Down