forked from containerd/containerd
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Vagrant-based tests from GitHub Actions to Cirrus CI
Cirrus CI supports nested virtualization and free to use from open source projects. runc has been using the service since opencontainers/runc#3088. Signed-off-by: Kazuyoshi Kato <[email protected]>
- Loading branch information
Showing
4 changed files
with
116 additions
and
32 deletions.
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Cirrus CI gives free 16.0 CPUs for open-source projects. We split that to 4:4:4. | ||
# https://cirrus-ci.org/faq/#are-there-any-limits | ||
# | ||
# Undocumented constraints; | ||
# - The maximum memory limit is 4G times the number of CPUs. | ||
# - The number of CPUs should be mutiple of 2. | ||
|
||
task: | ||
name: Vagrant | ||
|
||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-kvm | ||
platform: linux | ||
nested_virtualization: true | ||
cpu: 2 | ||
memory: 8G | ||
|
||
env: | ||
VAGRANT_EXPERIMENTAL: disks # https://www.vagrantup.com/docs/disks/usage | ||
HOME: /root | ||
matrix: | ||
BOX: fedora/35-cloud-base | ||
BOX: rockylinux/8 | ||
|
||
install_libvirt_vagrant_script: | | ||
apt-get update | ||
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt | ||
systemctl enable --now libvirtd | ||
vagrant_cache: | ||
folder: /root/.vagrant.d | ||
fingerprint_script: uname -a; cat Vagrantfile | ||
|
||
vagrant_up_script: | | ||
vagrant up --no-tty | ||
integration_script: | | ||
vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration | ||
cri_test_script: | | ||
vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-cri | ||
env_script: | | ||
uname -a | ||
df -h | ||
task: | ||
name: CGroupsV2 - rootless CRI test | ||
|
||
env: | ||
HOME: /root | ||
|
||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-kvm | ||
platform: linux | ||
nested_virtualization: true | ||
cpu: 2 | ||
memory: 8G | ||
|
||
install_libvirt_vagrant_script: | | ||
apt-get update | ||
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt | ||
systemctl enable --now libvirtd | ||
vagrant_cache: | ||
folder: /root/.vagrant.d | ||
fingerprint_script: uname -a; cat Vagrantfile | ||
|
||
vagrant_up_script: | | ||
vagrant up --provision-with=install-rootless-podman --no-tty | ||
podman_build_script: | | ||
# Execute rootless podman to create the UserNS env | ||
vagrant ssh -- podman build --target cri-in-userns -t cri-in-userns -f /vagrant/contrib/Dockerfile.test /vagrant | ||
test_script: | | ||
vagrant ssh -- podman run --rm --privileged cri-in-userns |
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright The containerd Authors. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -eu -o pipefail | ||
|
||
df_line=$(df / | grep '^/dev/') | ||
if [[ df_line =~ '/dev/([a-z]+)([0-9]+)' ]]; then | ||
dev="${BASH_REMATCH[1]}" | ||
part="${BASH_REMATCH[2]}" | ||
growpart "/dev/$dev" "$part" | ||
xfs_growfs -d "/dev/$dev$part" | ||
else | ||
echo "Failed to parse $df_line" | ||
exit 1 | ||
fi |