Skip to content

Commit

Permalink
Merge pull request #236 from AkihiroSuda/cirrus
Browse files Browse the repository at this point in the history
CI: switch away from GHA to Cirrus CI
  • Loading branch information
AkihiroSuda authored Jul 8, 2021
2 parents 0af586e + 8c74798 commit e0965f9
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 73 deletions.
63 changes: 63 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# We use Vagrant to prepare cgroup v2 env.

compute_engine_instance:
image_project: cirrus-images
image: family/docker-kvm
platform: linux
nested_virtualization: true
# CPU limit: `16 / NTASK`: see https://cirrus-ci.org/faq/#are-there-any-limits
cpu: 8
# Memory limit: `4GB * NCPU`
memory: 32G

task_template: &TASK_TEMPLATE
timeout_in: 30m
env:
DEBIAN_FRONTEND: noninteractive
HOME: /root
DOCKER_BUILDKIT: 1
info_script:
- uname -a
- cat /proc/cpuinfo
- docker info
build_script:
- make
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:
fingerprint_script: uname -s ; cat Vagrantfile
folder: /root/.vagrant.d
vagrant_up_script:
- vagrant up
# <FIXME>
# Enabling cgroup delegation seems to need rebooting since Fedora 34: https://github.com/rootless-containers/rootlesscontaine.rs/issues/32
# We shouldn't need this reboot.
vagrant_reboot_script:
- vagrant halt
- vagrant up
# </FIXME>
vagrant_ssh_config_script:
- mkdir -p -m 0700 /root/.ssh
- vagrant ssh-config >> /root/.ssh/config

single_node_task:
<< : *TASK_TEMPLATE
name: "Single node"
containerd_test_script:
- ssh default /vagrant/hack/smoketest-binaries.sh --cri=containerd
crio_test_script:
- ssh default /vagrant/hack/smoketest-binaries.sh --cri=crio

multi_node_task:
<< : *TASK_TEMPLATE
name: "Multi node with Flannel (Docker Compose)"
install_docker_script:
- ssh default sudo dnf install -y moby-engine docker-compose make
- ssh default sudo usermod -aG docker vagrant
- ssh default sudo systemctl enable --now docker
load_image_script:
- docker save ghcr.io/rootless-containers/usernetes:latest | ssh default docker load
compose_test_script:
- ssh default /vagrant/hack/smoketest-docker-compose.sh
70 changes: 0 additions & 70 deletions .github/workflows/main.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ _test:
up: image _up

_up:
docker-compose up -d
docker-compose --project-name=usernetes up -d
docker run --rm -v usernetes_tls-master:/a busybox timeout 60 sh -c "until test -f /a/done; do sleep 1; echo \"waiting for /a/done\"; done"
mkdir -p $(HOME)/.config/usernetes
docker run --rm -v usernetes_tls-master:/a busybox sh -c "until test -f /a/done; do sleep 1; done; cat /a/admin-localhost.kubeconfig" > $(HOME)/.config/usernetes/docker-compose.kubeconfig
docker run --rm -v usernetes_tls-master:/a busybox cat /a/admin-localhost.kubeconfig > $(HOME)/.config/usernetes/docker-compose.kubeconfig
echo "To use kubectl: export KUBECONFIG=$(HOME)/.config/usernetes/docker-compose.kubeconfig"

down:
docker-compose down -v -t 0
docker-compose --project-name=usernetes down -v -t 0
rm -f $(HOME)/.config/usernetes/docker-compose.kubeconfig

artifact: binaries _artifact
Expand Down

0 comments on commit e0965f9

Please sign in to comment.