-
Notifications
You must be signed in to change notification settings - Fork 97
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
Build provider in kairos and bring tests #1592
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b241ffc
Build provider in kairos and bring tests
Itxaka d48d2f0
Rename the go.mod to kairos-tests
Itxaka 4b4620e
Add provider labels to tests
Itxaka 40b034b
Run provider tests in kairos
Itxaka ac12565
fix earthly target
Itxaka e68aa94
Fix provider install, bundle the luet config with the image
Itxaka 0afea44
Fix iso download for provider test
Itxaka a5c6841
Fix label test for provider
Itxaka 2f8b903
Debug
Itxaka 9dfb930
Fix register
Itxaka b89b55c
ACTUALLY fix the test you dumb
Itxaka 9aff74b
Rework earthfile to set OSRELEASE args properly
Itxaka 970584f
Drop uneeded args
Itxaka 2ba5b2b
Download proper release for latest upgrade
Itxaka 7d0289f
iDo not repeat tests
Itxaka 651b974
Point to main for the PRVIDER_INSTALL command
Itxaka 2e3d6d0
Allow register function to reboot the machine
Itxaka d551f87
Run provider tests only on master
Itxaka de9a768
Merge branch 'master' into provider-kairos
Itxaka a7b7d78
Update tests/assets/kubernetes_logs.sh
Itxaka 3e4366d
Remove duplicated space removal
Itxaka 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 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 |
---|---|---|
|
@@ -179,6 +179,86 @@ jobs: | |
run: | | ||
docker tag quay.io/kairos/core-${{ matrix.flavor }}:latest ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:24h | ||
docker push ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}:24h | ||
build-provider: | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # OIDC support | ||
contents: write | ||
actions: read | ||
security-events: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: | ||
- "opensuse-leap" | ||
- "alpine-opensuse-leap" | ||
steps: | ||
- name: Release space from worker | ||
run: | | ||
echo "Listing top largest packages" | ||
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) | ||
head -n 30 <<< "${pkgs}" | ||
echo | ||
df -h | ||
echo | ||
sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true | ||
sudo apt-get remove --auto-remove android-sdk-platform-tools || true | ||
sudo apt-get purge --auto-remove android-sdk-platform-tools || true | ||
sudo rm -rf /usr/local/lib/android | ||
sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true | ||
sudo rm -rf /usr/share/dotnet | ||
sudo apt-get remove -y '^mono-.*' || true | ||
sudo apt-get remove -y '^ghc-.*' || true | ||
sudo apt-get remove -y '.*jdk.*|.*jre.*' || true | ||
sudo apt-get remove -y 'php.*' || true | ||
sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true | ||
sudo apt-get remove -y '^google-.*' || true | ||
sudo apt-get remove -y azure-cli || true | ||
sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true | ||
sudo apt-get remove -y '^gfortran-.*' || true | ||
sudo apt-get autoremove -y | ||
sudo apt-get clean | ||
echo | ||
echo "Listing top largest packages" | ||
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr) | ||
head -n 30 <<< "${pkgs}" | ||
echo | ||
sudo rm -rfv build || true | ||
df -h | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
git fetch --prune --unshallow | ||
- name: setup-docker | ||
uses: docker-practice/actions-setup-docker@master | ||
- name: Release space from worker | ||
run: | | ||
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android | ||
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET | ||
- name: Install earthly | ||
uses: Luet-lab/luet-install-action@v1 | ||
with: | ||
repository: quay.io/kairos/packages | ||
packages: utils/earthly | ||
- name: Build PR 🔧 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
FLAVOR: ${{ matrix.flavor }} | ||
IMAGE: ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}-provider:24h | ||
run: | | ||
earthly +ci --SECURITY_SCANS=false --IMAGE=$IMAGE --FLAVOR=$FLAVOR --PROVIDER_KAIROS=true | ||
sudo mv build/* . | ||
sudo rm -rf build | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: kairos-${{ matrix.flavor }}-provider.iso.zip | ||
path: | | ||
*.iso | ||
*.sha256 | ||
if-no-files-found: error | ||
- name: Push to testing | ||
run: | | ||
docker push ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}-provider:24h | ||
build-framework: | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
needs: | ||
|
@@ -723,3 +803,124 @@ jobs: | |
run: | | ||
export ISO=$PWD/$(ls *.iso) | ||
.github/encryption-tests.sh | ||
|
||
provider-tests: | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
runs-on: self-hosted | ||
needs: | ||
- build-provider | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
matrix: | ||
label: | ||
- "provider-qrcode-install" | ||
- "provider-upgrade" | ||
- "provider-decentralized-k8s" | ||
- "provider-upgrade-k8s" | ||
flavor: | ||
- "opensuse-leap" | ||
- "alpine-opensuse-leap" | ||
exclude: # looks like only the k8s stuff is tested on both flavors | ||
- label: "provider-qrcode-install" | ||
flavor: "alpine-opensuse-leap" | ||
- label: "provider-upgrade" | ||
flavor: "alpine-opensuse-leap" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: tests/go.mod | ||
cache-dependency-path: tests/go.sum | ||
- name: Install deps | ||
run: | | ||
# install qemu-system-x86_64 and qemu-img | ||
sudo apt update | ||
sudo apt install -y qemu-system-x86 qemu-utils qemu-kvm acl | ||
|
||
# Allow the "runner" user to access /dev/kvm | ||
# Might not be the best solution but adding to the kvm group didn't work | ||
# https://askubuntu.com/a/1081326 | ||
sudo setfacl -m u:runner:rwx /dev/kvm | ||
- name: Install earthly | ||
uses: Luet-lab/luet-install-action@v1 | ||
with: | ||
repository: quay.io/kairos/packages | ||
packages: utils/earthly | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: kairos-${{ matrix.flavor }}-provider.iso.zip | ||
- name: Run tests | ||
env: | ||
USE_QEMU: true | ||
KVM: true | ||
MEMORY: 4000 | ||
CPUS: 2 | ||
DRIVE_SIZE: 30000 | ||
CONTAINER_IMAGE: ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}-provider:24h | ||
run: | | ||
export ISO=$PWD/$(ls *.iso) | ||
cp tests/go.* . | ||
go run github.com/onsi/ginkgo/v2/ginkgo -v --label-filter "${{ matrix.label }}" --fail-fast -r ./tests/ | ||
|
||
provider-tests-upgrade-latest: | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
runs-on: self-hosted | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
matrix: | ||
label: | ||
- "provider-upgrade-latest-k8s-with-kubernetes" | ||
flavor: | ||
- "opensuse-leap" | ||
- "alpine-opensuse-leap" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: tests/go.mod | ||
cache-dependency-path: tests/go.sum | ||
- name: Install deps | ||
run: | | ||
# install qemu-system-x86_64 and qemu-img | ||
sudo apt update | ||
sudo apt install -y qemu-system-x86 qemu-utils qemu-kvm acl | ||
|
||
# Allow the "runner" user to access /dev/kvm | ||
# Might not be the best solution but adding to the kvm group didn't work | ||
# https://askubuntu.com/a/1081326 | ||
sudo setfacl -m u:runner:rwx /dev/kvm | ||
- name: Install earthly | ||
uses: Luet-lab/luet-install-action@v1 | ||
with: | ||
repository: quay.io/kairos/packages | ||
packages: utils/earthly | ||
- uses: actions/checkout@v3 | ||
- name: Download artifacts | ||
uses: robinraju/[email protected] | ||
with: | ||
latest: true | ||
repository: "kairos-io/provider-kairos" | ||
fileName: "kairos-${{ matrix.flavor }}-*v1.25*.iso" | ||
- name: Run tests | ||
env: | ||
USE_QEMU: true | ||
KVM: true | ||
MEMORY: 4000 | ||
CPUS: 2 | ||
DRIVE_SIZE: 30000 | ||
CONTAINER_IMAGE: ttl.sh/kairos-${{ matrix.flavor }}-${{ github.sha }}-provider:24h | ||
run: | | ||
export ISO=$PWD/$(ls *.iso) | ||
cp tests/go.* . | ||
go run github.com/onsi/ginkgo/v2/ginkgo -v --label-filter "${{ matrix.label }}" --fail-fast -r ./tests/ |
This file contains 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.
not a big deal, but should we move together with the other Release space?
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.
woops, didnt even noticed