-
Notifications
You must be signed in to change notification settings - Fork 10
update: validation #24
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| ARG BASEIMAGE=registry.fedoraproject.org/fedora:latest | ||
| FROM ${BASEIMAGE} | ||
| FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 | ||
|
|
||
| RUN source /etc/os-release && \ | ||
| if [ "${PLATFORM_ID}" == "platform:el9" ]; then dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; fi && \ | ||
| if [ "${PLATFORM_ID}" == "platform:el10" ]; then dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm; fi | ||
| RUN microdnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ | ||
| microdnf install -y python3 python3-configargparse python3-kubernetes && \ | ||
| microdnf clean all | ||
|
|
||
| RUN dnf install -y python3-configargparse python3-kubernetes python3-pip python3-build | ||
| COPY llmd_xks_preflight.py /opt/llmd-xks-preflight/ | ||
|
|
||
| COPY . /root/src | ||
| RUN python3 -m build /root/src -w -o /root/src && python3 -m pip install --no-deps /root/src/*.whl && rm -rf /root/src | ||
| RUN useradd -r -u 1001 -g 0 preflight | ||
| USER 1001 | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/llmd-xks-preflight"] | ||
| ENTRYPOINT ["python3", "/opt/llmd-xks-preflight/llmd_xks_preflight.py"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,62 @@ | ||
| # Configurable settings | ||
| MAX_LINE_LENGTH ?= 120 | ||
| CONTAINER_REPO ?= localhost/llmd-xks-checks | ||
| CONTAINER_TAG ?= latest | ||
| CONTAINER_TOOL ?= podman | ||
| CONTAINER_TOOL ?= $(shell command -v podman >/dev/null 2>&1 && echo podman || echo docker) | ||
| HOST_KUBECONFIG ?= ~/.kube/config | ||
| FROM ?= registry.fedoraproject.org/fedora:latest | ||
|
|
||
| .PHONY: help container run push lint pep8-fix | ||
| # SUITE can be set to "cluster" or "operators", defaults to "all" | ||
| SUITE ?= all | ||
|
|
||
| # SELinux label for volume mounts (only needed for podman) | ||
| VOLUME_OPTS ?= $(shell [ "$(CONTAINER_TOOL)" = "podman" ] && echo ":ro,Z" || echo ":ro") | ||
|
|
||
| # CONFIG can be set to a config file path to mount into the container | ||
| CONFIG ?= | ||
| # Config mount and argument (only if CONFIG is set) | ||
| CONFIG_MOUNT ?= $(if $(CONFIG),--volume $(CONFIG):/tmp/config.conf$(VOLUME_OPTS),) | ||
| CONFIG_ARG ?= $(if $(CONFIG),--config /tmp/config.conf,) | ||
|
|
||
| .PHONY: help image run push lint pep8-fix | ||
|
|
||
| help: | ||
| @echo "Available targets:" | ||
| @echo " container Build a container image from the current directory" | ||
| @echo " run Run the container image with all tests" | ||
| @echo " run-cluster Run the container image with cluster readiness tests" | ||
| @echo " run-operators Run the container image with operators readiness tests" | ||
| @echo " push Push the container image to the container registry" | ||
| @echo " image Build a container image from the current directory" | ||
| @echo " run Run the image with tests (use SUITE=cluster|operators|all)" | ||
| @echo " push Push the image to the container registry" | ||
| @echo " lint Check code for PEP8 compliance" | ||
| @echo " pep8-fix Automatically fix PEP8 compliance issues" | ||
| @echo "" | ||
| @echo "Configuration settings (all can be overridden by using environment variables):" | ||
| @echo " MAX_LINE_LENGTH=$(MAX_LINE_LENGTH) Python linter line length" | ||
| @echo " CONTAINER_REPO=$(CONTAINER_REPO) Container repository tag to use for build and run" | ||
| @echo " CONTAINER_TAG=$(CONTAINER_TAG) Container tag to use for build and run" | ||
| @echo " CONTAINER_TOOL=$(CONTAINER_TOOL) Container tool to use for build and run" | ||
| @echo " HOST_KUBECONFIG=$(HOST_KUBECONFIG) Path to kubeconfig for container run" | ||
| @echo " FROM=$(FROM) Base image to use for the container build" | ||
| @echo " SUITE=$(SUITE) Test suite to run (all, cluster, operators)" | ||
| @echo " CONFIG=$(CONFIG) Path to config file to mount into the container" | ||
|
|
||
|
|
||
| # Build a container image from the current directory | ||
| container: | ||
| $(CONTAINER_TOOL) build $(FROM:%=--build-arg BASEIMAGE=%) --tag $(CONTAINER_REPO):$(CONTAINER_TAG) . | ||
| image: | ||
| $(CONTAINER_TOOL) build --tag $(CONTAINER_REPO):$(CONTAINER_TAG) . | ||
|
|
||
| # Run the container image with all tests | ||
| # Run the container image with tests | ||
| run: | ||
| $(CONTAINER_TOOL) run --rm -it --volume $(HOST_KUBECONFIG):/root/.kube/config:ro,Z $(CONTAINER_REPO):$(CONTAINER_TAG) | ||
|
|
||
| # Run the container image with cluster readiness tests | ||
| run-cluster: | ||
| $(CONTAINER_TOOL) run --rm -it --volume $(HOST_KUBECONFIG):/root/.kube/config:ro,Z $(CONTAINER_REPO):$(CONTAINER_TAG) -s cluster | ||
|
|
||
| # Run the container image with operators readiness tests | ||
| run-operators: | ||
| $(CONTAINER_TOOL) run --rm -it --volume $(HOST_KUBECONFIG):/root/.kube/config:ro,Z $(CONTAINER_REPO):$(CONTAINER_TAG) -s operators | ||
| $(CONTAINER_TOOL) run --rm -it --volume $(HOST_KUBECONFIG):/tmp/kubeconfig$(VOLUME_OPTS) $(CONFIG_MOUNT) -e KUBECONFIG=/tmp/kubeconfig $(CONTAINER_REPO):$(CONTAINER_TAG) -s $(SUITE) $(CONFIG_ARG) | ||
|
|
||
|
|
||
| # Push the container image to the container registry | ||
| push: | ||
| $(CONTAINER_TOOL) push $(CONTAINER_REPO):$(CONTAINER_TAG) | ||
|
|
||
| # Linting settings | ||
| MAX_LINE_LENGTH ?= 120 | ||
|
|
||
| # Check code for PEP8 compliance | ||
| lint: | ||
| @command -v flake8 >/dev/null 2>&1 || pip install flake8 | ||
| flake8 --max-line-length=$(MAX_LINE_LENGTH) --exclude=build . | ||
|
|
||
| # Automatically fix PEP8 compliance issues | ||
| pep8-fix: | ||
| @command -v autopep8 >/dev/null 2>&1 || pip install autopep8 | ||
| autopep8 --max-line-length=$(MAX_LINE_LENGTH) --in-place --recursive . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale
cloud_providertest entry in the Validations table (Line 67).The
cloud_providerrow is still listed as a test under "Suite: cluster" in the Validations section (line 67), but this PR removes it from theself.tests["cluster"]dict in the Python script. Users reading this doc will expect acloud_providerPASSED/FAILED result that will never appear. Consider removing or updating that row to clarify it's automatic detection during initialization, not a reported test.🤖 Prompt for AI Agents