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

Add support for CentOS8 to linchpin #1595

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion config/Dockerfiles/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env.SLAVE_TAG = env.SLAVE_TAG ?: 'stable-' + env.ghprbTargetBranch
env.FEDORA30_TAG = env.FEDORA30_TAG ?: 'stable-' + env.ghprbTargetBranch
env.FEDORA31_TAG = env.FEDORA31_TAG ?: 'stable-' + env.ghprbTargetBranch
env.CENTOS7_TAG = env.CENTOS7_TAG ?: 'stable-' + env.ghprbTargetBranch
env.CENTOS8_TAG = env.CENTOS8_TAG ?: 'stable-' + env.ghprbTargetBranch

DOCKER_REPO_URL = env.DOCKER_REPO_URL ?: '172.30.254.79:5000'
// if LINCHPIN_PROVIDERS is defined in jenkins global
Expand All @@ -37,6 +38,7 @@ executionID = UUID.randomUUID().toString()

// Pod name to use
c7podName = 'lp_centos7-' + executionID
c8podName = 'lp_centos8-' + executionID
f30podName = 'lp_fedora30-' + executionID
f31podName = 'lp_fedora31-' + executionID

Expand Down Expand Up @@ -83,6 +85,9 @@ properties(
string(defaultValue: 'stable-' + env.ghprbTargetBranch,
description: 'Tag for centos7 image',
name: 'CENTOS7_TAG'),
string(defaultValue: 'stable-' + env.ghprbTargetBranch,
description: 'Tag for centos8 image',
name: 'CENTOS8_TAG'),
string(description: 'Providers to be tested',
name: 'TEST_PROVIDERS')
]
Expand Down Expand Up @@ -130,6 +135,39 @@ stage('Tests') {
{
execute_test(c7podName, "centos7")
}
}, "centos8" : {
pipelineUtils.clearTemplateNames()
podTemplate(name: c8podName,
label: c8podName,
cloud: 'openshift',
serviceAccount: OPENSHIFT_SERVICE_ACCOUNT,
idleMinutes: 0,
namespace: OPENSHIFT_NAMESPACE,

containers: [
// This adds the custom slave container to the pod.
// Must be first with name 'jnlp'
containerTemplate(name: 'jnlp',
image: DOCKER_REPO_URL + '/' + OPENSHIFT_NAMESPACE + '/jenkins-continuous-infra-slave:' + SLAVE_TAG,
ttyEnabled: false,
args: '${computer.jnlpmac} ${computer.name}',
command: '',
workingDir: '/workDir'),
containerTemplate(name: 'centos8',
alwaysPullImage: true,
image: DOCKER_REPO_URL + '/' + OPENSHIFT_NAMESPACE + '/centos8:' + CENTOS8_TAG,
ttyEnabled: false,
command: '/usr/sbin/init',
privileged: true,
workingDir: '/workDir')
],
volumes: [
emptyDirVolume(memory: false, mountPath: '/sys/class/net')
]
)
{
execute_test(c8podName, "centos8")
}
}, fedora30: {
pipelineUtils.clearTemplateNames()
podTemplate(name: f30podName,
Expand Down Expand Up @@ -197,7 +235,7 @@ stage('Tests') {
execute_test(f31podName, "fedora31")
}
},
failFast: true
// failFast: true
)
} catch (e) {
// Set build result
Expand Down
14 changes: 14 additions & 0 deletions config/Dockerfiles/JenkinsfileContainer
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tagMap = [:]
tagMap['fedora30'] = STABLE_LABEL
tagMap['fedora31'] = STABLE_LABEL
tagMap['centos7'] = STABLE_LABEL
tagMap['centos8'] = STABLE_LABEL

// Provider: [ PATH/IN/REPO to match, ]
p_providers = ['__RELEASE__':
Expand Down Expand Up @@ -263,6 +264,17 @@ pipeline {
}
}
}
stage("centos8 image build") {
when {
// Only build if we have related files in changeset
changeset "config/Dockerfiles/centos8/**"
}
steps {
script {
tagMap['centos8'] = pipelineUtils.buildImage(openshiftProject, "centos8")
}
}
}
stage("Image Tag Report") {
steps {
script {
Expand Down Expand Up @@ -294,6 +306,8 @@ pipeline {
value: tagMap['fedora31']),
string(name: 'CENTOS7_TAG',
value: tagMap['centos7']),
string(name: 'CENTOS8_TAG',
value: tagMap['centos8']),
string(name: 'TEST_PROVIDERS',
value: test_providers)
],
Expand Down
47 changes: 47 additions & 0 deletions config/Dockerfiles/centos8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM centos:8
LABEL maintainer "https://github.com/CentOS-PaaS-SIG/linchpin"
LABEL description "This container will verify linchpin works under Centos8"

ENV HOME=/root
WORKDIR $HOME

RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf -y install python3 platform-python-pip \
&& dnf -y install python3 platform-python-pip curl gcc python3-devel openssl-devel \
libvirt-daemon-driver-* libvirt-daemon libvirt-daemon-kvm \
qemu-kvm libvirt-daemon-config-network libvirt-python3 \
libvirt-devel virt-install file openssh mkisofs \
libvirt-client net-tools git make \
python3-lxml krb5-workstation krb5-devel \
python3-requests jq buildah git which \
&& pip3 install -U pip \
&& pip3 install -U setuptools \
&& pip3 install -U pygithub \
&& pip3 install -U openstackclient boto>=2.49.0 \
&& pip3 install ansible; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; \
do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*; \
rm -f /usr/sbin/vgs; \
rm -f /usr/sbin/lvs; \
rm -f /usr/sbin/pvs; \
systemctl enable libvirtd; \
systemctl enable virtlockd
RUN sed -i "/Service/a ExecStartPost=\/bin\/chmod 666 /dev/kvm" /usr/lib/systemd/system/libvirtd.service

#RUN curl -o /etc/yum.repos.d/beaker-client.repo \
# https://beaker-project.org/yum/beaker-client-CentOS.repo; \
# dnf -y install beaker-client \
RUN dnf clean all && rm -rf /var/cache/dnf;

RUN mkdir -p $HOME/.config

# /wordir should include the source code of linchpin
VOLUME [ "/workdir" , "/sys/fs/cgroup"]
CMD ["/usr/sbin/init"]
2 changes: 1 addition & 1 deletion config/Dockerfiles/fedora30/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN dnf -y install python3-pip ansible curl gcc python3-devel \
libvirt-daemon-kvm qemu-kvm libvirt-daemon-config-network \
python3-libvirt libvirt-devel redhat-rpm-config file \
openssh genisoimage libvirt-client virt-install net-tools \
make libxslt-python krb5-workstation jq buildah \
make libxslt-python krb5-workstation krb5-devel jq buildah \
python3-libselinux git \
&& dnf clean all; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; \
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/aws/05_aws_ec2_vpc_endpoint
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the aws ec2 vpc subnet provisioning
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: aws

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/aws/06_aws_ec2_elb_lb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the aws ec2 elb lb provisioning
# distros.exclude: fedora29 fedora30 centos7 fedora31
# distros.exclude: fedora29 fedora30 centos7 centos8 fedora31
# providers.include: aws

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/aws/07_aws_ec2_template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the aws-ec2 provisioning with template data
# distros.exclude: fedora29 fedora30 centos7 fedora31
# distros.exclude: fedora29 fedora30 centos7 centos8 fedora31
# providers.include: aws

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/aws/08_aws_ec2_vpc_nat_gateway
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the AWS EC2 VPC NAT gateway provisioning
# distros.exclude: fedora31 fedora30 centos7
# distros.exclude: fedora31 fedora30 centos7 centos8
# providers.include: aws

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/aws/08_aws_vpc_internet_gateway
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the openstack router provisioning
# distros.exclude: fedora30 fedora31 centos7
# distros.exclude: fedora30 fedora31 centos7 centos8
# providers.include: aws
# providers.exclude: none

Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/beaker/03_beaker_inventory
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify distro selection in beaker
# distros.exclude: fedora29 centos7 fedora30
# distros.exclude: fedora29 centos7 centos8 fedora30
# providers.include: beaker
# providers.exclude: none

Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/combined/01_beaker_openstack
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Provision both beaker and openstack with one PinFile
# distros.exclude: fedora29 fedora30 centos7
# distros.exclude: fedora29 fedora30 centos7 centos8
# providers.include: none
# providers.exclude: none
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the gcloud compute router provisioning
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: gcloud

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/general/01_minimal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning for all supplied providers
# distros.exclude: fedora30 centos7 fedora31
# distros.exclude: fedora30 centos7 centos8 fedora31
# providers.include: libvirt

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/libvirt/02_libvirt-storage
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning for all supplied providers
# distros.exclude: centos7 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora30 fedora31
# providers.include: libvirt

## NOTE: This is a temporary test to run libvirt tests until we fix
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/libvirt/03_libvirt-network
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning for all supplied providers
# distros.exclude: centos7 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora30 fedora31
# providers.include: libvirt

## NOTE: This is a temporary test to run libvirt tests until we fix
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/libvirt/05_libvirt-builtins
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning with global hooks
# distros.exclude: centos7 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora30 fedora31
# providers.include: libvirt

set -o pipefail
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning for all supplied providers
# distros.exclude: centos7 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora30 fedora31
# providers.include: libvirt

## NOTE: This is a temporary test to run libvirt tests until we fix
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/libvirt/07_libvirt-static-ip
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify basic provisioning for all supplied providers
# distros.exclude: centos7 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora30 fedora31
# providers.include: libvirt

## NOTE: This is a temporary test to run libvirt tests until we fix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify os-server provisioning using inline template data
# distros.exclude: centos7 fedora29 fedora30
# distros.exclude: centos7 centos8 fedora29 fedora30
# providers.include: openshift

# Above makes sure that the openshift is ran only once avoiding
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/openstack/02_os-server-template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify os-server provisioning using inline template data
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: none

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/openstack/08_os_subnet
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify the openstack router provisioning
# distros.exclude: centos7 fedora29 fedora30
# distros.exclude: centos7 centos8 fedora29 fedora30
# providers.include: openstack
# providers.exclude: none

Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/openstack/11_os-port
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify os-port provisioning ( the test is currently disabled due to unavailable infra)
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: none

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/openstack/12_os-zone
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify os-zone provisioning ( the test is currently disabled due to unavailable infra)
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: none

DISTRO=${1}
Expand Down
2 changes: 1 addition & 1 deletion config/Dockerfiles/tests.d/openstack/13_os-recordset
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

# Verify os-zone provisioning ( the test is currently disabled due to unavailable infra)
# distros.exclude: centos7 fedora29 fedora30 fedora31
# distros.exclude: centos7 centos8 fedora29 fedora30 fedora31
# providers.include: none

DISTRO=${1}
Expand Down
1 change: 1 addition & 0 deletions config/s2i/create-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ templates="jenkins/jenkins-continuous-infra-slave-buildconfig-template.yaml \
jenkins/jenkins-persistent-buildconfig-template.yaml \
jenkins/buildah-buildconfig-template.yaml \
distros/centos7-buildconfig-template.yaml \
distros/centos8-buildconfig-template.yaml \
distros/fedora30-buildconfig-template.yaml \
distros/fedora31-buildconfig-template.yaml"

Expand Down
Loading