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 and enable non-authorized container registry #8813

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions .github/workflows/acceptance_tests_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
UYUNI_PROJECT: uyuni-project
UYUNI_VERSION: master
NO_AUTH_REGISTRY: no_auth_registry
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
jobs:
paths-filter:
Expand Down Expand Up @@ -65,8 +66,8 @@ jobs:
run: ./testsuite/podman_runner/01_setup_tmp_dirs.sh
- name: create-podman-network
run: ./testsuite/podman_runner/02_setup_network.sh
- name: start_controller
run: ./testsuite/podman_runner/03_run_controller.sh
- name: start_controller_and_registry
run: ./testsuite/podman_runner/03_run_controller_and_registry.sh
- name: create_ssh_conf
run: ./testsuite/podman_runner/04_setup_ssh_controller.sh
- name: install_gems_in_controller
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/build_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,33 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-and-push-registry-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ci-container-registry

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./testsuite/dockerfiles/container-registry/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions testsuite/dockerfiles/container-registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM registry:2

4 changes: 3 additions & 1 deletion testsuite/features/secondary/min_docker_api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@
# - features/secondary/buildhost_docker_build_image.feature
# - features/secondary/buildhost_docker_auth_registry.feature

@skip_if_github_validation
@skip_if_cloud
@scope_building_container_images
@no_auth_registry
Feature: API "image" namespace for containers and sub-namespaces

Scenario: Test "image.store" namespace
When I create and delete an image store via API
And I list image store types and image stores via API
And I set and get details of image store via API

@scc_credentials
Scenario: Test "image.profiles" namespace
When I create and delete profiles via API
And I create and delete profile custom values via API
And I list image profiles via API
And I set and get profile details via API

@scc_credentials
Scenario: Cleanup: remove custom system info
Given I am authorized for the "Admin" section
When I follow the left menu "Systems > Custom System Info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: Advanced content management
And I enter "docker_admin" as "label"
And I enter the URI of the registry as "uri"
And I click on "create-btn"

@scc_credentials
Scenario: Create a profile as Docker admin
When I follow the left menu "Images > Profiles"
And I follow "Create"
Expand Down Expand Up @@ -43,6 +43,7 @@ Feature: Advanced content management
Scenario: Log in as docker user
Given I am authorized as "docker" with password "docker"

@scc_credentials
Scenario: Cleanup: remove Docker profile
Given I am authorized as "docker" with password "docker"
When I follow the left menu "Images > Profiles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Feature: CVE audit for content management
Then I should see a "bunch was scheduled" text
And I wait until the table contains "FINISHED" or "SKIPPED" followed by "FINISHED" in its first rows

@scc_credentials
Scenario: Audit images, searching for a known CVE number
When I follow the left menu "Audit > CVE Audit"
And I select "1999" from "cveIdentifierYear"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ set -ex
src_dir=$(cd $(dirname "$0")/../.. && pwd -P)

sudo -i podman run --rm -d --network network -v /tmp/testing:/tmp --name controller -h controller -v ${src_dir}/testsuite:/testsuite ghcr.io/$UYUNI_PROJECT/uyuni/ci-test-controller-dev:$UYUNI_VERSION
sudo -i podman run --rm -d --network network --name $NO_AUTH_REGISTRY -h $NO_AUTH_REGISTRY ghcr.io/$UYUNI_PROJECT/uyuni/ci-container-registry:$UYUNI_VERSION

sudo podman ps
2 changes: 1 addition & 1 deletion testsuite/podman_runner/12_run_core_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -xe
sudo -i podman exec controller bash -c "export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && rake cucumber:github_validation_core"
sudo -i podman exec controller bash -c "export NO_AUTH_REGISTRY=${NO_AUTH_REGISTRY} && export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && rake cucumber:github_validation_core"
2 changes: 1 addition & 1 deletion testsuite/podman_runner/17_run_init_clients_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -xe
sudo -i podman exec controller bash -c "export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && rake cucumber:github_validation_init_clients"
sudo -i podman exec controller bash -c "export NO_AUTH_REGISTRY=${NO_AUTH_REGISTRY} && export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && rake cucumber:github_validation_init_clients"
2 changes: 1 addition & 1 deletion testsuite/podman_runner/18_run_secondary_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -xe
sudo -i podman exec controller bash -c "export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && export TAGS=\"\\\"not @flaky\\\"\" && cd /testsuite && rake cucumber:secondary"
sudo -i podman exec controller bash -c "export NO_AUTH_REGISTRY=${NO_AUTH_REGISTRY} && export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && export TAGS=\"\\\"not @flaky\\\"\" && cd /testsuite && rake cucumber:secondary"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -xe
sudo -i podman exec controller bash -c "zypper ref && zypper -n install expect"
sudo -i podman exec controller bash -c "export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && export TAGS=\"\\\"not @flaky\\\"\" && cd /testsuite && rake cucumber:secondary_parallelizable"
sudo -i podman exec controller bash -c "export NO_AUTH_REGISTRY=${NO_AUTH_REGISTRY} && export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && export TAGS=\"\\\"not @flaky\\\"\" && cd /testsuite && rake cucumber:secondary_parallelizable"
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ then
exit 1
fi

sudo -i podman exec controller bash -c "export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && export TAGS=\"\\\"not @flaky\\\"\" && rake cucumber:secondary_parallelizable_${1}"
sudo -i podman exec controller bash -c "export NO_AUTH_REGISTRY=${NO_AUTH_REGISTRY} && export CUCUMBER_PUBLISH_TOKEN=${CUCUMBER_PUBLISH_TOKEN} && export PROVIDER=podman && export SERVER=server && export HOSTNAME=controller && export SSH_MINION=opensusessh && export MINION=sle_minion && export RHLIKE_MINION=rhlike_minion && cd /testsuite && export TAGS=\"\\\"not @flaky\\\"\" && rake cucumber:secondary_parallelizable_${1}"
3 changes: 2 additions & 1 deletion testsuite/podman_runner/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

export UYUNI_PROJECT=uyuni-project
export UYUNI_VERSION=master
export NO_AUTH_REGISTRY=no_auth_registry

set -x
set -e

./00_setup_env.sh
./01_setup_tmp_dirs.sh
./02_setup_network.sh
./03_run_controller.sh
./03_run_controller_and_registry.sh
./04_setup_ssh_controller.sh
./05_install_gems_in_controller.sh
./06_collect_and_tag_flaky_tests_in_controller.sh
Expand Down
Loading