From b595b2bc844408311c8577c29814d67076fa1836 Mon Sep 17 00:00:00 2001 From: Akos Eros Date: Wed, 9 Sep 2026 10:27:40 +0200 Subject: [PATCH 1/2] feat: add playwright and cromium browser with dependencies --- Containerfile | 8 +++++--- requirements.txt | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index 1b3863a..c09c4c3 100644 --- a/Containerfile +++ b/Containerfile @@ -21,7 +21,7 @@ LABEL org.opencontainers.image.title="${TITLE}" \ description="${DESCRIPTION}" ARG COLLECTIONS_TO_REMOVE="fortinet cisco dellemc f5networks junipernetworks mellanox netapp" -ARG DNF_TO_REMOVE="dejavu-sans-fonts langpacks-core-font-en langpacks-core-en langpacks-en" +ARG DNF_TO_REMOVE='' ARG RPM_TO_FORCEFULLY_REMOVE="cracklib-dicts" # Versions ARG OPENSHIFT_CLIENT_VERSION="4.20.14" @@ -38,6 +38,7 @@ ARG HELM_SECRETS_VERSION="4.7.5" # command ARG PYTHON_VERSION="3.11" ARG PYTHON_PKGS="python${PYTHON_VERSION} python${PYTHON_VERSION}-pip python3-pip" +ARG PLAYWRIGHT_PKGS="atk at-spi2-atk cups-libs libdrm libxkbcommon libxcb libXcomposite libXdamage libXext libXfixes libXrandr libgbm pango alsa-lib nss nspr expat" # amd64 - arm64 ARG TARGETARCH @@ -84,8 +85,8 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1 ENV HELM_PLUGINS=/etc/helm-plugins -RUN microdnf --disableplugin=subscription-manager install -y make git-core tar vi jq which findutils diffutils sshpass gzip ${PYTHON_PKGS} $EXTRARPMS && \ -microdnf remove -y $DNF_TO_REMOVE && \ +RUN microdnf --disableplugin=subscription-manager install -y make git-core tar vi jq which findutils diffutils sshpass gzip ${PYTHON_PKGS} ${PLAYWRIGHT_PKGS} $EXTRARPMS && \ +if [ -n "$DNF_TO_REMOVE" ]; then microdnf remove -y $DNF_TO_REMOVE; fi && \ rpm -e --nodeps $RPM_TO_FORCEFULLY_REMOVE && \ microdnf clean all && \ rm -rf /var/cache/dnf && \ @@ -102,6 +103,7 @@ chown root:root /usr/local/bin/* && chmod 755 /usr/local/bin/* && \ rm -rf /root/anaconda* /root/original-ks.cfg /usr/local/README && \ pip install --no-cache-dir --no-compile -r /tmp/requirements.txt && \ ansible-galaxy collection install --collections-path /usr/share/ansible/collections -r /tmp/requirements.yml && \ +playwright install --only-shell chromium && \ # Create ansible-playbook wrapper that sets ANSIBLE_STDOUT_CALLBACK to rhvp.cluster_utils.readable when it's "null" \ mv /usr/local/bin/ansible-playbook /usr/local/bin/ansible-playbook.orig && \ mv /tmp/ansible-playbook-wrapper.sh /usr/local/bin/ansible-playbook && \ diff --git a/requirements.txt b/requirements.txt index cf798b3..573d5ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,5 @@ awscli>=1.22 azure-cli>=2.34 gcloud pytest +pytest-playwright vp-qe-test-common @ git+https://github.com/validatedpatterns/vp-qe-test-common.git@v1#egg=vp-qe-test-common From b9769d30f6e0e9eb202c25b3ab34bfbdda9ce87d Mon Sep 17 00:00:00 2001 From: Akos Eros Date: Tue, 15 Sep 2026 16:20:28 +0200 Subject: [PATCH 2/2] feat: improve doc generating --- .github/linters/.jscpd.json | 3 + .github/workflows/superlinter.yml | 3 + .markdownlintignore | 1 + Makefile | 75 +++++++++++-------------- README.md | 87 +++++++++++++---------------- README.tpl.md | 93 +++++++++++++++++++++++++++++++ 6 files changed, 172 insertions(+), 90 deletions(-) create mode 100644 .github/linters/.jscpd.json create mode 100644 .markdownlintignore create mode 100644 README.tpl.md diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json new file mode 100644 index 0000000..bef7e85 --- /dev/null +++ b/.github/linters/.jscpd.json @@ -0,0 +1,3 @@ +{ + "ignore": ["**/README.tpl.md"] +} diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index 694d644..7e3cdb6 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -13,3 +13,6 @@ jobs: with: sl_env: | VALIDATE_TRIVY=false + VALIDATE_JSON_PRETTIER=false + VALIDATE_MARKDOWN_PRETTIER=false + VALIDATE_NATURAL_LANGUAGE=false diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 0000000..e8a7227 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1 @@ +README.tpl.md diff --git a/Makefile b/Makefile index 2a1d8f0..f083e69 100644 --- a/Makefile +++ b/Makefile @@ -75,48 +75,43 @@ test-arm64: ## Prints the test of most tools inside the container arm64 .PHONY: test test: test-amd64 test-arm64 ## Tests the container for all the required bits both arm64 and amd64 -##@ Run and upload tasks -.PHONY: versions -versions: ## Print all the versions of software in the locally-built container - @podman run --rm -it --net=host \ +VERSION ?=$(shell git describe --tags --abbrev=0 2>/dev/null || echo "N/A") +.PHONY: gen-docs +gen-docs: ## Print all the versions of software in the locally-built container + @echo "Extracting versions and updating README.md..." + @SOFTWARE_MANIFEST=$$(podman run --rm --net=host \ --security-opt label=disable \ -v ${HOME}:/pattern \ -v ${HOME}:${HOME} \ - -w $$(pwd) "${REGISTRY}/${CONTAINER}-amd64" sh -c \ - "set -e; \ - echo -n \"|sshpass package \"; rpm -q --queryformat '%{VERSION}' sshpass; echo \" \"; \ - echo -n \"|python3-pip package \"; rpm -q --queryformat '%{VERSION}' python3-pip; echo \" \"; \ - echo -n \"|git-core package \"; rpm -q --qf '%{VERSION}' git-core; echo \" \"; \ - echo -n \"|vi package \"; rpm -q --qf '%{VERSION}' vim-minimal; echo \" \"; \ - echo -n \"|tar package \"; rpm -q --qf '%{VERSION}' tar; echo \" \"; \ - echo -n \"|gzip package \"; rpm -q --qf '%{VERSION}' gzip; echo \" \"; \ - echo -n \"|make package \"; rpm -q --qf '%{VERSION}' make; echo \" \"; \ - echo -n \"|python package \"; /usr/bin/python3 --version | sed -e s'/Python //' | tr -d '\n'; echo \" \"; \ - echo -n \"|jq package \"; rpm -q --qf '%{VERSION}' jq; echo \" \"; \ - echo -n \"|age binary \"; age --version |tr -d '\n'; echo \" \"; \ - echo -n \"|helm binary \"; helm version --template '{{ .Version }}'; echo \" \"; \ - echo -n \"|helmsecrets binary \"; helm plugin list |grep ^secrets | tr '[:blank:]' ' '| cut -f2 -d\ | tr -d '\n'; echo \" \"; \ - echo -n \"|tea binary \"; tea --version | sed -e 's/Version: //' | sed -e 's/golang.*//' | tr -d '\t' | tr -d '\n'; echo \" \"; \ - echo -n \"|openshift binary \"; oc version --client -o json | jq -j '.releaseClientVersion'; echo \" \"; \ - echo -n \"|kustomize binary \"; oc version --client -o json | jq -j '.kustomizeVersion'; echo \" \"; \ - echo -n \"|pytest pip \"; pip show pytest | grep ^Version | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|ansible pip \"; ansible --version -o json | grep core | cut -f3 -d\ | tr -d '\n]'; echo \" \"; \ - echo -n \"|kubernetes pip \"; pip show kubernetes |grep ^Version: | cut -f2 -d\ | tr -d '\n'; echo \" \"; \ - echo -n \"|boto3 pip \"; pip show boto3 | grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|botocore pip \"; pip show botocore | grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|awscli pip \"; pip show awscli | grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|azure-cli pip \"; pip show azure-cli | grep ^Version: | cut -f2 -d\ | tr -d '\n'; echo \" \"; \ - echo -n \"|gcloud pip \"; pip show gcloud| grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|jmespath pip \"; pip show jmespath| grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|ansible-runner pip \"; pip show ansible-runner| grep ^Version: | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|vp-qe-test-common pip \"; pip show vp-qe-test-common | grep ^Version: | cut -f2 -d\ | tr -d '\n'; echo \" \"; \ - echo -n \"|kubernetes.core collection \"; ansible-galaxy collection list kubernetes.core |grep ^kubernetes.core | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|community.okd collection \"; ansible-galaxy collection list community.okd |grep ^community.okd | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|community.general collection \"; ansible-galaxy collection list community.general |grep ^community.general | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|ansible.posix collection \"; ansible-galaxy collection list ansible.posix |grep ^ansible.posix | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|ansible.utils collection \"; ansible-galaxy collection list ansible.utils |grep ^ansible.utils | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - echo -n \"|rhvp.cluster_utils collection \"; ansible-galaxy collection list rhvp.cluster_utils |grep ^rhvp.cluster_utils | cut -f2 -d\ |tr -d '\n'; echo \" \"; \ - " | sort | column --table -o '|' + -w $$(pwd) "${REGISTRY}/${CONTAINER}-amd64" sh -c " \ + set -e; \ + for pkg in sshpass python3-pip git-core jq tar gzip make vim-minimal; do \ + echo \"\$$pkg package \$$(rpm -q --queryformat '%{VERSION}' \$$pkg )\"; \ + done; \ + for pip_pkg in \$$(awk -F'[=>@#]' '{print \$$1}' requirements.txt | xargs); do \ + [ -z \"\$$pip_pkg\" ] && continue; \ + echo \"\$$pip_pkg pip \$$(pip show \$$pip_pkg | awk '/^Version:/ {print \$$2}')\"; \ + done; \ + for coll in \$$(yq '.collections[].name' requirements.yml 2>/dev/null); do \ + echo \"\$$coll collection \$$(ansible-galaxy collection list \$$coll 2>/dev/null | grep \"^\$$coll\" | awk '{print \$$2}')\"; \ + done; \ + echo \"python package \$$(/usr/bin/python3 --version 2>/dev/null | awk '{print \$$2}')\"; \ + echo \"age binary \$$(age --version 2>/dev/null)\"; \ + echo \"helm binary \$$(helm version --template '{{ .Version }}' 2>/dev/null)\"; \ + echo \"helmsecrets binary \$$(helm plugin list 2>/dev/null | awk '/^secrets/ {print \$$2}')\"; \ + echo \"tea binary \$$(tea --version 2>/dev/null | awk '/^Version:/ {print \$$2}')\"; \ + echo \"openshift binary \$$(oc version --client -o json 2>/dev/null | jq -j '.releaseClientVersion')\"; \ + echo \"kustomize binary \$$(oc version --client -o json 2>/dev/null | jq -j '.kustomizeVersion')\"; \ + echo \"ansible pip \$$(ansible --version -o json 2>/dev/null | grep core | awk '{print \$$3}' | tr -d '\"],')\"; \ + " | sed -e 's/\x1b\[[0-9;]*m//g' | sort | awk '{print "| " $$1 " | " $$2 " | " $$3 " |"}'); \ + \ + awk -v version="$(VERSION)" -v table="$$SOFTWARE_MANIFEST" ' \ + { \ + gsub(/__VERSION__/, version); \ + gsub(/__SOFTWARE_TABLE__/, table); \ + print; \ + }' README.tpl.md > README.md + .PHONY: run run: ## Runs the container interactively @@ -135,8 +130,6 @@ super-linter: ## Runs super linter locally -e VALIDATE_DOCKERFILE_HADOLINT=false \ -e VALIDATE_JSON_PRETTIER=false \ -e VALIDATE_MARKDOWN_PRETTIER=false \ - -e VALIDATE_MARKDOWN_PRETTIER=false \ - -e VALIDATE_NATURAL_LANGUAGE=false \ -e VALIDATE_PYTHON_PYLINT=false \ -e VALIDATE_SHELL_SHFMT=false \ -e VALIDATE_TRIVY=false \ diff --git a/README.md b/README.md index aa72063..221f8b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Validated Patterns Utility Container -![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) +![Version: v1.0.5 ](https://img.shields.io/badge/Version-v1.0.5-informational?style=flat-square) [![Quay Repository](https://img.shields.io/badge/Quay.io-utility--container-blue?logo=quay)](https://quay.io/repository/validatedpatterns/utility-container) [![CI Pipeline](https://github.com/validatedpatterns/utility-container/actions/workflows/docker-publish.yml/badge.svg?branch=main)](https://github.com/validatedpatterns/utility-container/actions/workflows/docker-publish.yml) @@ -12,54 +12,43 @@ This container provides a pre-configured environment with all the necessary tool ## Installed Software - - -| name | type | version | -| :---------------------------------: | :---------: | :-------------: | -| age | binary | 1.3.1 | -| ansible | pip | 2.19.6 | -| ansible.posix | collection | 2.1.0 | -| ansible-runner | pip | 2.4.2 | -| ansible.utils | collection | 6.0.1 | -| argocd | binary | v3.1.12+a46152e | -| awscli | pip | 1.44.39 | -| awx.awx | collection | 24.6.1 | -| awxkit | pip | 24.6.1 | -| azure-cli | pip | 2.83.0 | -| boto3 | pip | 1.42.49 | -| botocore | pip | 1.42.49 | -| community.general | collection | 12.3.0 | -| community.okd | collection | 5.0.0 | -| gcloud | pip | 0.18.3 | -| gh | package | 2.86.0 | -| git-core | package | 2.47.3 | -| gzip | package | 1.12 | -| hcp | binary | 4.17.0 | -| helm | binary | v3.19.5 | -| helm-secrets | helm plugin | 4.7.5 | -| infra.ah_configuration | collection | 2.1.0 | -| infra.controller_configuration | collection | 3.2.2 | -| infra.eda_configuration | collection | 1.1.0 | -| jmespath | pip | 1.1.0 | -| jq | package | 1.6 | -| kubernetes.core | collection | 6.3.0 | -| kubernetes | pip | 35.0.0 | -| kustomize | binary | v5.6.0 | -| make | package | 4.3 | -| openshift | binary | 4.20.14 | -| pytest | pip | 9.0.2 | -| python3-pip | package | 21.3.1 | -| python | package | 3.11.13 | -| redhat_cop.controller_configuration | collection | 2.3.1 | -| rhvp.cluster_utils | collection | 1.1.0 | -| sshpass | package | 1.09 | -| tar | package | 1.34 | -| tea | binary | 0.9.2 | -| tekton | binary | 0.35.2 | -| vi | package | 8.2.2637 | -| vp-qe-test-common | pip | 0.0.1 | - - +| name | type | version | +| :--- | :--- | :--- | +| age | binary | v1.3.1 | +| amazon.aws | collection | 11.4.0 | +| ansible-core | pip | 2.18.19 | +| ansible | pip | 2.18.19 | +| ansible.posix | collection | 2.2.2 | +| ansible-runner | pip | 2.4.3 | +| ansible.utils | collection | 6.1.0 | +| awscli | pip | 1.46.1 | +| azure-cli | pip | 2.90.0 | +| boto3 | pip | 1.43.94 | +| botocore | pip | 1.43.94 | +| community.general | collection | 13.4.0 | +| community.okd | collection | 6.0.0 | +| gcloud | pip | 0.18.3 | +| git-core | package | 2.52.0 | +| gzip | package | 1.12 | +| helm | binary | v3.19.5 | +| helmsecrets | binary | 4.7.5 | +| jq | package | 1.6 | +| kubernetes.core | collection | 6.5.0 | +| kubernetes | pip | 35.0.0 | +| kustomize | binary | v5.6.0 | +| make | package | 4.3 | +| openshift | binary | 4.20.14 | +| openshift | pip | 0.13.2 | +| pytest | pip | 9.1.1 | +| pytest-playwright | pip | 0.9.0 | +| python3-pip | package | 21.3.1 | +| python | package | 3.11.13 | +| rhvp.cluster_utils | collection | 1.1.0 | +| sshpass | package | 1.09 | +| tar | package | 1.34 | +| tea | binary | 0.9.2 | +| vim-minimal | package | 8.2.2637 | +| vp-qe-test-common | pip | 0.0.1 | ## Usage diff --git a/README.tpl.md b/README.tpl.md new file mode 100644 index 0000000..114fc09 --- /dev/null +++ b/README.tpl.md @@ -0,0 +1,93 @@ +# Validated Patterns Utility Container + +![Version: __VERSION__ ](https://img.shields.io/badge/Version-__VERSION__-informational?style=flat-square) +[![Quay Repository](https://img.shields.io/badge/Quay.io-utility--container-blue?logo=quay)](https://quay.io/repository/validatedpatterns/utility-container) +[![CI Pipeline](https://github.com/validatedpatterns/utility-container/actions/workflows/docker-publish.yml/badge.svg?branch=main)](https://github.com/validatedpatterns/utility-container/actions/workflows/docker-publish.yml) + +A utility container for simplified execution of imperative commands in each of the Validated Patterns. + +## Overview + +This container provides a pre-configured environment with all the necessary tools and dependencies for working with Validated Patterns. It includes Ansible, Kubernetes tools, cloud CLIs, and other utilities commonly needed for pattern deployment and management. + +## Installed Software + +| name | type | version | +| :--- | :--- | :--- | +__SOFTWARE_TABLE__ + +## Usage + +### Pull the Image + +```bash +podman pull quay.io/validatedpatterns/utility-container:latest +``` + +### Examples + +**Interactive shell** + +```bash +podman run --rm -it --net=host \ + --security-opt label=disable \ + -v ${HOME}:/pattern \ + -v ${HOME}:${HOME} \ + -w $(pwd) \ + quay.io/validatedpatterns/utility-container:latest sh +``` + +**Execute an Ansible playbook** + +```bash +podman run --rm -it --net=host \ + --security-opt label=disable \ + -v ${HOME}:/pattern \ + -v ${HOME}:${HOME} \ + -w $(pwd) \ + quay.io/validatedpatterns/utility-container:latest \ + ansible-playbook .yml +``` + +**Run OpenShift commands** + +```bash +podman run --rm -it --net=host \ + --security-opt label=disable \ + -v ${HOME}:/pattern \ + -v ${HOME}:${HOME} \ + -w $(pwd) \ + quay.io/validatedpatterns/utility-container:latest \ + oc get nodes +``` + +## Troubleshooting + +**Permission issues with volume mounts** + +- Ensure the `--security-opt label=disable` flag is used when running the container. +- Check that your user has read/write access to the mounted directories. + +**Network connectivity issues** + +- Use `--net=host` for full network access. +- For restricted environments, configure appropriate network policies. + +**Missing tools or outdated versions** + +- Check the installed software table above for current versions. +- Consider building a custom image if you need different tool versions. + +## Development + +### Build the Image + +Run `make build` to build both amd64 and arm64 architectures locally (requires qemu-user-static package). + +### Upload to Registry + +Run `make upload` to push the image to the official repository. + +### Contributing + +To update software versions or add new tools, modify the Containerfile and update the software table in this readme. Use `make versions` to generate the software versions table from the container after building locally.