Skip to content
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

feat: Add bs fra score cron #31

Closed
wants to merge 15 commits into from
231 changes: 0 additions & 231 deletions .github/workflows/molecule.yml

This file was deleted.

84 changes: 84 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
def lastCephVersion = "18.2.1"
def legacyBranch="d9bef03f7166d263bfa9059b869de0d7e867015e" //"v2.2.0"
def fsid = "${UUID.randomUUID().toString()}"
def operatingSystems = ['ubuntu2004', 'ubuntu2204']
def previousCephVersions = ['16.2.14', '17.2.7']
def scenarios = ['ha', 'aio']
def testcase = ['general', 'adopt']

def integrationJobs = [:]
// Test for all non-last version install and upgrade to latest
previousCephVersions.each { cephVersion ->
scenarios.each { scenario ->
integrationJobs["ubuntu2004-${cephVersion}-${scenario}-with-upgrade"] = {
node('jammy-2c-8g') {
checkout scm
sh 'sudo apt-get purge -y snapd'
sh 'sudo apt-get install -y git python3-pip docker.io'
sh 'sudo pip install -r requirements.txt'
withEnv([
"MOLECULE_CEPH_FSID=${fsid}",
"MOLECULE_CEPH_VERSION=${cephVersion}",
"MOLECULE_DISTRO=ubuntu2004"
]) {
sh "sudo molecule test -s ${scenario}"
}
withEnv([
"MOLECULE_CEPH_FSID=${fsid}",
"MOLECULE_CEPH_VERSION=${lastCephVersion}",
"MOLECULE_DISTRO=ubuntu2004"
]) {
sh "sudo molecule converge -s ${scenario}"
sh "sudo molecule verify -s ${scenario}"
}
}
}
}
}
// Test latest version
operatingSystems.each { operatingSystem ->
scenarios.each { scenario ->
integrationJobs["${operatingSystem}-${lastCephVersion}-${scenario}-latest"] = {
node('jammy-2c-8g') {
checkout scm
sh 'sudo apt-get purge -y snapd'
sh 'sudo apt-get install -y git python3-pip docker.io'
sh 'sudo pip install -r requirements.txt'
withEnv([
"MOLECULE_CEPH_FSID=${fsid}",
"MOLECULE_CEPH_VERSION=${lastCephVersion}",
"MOLECULE_DISTRO=${operatingSystem}"
]) {
sh "sudo molecule test -s ${scenario}"
}
}
}
}
}

// Test for previous versions with adopt
previousCephVersions.each { cephVersion ->
integrationJobs["ubuntu2004-${cephVersion}-ha-adopt-legacy"] = {
node('jammy-16c-64g') {
checkout scm
sh "git checkout ${legacyBranch}"
sh 'sudo apt-get purge -y snapd'
sh 'sudo apt-get install -y git python3-pip docker.io'
sh 'sudo pip install -r requirements.txt'
withEnv([
"MOLECULE_CEPH_FSID=${fsid}",
"MOLECULE_CEPH_VERSION=${cephVersion}",
"MOLECULE_DISTRO=ubuntu2004"
]) {
sh "sudo molecule converge -s ha"
sh "sudo molecule verify -s ha"
checkout scm
sh 'sudo pip install -r requirements.txt'
sh "sudo molecule converge -s ha"
sh "sudo molecule verify -s ha"
}
}
}
}

parallel integrationJobs
3 changes: 2 additions & 1 deletion molecule/ceph/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
become: true
tasks:
- name: Get cluster health status
ansible.builtin.command: cephadm shell -- ceph health
ansible.builtin.command: |
cephadm --image "{{ cephadm_image | default('quay.io/ceph/ceph:v' + (ceph_version | default('18.2.1'))) }}" shell -- ceph health
register: _ceph_health

- name: Print cluster health status
Expand Down
2 changes: 2 additions & 0 deletions roles/cephadm_host/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ cephadm_host_labels: []

ceph_mon_public_network: "{{ ceph_public_network | default('0.0.0.0/0') }}"
ceph_mon_cluster_network: "{{ ceph_cluster_network | default(ceph_mon_public_network) }}"

cephadm_image: "quay.io/ceph/ceph:v{{ ceph_version | default('18.2.1') }}"
20 changes: 13 additions & 7 deletions roles/cephadm_host/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
run_once: true
changed_when: false
delegate_to: "{{ cephadm_host_admin_host }}"
ansible.builtin.command: cephadm shell -- ceph cephadm get-pub-key
ansible.builtin.command: |
cephadm --image "{{ cephadm_image }}" shell
--fsid "{{ ceph_mon_fsid }}"
--config "/var/lib/ceph/{{ ceph_mon_fsid }}/mon.{{ hostvars[cephadm_host_admin_host]['inventory_hostname_short'] }}/config"
-- ceph cephadm get-pub-key
register: cephadm_host_public_key_command

- name: Set fact with public SSH key for "cephadm" user
Expand All @@ -39,9 +43,11 @@
- name: Add new host to Ceph
changed_when: false
delegate_to: "{{ cephadm_host_admin_host }}"
ansible.builtin.command:
cmd: |
cephadm shell -- ceph orch host add
{{ inventory_hostname_short }}
{{ ansible_all_ipv4_addresses | ansible.utils.ipaddr(ceph_mon_public_network) | first }}
{% if cephadm_host_labels | length > 0 %}--labels={{ cephadm_host_labels | join(',') }}{% endif %}
ansible.builtin.command: |
cephadm --image "{{ cephadm_image }}" shell
--fsid "{{ ceph_mon_fsid }}"
--config "/var/lib/ceph/{{ ceph_mon_fsid }}/mon.{{ hostvars[cephadm_host_admin_host]['inventory_hostname_short'] }}/config"
-- ceph orch host add
{{ inventory_hostname_short }}
{{ ansible_all_ipv4_addresses | ansible.utils.ipaddr(ceph_mon_public_network) | first }}
{% if cephadm_host_labels | length > 0 %}--labels={{ cephadm_host_labels | join(',') }}{% endif %}
18 changes: 18 additions & 0 deletions roles/mgr/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 VEXXHOST, Inc.
#
# 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.

# Filesystem ID
ceph_mon_fsid: "{{ ceph_fsid }}"

cephadm_image: "quay.io/ceph/ceph:v{{ ceph_version | default('18.2.1') }}"
Loading
Loading