Skip to content

Commit

Permalink
Remove testing using docker
Browse files Browse the repository at this point in the history
The container image test is already covered by the podman tests.

- Remove testing the container image using docker.
- Update the documentation accordingly
- Remove the "build-and-test" python script, previously used to build
  the docker image.
- Remove the now unused "report_info" python script.
- In places where the podman image is built, use the "build-image" make
  target.

close #378

Signed-off-by: mgoerens <[email protected]>
  • Loading branch information
mgoerens authored and komish committed Aug 2, 2023
1 parent 38653a5 commit 2125421
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 455 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,14 @@ jobs:
curl -sLO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz
tar zxvf openshift-client-linux.tar.gz oc
- name: Build the Image
working-directory: ./chart-verifier
id: build_image
run: |
# build a docker image
commit_sha=$(git rev-parse --short HEAD)
ve1/bin/build-and-test --image-name="quay.io/redhat-certification/chart-verifier" --sha-value=$commit_sha --build-only="True"}
- name: Build podman Image
working-directory: ./chart-verifier
id: build_podman_image
run: |
# build a podman image
# sudo apt install qemu-system-x86
commit_sha=$(git rev-parse --short HEAD)
image_tag="podman-"$commit_sha
echo "use image tag $image_tag"
image_tag="test"
echo "Building container image using podman for the tests, tagging as $image_tag"
make build-image IMAGE_TAG=$image_tag
podman build -t quay.io/redhat-certification/chart-verifier:$image_tag .
echo "podman_image_tag=$image_tag" | tee -a $GITHUB_OUTPUT
Expand Down Expand Up @@ -147,7 +138,6 @@ jobs:
working-directory: ./chart-verifier
env:
KUBECONFIG: /tmp/ci-kubeconfig
VERIFIER_IMAGE_TAG: ${{ steps.build_image.outputs.verifier-image-tag }}
VERIFIER_TARBALL_NAME : ${{ steps.create-tarfile.outputs.tarball_full_name }}
PODMAN_IMAGE_TAG : ${{ steps.build_podman_image.outputs.podman_image_tag }}
id: run_test
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/dev_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,19 @@ jobs:
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd ..
cd scripts && ../ve1/bin/python3 setup.py install && cd ..
- name: Create image
id: build-image
run: ve1/bin/build-and-test --image-name="quay.io/redhat-certification/chart-verifier" --sha-value=$DEV_RELEASE --build-only="True"}
- name: Build container images
id: build_container_images
run: |
# Build podman images locally
make build-image IMAGE_TAG=$DEV_RELEASE
- name: Login to Registry
id: login-as-bot
uses: docker/login-action@v2
if: ${{ steps.build-image.outcome == 'success'}}
- name: Push to quay.io
id: push_to_quay
uses: redhat-actions/push-to-registry@v2
with:
registry: quay.io
image: chart-verifier
tags: |
$DEV_RELEASE
registry: quay.io/redhat-certification
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}

- name: Push Image
if: ${{ steps.login-as-bot.outcome == 'success' }}
run: |
docker push quay.io/redhat-certification/chart-verifier:$DEV_RELEASE
19 changes: 6 additions & 13 deletions docs/helm-chart-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,13 @@ Chart verifier - release creation is automated through a GitHub workflow. To cre
- The submitter has approval authority for the repository.
- All tests pass.

1. After merging the PR and creating the release the workflow continues in an attempt to add the ```latest``` tag to the new chart verifier image in quay. This may take a while.

- When the release is created, quay will detect the release and build a docker image for the release.
- see [chart verifier image tags in quay](https://quay.io/repository/redhat-certification/chart-verifier?tab=tags)
- The workflow retries for up to 15 minutes for the docker image to appear in quay so that it can be linked. If this fails it can be done manually:
1. Navigate to the [chart verifier image tags in quay](https://quay.io/repository/redhat-certification/chart-verifier?tab=tags)
1. For the new image hit the options icon on the far right
1. A drop down list appears, select "add a new tag"
1. A dialogue appears, enter the new tag name as "latest"
1. Quay detects latest is laready in use, select "Move" so it points to the new release.

1. After the PR is merged, the "release.yaml" workflow runs and create the GitHub release along with all its assets:

- A container image is built and pushed to Quay under two tags: ```latest``` and one corresponding to the version number (```x.y.z``` without leading ```v``).
- A tarball is created and attached to the GitHub release.

Notes:
- To link the image to the ```latest``` tag in quay an auth token is required. This must be set as a repository secret "QUAY_AUTH_TOKEN"
- To push the images to Quay, an auth token is required. This must be set as a repository secret "QUAY_AUTH_TOKEN"
- For information on creating an auth token see: [Red Hat Quay API guide](https://access.redhat.com/documentation/en-us/red_hat_quay/3/html/red_hat_quay_api_guide/using_the_red_hat_quay_api)
- The workflow uses the [ChartVerfifierReleaser OAuth Applictaion](https://quay.io/organization/redhat-certification?tab=applications).
- If the application auth token is changed for any reason the repository secret must also be updated.

6 changes: 0 additions & 6 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@

- ```release/versionchecker.py```
- used to determine if a PR contains a version update.
- ```buildandtest/buildandtest.py```
- used to build a docker image and then test created image.
- ```report/report-info.py```
- used to generate of report of a chart verifier verify report.
- exact copy of same script from chart repo
- ```https://github.com/openshift-helm-charts/charts/blob/main/scripts/src/report/report_info.py```
1 change: 0 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ six==1.16.0
smmap==4.0.0
toml==0.10.2
urllib3==1.26.5
docker==5.0.0
six==1.16.0
retry==0.9.2
1 change: 0 additions & 1 deletion scripts/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ where = src
console_scripts =
release-checker = release.releasechecker:main
print-release-body = release.releasebody:main
build-and-test = buildandtest.buildandtest:main
check-user = owners.checkuser:main
sa-for-chart-testing = saforcharttesting.saforcharttesting:main
tar-file = release.tarfile_asset:main
Empty file.
143 changes: 0 additions & 143 deletions scripts/src/buildandtest/buildandtest.py

This file was deleted.

Empty file removed scripts/src/report/__init__.py
Empty file.
94 changes: 0 additions & 94 deletions scripts/src/report/report_info.py

This file was deleted.

10 changes: 4 additions & 6 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ Tests are basic and test good charts only:

Each chart is verified as partner, redhat and community. A report summary, of the verifier report created, is obtained for each chart and the content is compared to expected content.

This amounts to 6 tests. These 6 tests are then run on 3 image types:
- chart-verifier docker image
This amounts to 6 tests. These 6 tests are then run on 2 image types:
- chart-verifier podman image
- chart-verifier binary image

As a result there are 18 tests.
As a result there are 12 tests.

## Signed chart tests

Expand All @@ -28,12 +27,11 @@ And to enable verification of the chart a public key file is included which cont

The chart is verified as partner and redhat. A report summary, of the verifier report created, is obtained for the chart and the content is compared to expected content.

This amounts to 2 tests. These 2 tests are then run on 3 image types:
- chart-verifier docker image
This amounts to 2 tests. These 2 tests are then run on 2 image types:
- chart-verifier podman image
- chart-verifier binary image

As a result there are 6 tests.
As a result there are 4 tests.

### Signing the chart

Expand Down
Loading

0 comments on commit 2125421

Please sign in to comment.