Skip to content

Commit 4ace418

Browse files
fitbeardmnaser
andauthored
feat: switch to binary runc and containerd install (#333)
* feat: switch to binary runc and containerd install * fix: always download directly to dst node * feat: add crictl role * ci: add tests for binary downloads * ci: rename scenario and add matrix * ci: move to using prepare * ci: stop using anchors * chore: refactor to download_artifact * chore: add jammy to containerd+runc * chore: bump ansible-lint * chore: add more platforms for cri * fix: ensure tar command exists * chore: drop amznlinux2 --------- Co-authored-by: Mohammed Naser <[email protected]>
1 parent b343523 commit 4ace418

File tree

50 files changed

+845
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+845
-137
lines changed

.ansible-lint

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ exclude_paths:
1010
warn_list:
1111
- jinja[invalid]
1212
- jinja[spacing]
13-
- name[casing]
14-
- template-instead-of-copy
15-
- yaml[line-length]

.github/workflows/containerd.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) 2023 VEXXHOST, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
name: containerd
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- molecule/containerd/**
21+
- roles/defaults/**
22+
- roles/runc/**
23+
- roles/binary_download/**
24+
- roles/containerd/**
25+
- roles/crictl/**
26+
push:
27+
branches:
28+
- main
29+
paths:
30+
- molecule/containerd/**
31+
- roles/defaults/**
32+
- roles/runc/**
33+
- roles/binary_download/**
34+
- roles/containerd/**
35+
- roles/crictl/**
36+
37+
jobs:
38+
test:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
distro:
43+
- debian10
44+
- debian11
45+
- fedora36
46+
- fedora37
47+
- rockylinux8
48+
- rockylinux9
49+
- ubuntu2004
50+
- ubuntu2204
51+
steps:
52+
- name: Checkout project
53+
uses: actions/checkout@v3
54+
55+
- name: Install Poetry
56+
run: pipx install poetry
57+
58+
- name: Setup Python
59+
uses: actions/setup-python@v4
60+
with:
61+
cache: poetry
62+
63+
- name: Install dependencies
64+
run: poetry install --no-interaction --with dev
65+
66+
- name: Run Molecule
67+
run: poetry run molecule test -s containerd
68+
env:
69+
MOLECULE_DISTRO: ${{ matrix.distro }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- commit-msg
1616

1717
- repo: https://github.com/ansible/ansible-lint
18-
rev: v6.8.6
18+
rev: v6.13.1
1919
hooks:
2020
- id: ansible-lint
2121
files: \.(yaml|yml)$

galaxy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ dependencies:
1414
community.general: 4.5.0
1515
kubernetes.core: 2.3.2
1616
openstack.cloud: 1.7.0
17+
tags:
18+
- application
19+
- cloud
20+
- infrastructure
21+
- linux
22+
- monitoring
23+
- storage
24+
- tools
1725
repository: https://github.com/vexxhost/atmosphere
1826
documentation: https://github.com/vexxhost/atmosphere/tree/main/docs
1927
homepage: https://github.com/vexxhost/atmosphere

meta/runtime.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
requires_ansible: ">=2.11"
2+
requires_ansible: ">=2.13.4"

molecule/containerd/converge.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2023 VEXXHOST, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
- name: Converge
16+
hosts: all
17+
become: true
18+
roles:
19+
- vexxhost.atmosphere.containerd
20+
- vexxhost.atmosphere.crictl

molecule/containerd/molecule.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2023 VEXXHOST, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
dependency:
16+
name: galaxy
17+
driver:
18+
name: docker
19+
platforms:
20+
- name: instance
21+
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest
22+
command: ${MOLECULE_DOCKER_COMMAND:-""}
23+
privileged: true
24+
cgroupns_mode: host
25+
pre_build_image: true
26+
volumes:
27+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
28+
provisioner:
29+
name: ansible
30+
verifier:
31+
name: ansible

molecule/containerd/prepare.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2023 VEXXHOST, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
- name: Prepare
16+
hosts: all
17+
become: true
18+
pre_tasks:
19+
- name: Wait for systemd to complete initialization
20+
ansible.builtin.command: systemctl is-system-running
21+
register: systemctl_status
22+
until: >
23+
'running' in systemctl_status.stdout or
24+
'degraded' in systemctl_status.stdout
25+
retries: 30
26+
delay: 5
27+
changed_when: false
28+
failed_when: systemctl_status.rc > 1

molecule/containerd/verify.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2023 VEXXHOST, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
- name: Verify
16+
hosts: all
17+
become: true
18+
19+
pre_tasks:
20+
- name: Gather service facts
21+
service_facts:
22+
23+
tasks:
24+
- name: Make sure containerd service is running
25+
ansible.builtin.assert:
26+
that:
27+
- ansible_facts.services['containerd.service'].state in ['active', 'running']
28+
29+
- name: Make sure containerd service is enabled
30+
ansible.builtin.assert:
31+
that:
32+
- ansible_facts.services['containerd.service'].status == 'enabled'
33+
34+
- name: Pull image from registry
35+
ansible.builtin.command: ctr image pull docker.io/library/alpine:latest
36+
37+
- name: List images
38+
ansible.builtin.command: ctr images ls
39+
register: images
40+
failed_when: not(images.stdout.find('alpine') != -1)

roles/ceph_mgr/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
- name: install packages
15+
- name: Install packages
1616
ansible.builtin.apt:
1717
name: ["ceph-mgr"]
1818
install_recommends: false
1919

20-
- name: create manager folder
20+
- name: Create manager folder
2121
ansible.builtin.file:
2222
path: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}"
2323
state: directory
2424
owner: ceph
2525
group: ceph
26-
mode: 0700
26+
mode: "0700"
2727

2828
- name: Create Ceph manager keyring
2929
vexxhost.atmosphere.ceph_key:
@@ -36,14 +36,14 @@
3636
owner: ceph
3737
group: ceph
3838

39-
- name: ensure permissions are fixed
39+
- name: Ensure permissions are fixed
4040
ansible.builtin.file:
4141
path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}"
4242
owner: ceph
4343
group: ceph
4444
recurse: true
4545

46-
- name: enable and start service
46+
- name: Enable and start service
4747
ansible.builtin.service:
4848
name: "ceph-mgr@{{ inventory_hostname_short }}"
4949
state: started

0 commit comments

Comments
 (0)