-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Add Podman support as drop-in replacement for Docker #360
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
Open
ZPascal
wants to merge
2
commits into
cloudfoundry:main
Choose a base branch
from
ZPascal:add-podman-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Some comments aren't visible on the classic Files Changed page.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| name: Smoke Run (reusable) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| container-runtime: | ||
| description: 'Container runtime to use (docker or podman)' | ||
| type: string | ||
| required: true | ||
| install-optional-components: | ||
| description: 'Whether to install optional CF components' | ||
| type: string | ||
| required: true | ||
| artifact-name: | ||
| description: 'Name of the uploaded test report artifact' | ||
| type: string | ||
| required: true | ||
|
|
||
| jobs: | ||
| smoke-run: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Check if only ignored paths changed | ||
| id: check_changes | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
| CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) | ||
| RELEVANT_FILES=$(echo "$CHANGED_FILES" | grep -v -E '.*\.Dockerfile|^releases/.*/files/|^\.github/|^docs/|\.md$|^renovate\.json$' || true) | ||
| if [ -z "$RELEVANT_FILES" ]; then | ||
| echo "Only ignored paths were changed. Skipping workflow." | ||
| echo "skip=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "skip=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| else | ||
| echo "skip=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Pin nip.io domains to localhost | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: | | ||
| # nip.io is an external DNS service; CI runners sometimes can't resolve it. | ||
| # Hardcode the CF domains so DNS never leaves the machine. | ||
| printf '127.0.0.1 api.127-0-0-1.nip.io\n127.0.0.1 uaa.127-0-0-1.nip.io\n127.0.0.1 login.127-0-0-1.nip.io\n127.0.0.1 apps.127-0-0-1.nip.io\n127.0.0.1 doppler.127-0-0-1.nip.io\n127.0.0.1 log-stream.127-0-0-1.nip.io\n' | sudo tee -a /etc/hosts | ||
| - name: Set kernel settings | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: | | ||
| sudo sysctl -w fs.inotify.max_user_instances=512 | ||
| sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80 | ||
| - name: Set kernel settings (Podman extras) | ||
| if: steps.check_changes.outputs.skip != 'true' && inputs.container-runtime == 'podman' | ||
| run: | | ||
| # Mount BPF filesystem on the host (needed by kindnet on some kernels) | ||
| sudo mount bpffs /sys/fs/bpf -t bpf -o nosuid,nodev,noexec,relatime || true | ||
| - name: Install podman-compose | ||
| if: steps.check_changes.outputs.skip != 'true' && inputs.container-runtime == 'podman' | ||
| run: | | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y podman-compose | ||
| # Ensure podman-compose is used instead of the docker-compose plugin shim | ||
| sudo ln -sf /usr/bin/podman-compose /usr/local/bin/podman-compose | ||
| - name: Install dependencies | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: | | ||
| mkdir -p $HOME/.local/bin && echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
| curl -L https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-amd64 -o $HOME/.local/bin/kind | ||
| chmod +x $HOME/.local/bin/kind | ||
| curl -L https://github.com/helmfile/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_${HELMFILE_VERSION}_linux_amd64.tar.gz | tar -zx | ||
| mv helmfile $HOME/.local/bin/helmfile | ||
| curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=${CF_CLI_VERSION}&source=github" | tar -zx | ||
| mv cf8 $HOME/.local/bin/cf | ||
| env: | ||
| # renovate: dataSource=github-releases depName=cloudfoundry/cli | ||
| CF_CLI_VERSION: "8.18.3" | ||
| # renovate: dataSource=github-releases depName=kubernetes-sigs/kind | ||
| KIND_VERSION: "0.32.0" | ||
| # renovate: dataSource=github-releases depName=helmfile/helmfile | ||
| HELMFILE_VERSION: "1.5.3" | ||
| - name: Run make up | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: make up | ||
| env: | ||
| CONTAINER_RUNTIME: ${{ inputs.container-runtime }} | ||
| INSTALL_OPTIONAL_COMPONENTS: ${{ inputs.install-optional-components }} | ||
| - name: Login | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: make login | ||
| - name: Init | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| run: make bootstrap-complete | ||
| - name: setup CF tests | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| uses: ./.github/actions/setup-cf-tests | ||
| with: | ||
| test-repo: cf-smoke-tests | ||
| test-branch: main | ||
| config-template: ./.github/smoke-config.tpl | ||
| config-output: ./.github/smoke-config.json | ||
| - name: run smoke test | ||
| if: steps.check_changes.outputs.skip != 'true' | ||
| env: | ||
| CONFIG: "${{ github.workspace }}/.github/smoke-config.json" | ||
| GINKGO_NO_COLOR: "true" | ||
| run: | | ||
| ./cf-smoke-tests/bin/test --no-color --github-output --timeout=30m --procs=4 --json-report report.json | ||
| - name: debug events | ||
| if: failure() | ||
| run: kubectl get events -A --sort-by='.lastTimestamp' | ||
| - name: debug cilium | ||
| if: failure() && inputs.container-runtime == 'podman' | ||
| run: | | ||
| echo "===== CILIUM PODS =====" | ||
| kubectl get pod -n kube-system -l k8s-app=cilium -o wide | ||
| echo "===== CILIUM AGENT LOGS (all pods) =====" | ||
| for pod in $(kubectl get pod -n kube-system -l k8s-app=cilium -o jsonpath='{.items[*].metadata.name}'); do | ||
| echo "--- $pod ---" | ||
| kubectl logs -n kube-system "$pod" --all-containers=true --previous 2>/dev/null || kubectl logs -n kube-system "$pod" --all-containers=true 2>/dev/null || true | ||
| done | ||
| echo "===== CILIUM OPERATOR LOGS =====" | ||
| kubectl logs -n kube-system -l name=cilium-operator --all-containers=true 2>/dev/null || true | ||
| echo "===== CILIUM STATUS =====" | ||
| kubectl exec -n kube-system $(kubectl get pod -n kube-system -l k8s-app=cilium -o jsonpath='{.items[0].metadata.name}' 2>/dev/null) -- cilium status 2>/dev/null || true | ||
| - name: debug pods | ||
| if: failure() | ||
| run: | | ||
| echo "===== CLOUD_CONTROLLER =====" | ||
| kubectl get pod -l app.kubernetes.io/name=cloud-controller -o wide | ||
| kubectl get pod -l app.kubernetes.io/name=cloud-controller -o jsonpath='{.status.containerStatuses[*].state}' | jq | ||
| kubectl logs -l app.kubernetes.io/name=cloud-controller --all-containers=true | ||
| echo "===== CC_WORKER =====" | ||
| kubectl get pod -l app.kubernetes.io/name=cc-worker -o wide | ||
| kubectl logs -l app.kubernetes.io/name=cc-worker | ||
| echo "===== CC_UPLOADER =====" | ||
| kubectl get pod -l app=cc-uploader -o wide | ||
| kubectl logs -l app=cc-uploader | ||
| echo "===== CC_DEPLOYMENT_UPDATER =====" | ||
| kubectl get pod -l app.kubernetes.io/name=cc-deployment-updater -o wide | ||
| kubectl logs -l app.kubernetes.io/name=cc-deployment-updater | ||
| echo "===== CC_WORKER_CLOCK =====" | ||
| kubectl get pod -l app.kubernetes.io/name=cc-worker-clock -o wide | ||
| kubectl logs -l app.kubernetes.io/name=cc-worker-clock | ||
| - name: debug pods (Podman extras) | ||
| if: failure() && inputs.container-runtime == 'podman' | ||
| run: | | ||
| echo "===== CF_TCP_ROUTER =====" | ||
| kubectl get pod -n cf-system -l app=cf-tcp-router -o wide | ||
| kubectl get pod -n cf-system -l app=cf-tcp-router -o jsonpath='{.items[*].status.containerStatuses[*].state}' | jq 2>/dev/null || true | ||
| kubectl logs -n cf-system -l app=cf-tcp-router --all-containers=true 2>/dev/null || true | ||
| echo "===== ROUTING_API =====" | ||
| kubectl get pod -n cf-system -l app=routing-api -o wide | ||
| kubectl logs -n cf-system -l app=routing-api --all-containers=true 2>/dev/null || true | ||
| - uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: ${{ inputs.artifact-name }} | ||
| path: ./cf-smoke-tests/report.json |
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,2 +1,3 @@ | ||
| temp/ | ||
| bin/ | ||
| .idea |
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,15 +1,45 @@ | ||
| LOCAL = true | ||
| TARGET_ARCH ?= $(if $(filter true,$(LOCAL)),$(shell go env GOARCH),amd64) | ||
| # renovate: dataSource=github-releases depName=helmfile/helmfile | ||
| HELMFILE_VERSION ?= "1.5.3" | ||
|
|
||
| # Build all images for the local architecture (arm64 on Apple Silicon, amd64 elsewhere). | ||
| # This ensures Go binaries like storage-cli are native – not run under Rosetta, | ||
| # which causes 'taggedPointerPack' panics with high memory addresses. | ||
| build: | ||
| @ . ./scripts/detect-runtime.sh; \ | ||
| if [ "$$CONTAINER_RUNTIME" = "podman" ]; then \ | ||
| echo "Building with Podman is not yet supported via docker-bake.hcl."; \ | ||
| echo "Use 'podman build' manually with the Dockerfiles in releases/."; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| docker buildx bake --file docker-bake.hcl --set "*.platform=linux/$(TARGET_ARCH)" $(BAKE_TARGETS) | ||
|
|
||
| init: temp/certs/ca.key temp/certs/ca.crt temp/certs/ssh_key temp/certs/ssh_key.pub temp/secrets.sh temp/secrets.env | ||
|
|
||
| temp/certs/ca.key temp/certs/ca.crt temp/certs/ssh_key temp/certs/ssh_key.pub temp/secrets.sh temp/secrets.env: | ||
| @ ./scripts/init.sh | ||
|
|
||
| install: | ||
| @ ./scripts/install.sh | ||
| @ . ./scripts/detect-runtime.sh; \ | ||
| if [ "$$IS_PODMAN" = "true" ]; then export SKIP_CILIUM="true"; fi; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| kind get kubeconfig --name cfk8s > temp/kubeconfig; \ | ||
| $$CONTAINER_RUNTIME run --rm --net=host --env-file temp/secrets.env \ | ||
| --env INSTALL_OPTIONAL_COMPONENTS \ | ||
| --env CILIUM_EXTRA_VALUES \ | ||
| --env SKIP_CILIUM \ | ||
| -v "$$PWD/temp/certs:/certs" -v "$$PWD/temp/kubeconfig:/helm/.kube/config:ro" -v "$$PWD:/wd" --workdir /wd ghcr.io/helmfile/helmfile:v$(HELMFILE_VERSION) helmfile sync | ||
|
|
||
| login: | ||
| @ . temp/secrets.sh; \ | ||
| curl --silent --show-error --fail --insecure --retry 9 --retry-delay 5 --retry-all-errors --output /dev/null "https://api.127-0-0-1.nip.io/v2/info"; \ | ||
| echo "API is ready. Logging in..."; \ | ||
| @ echo "Waiting for CF API to become ready..."; \ | ||
| for i in $$(seq 1 60); do \ | ||
| status=$$(curl -sk -o /dev/null -w "%{http_code}" https://api.127-0-0-1.nip.io/v2/info); \ | ||
| if [ "$$status" = "200" ]; then echo "CF API is ready."; break; fi; \ | ||
| echo " attempt $$i/60: HTTP $$status – retrying in 10s..."; \ | ||
| sleep 10; \ | ||
| done; \ | ||
| if [ "$$status" != "200" ]; then echo "ERROR: CF API did not become ready after 10 minutes." >&2; exit 1; fi; \ | ||
| . temp/secrets.sh; \ | ||
| cf login -a https://api.127-0-0-1.nip.io -u ccadmin -p "$$CC_ADMIN_PASSWORD" --skip-ssl-validation | ||
|
|
||
| create-kind: | ||
|
|
@@ -27,12 +57,12 @@ create-org: | |
| bootstrap: create-org | ||
| @ ./scripts/upload_buildpacks.sh | ||
|
|
||
| bootstrap-complete: create-org | ||
| bootstrap-complete: create-org | ||
| @ ALL_BUILDPACKS=true ./scripts/upload_buildpacks.sh | ||
|
|
||
| up: create-kind init install | ||
|
|
||
| down: delete-kind | ||
| @ rm -rf temp | ||
|
|
||
| PHONY: install login create-kind delete-kind up down create-org bootstrap bootstrap-complete | ||
| .PHONY: build install login create-kind delete-kind up down create-org bootstrap bootstrap-complete | ||
Oops, something went wrong.
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.
is this still needed for rootful Podman?