-
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
3
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
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
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,173 @@ | ||
| 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 | ||
| fresh-validation: | ||
| description: 'Use versions of cf-deployment from the develop branch' | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
|
|
||
| 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. | ||
| 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 | ||
| - name: Set kernel settings (Podman extras) | ||
| if: steps.check_changes.outputs.skip != 'true' && inputs.container-runtime == 'podman' | ||
| run: | | ||
| sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80 | ||
| # Mount BPF filesystem on the host (required by Cilium) | ||
| 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: Use develop versions of cf-deployment | ||
| id: pre_validation | ||
| if: steps.check_changes.outputs.skip != 'true' && inputs.fresh-validation == true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| pip3 install -r scripts/requirements.txt | ||
| python3 scripts/sync-cf-deployment-versions.py --ref develop | ||
| - 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 -n cf-system -l app.kubernetes.io/name=cloud-controller -o wide | ||
| kubectl get pod -n cf-system -l app.kubernetes.io/name=cloud-controller -o jsonpath='{.status.containerStatuses[*].state}' | jq | ||
| kubectl logs -n cf-system -l app.kubernetes.io/name=cloud-controller --all-containers=true | ||
| echo "===== CC_WORKER =====" | ||
| kubectl get pod -n cf-system -l app.kubernetes.io/name=cc-worker -o wide | ||
| kubectl logs -n cf-system -l app.kubernetes.io/name=cc-worker | ||
| echo "===== CC_UPLOADER =====" | ||
| kubectl get pod -n cf-system -l app=cc-uploader -o wide | ||
| kubectl logs -n cf-system -l app=cc-uploader | ||
| echo "===== CC_DEPLOYMENT_UPDATER =====" | ||
| kubectl get pod -n cf-system -l app.kubernetes.io/name=cc-deployment-updater -o wide | ||
| kubectl logs -n cf-system -l app.kubernetes.io/name=cc-deployment-updater | ||
| echo "===== CC_WORKER_CLOCK =====" | ||
| kubectl get pod -n cf-system -l app.kubernetes.io/name=cc-worker-clock -o wide | ||
| kubectl logs -n cf-system -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
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| caCert: "" | ||
| caKey: "" | ||
| tlsCert: "" | ||
| tlsKey: "" | ||
| tlsKey: "" |
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?
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.
Yes, still needed. This CI job runs on Docker (ubuntu-latest) and is unchanged from before this PR. The step loads the NFS kernel modules and raises
fs.inotify.max_user_instanceswhich Docker requires for the test run.