diff --git a/config/Dockerfiles/Jenkinsfile b/config/Dockerfiles/Jenkinsfile index 89072d879..723bef0f5 100644 --- a/config/Dockerfiles/Jenkinsfile +++ b/config/Dockerfiles/Jenkinsfile @@ -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 @@ -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 @@ -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') ] @@ -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, @@ -197,7 +235,7 @@ stage('Tests') { execute_test(f31podName, "fedora31") } }, - failFast: true + // failFast: true ) } catch (e) { // Set build result diff --git a/config/Dockerfiles/JenkinsfileContainer b/config/Dockerfiles/JenkinsfileContainer index f54357d9a..de829fd19 100644 --- a/config/Dockerfiles/JenkinsfileContainer +++ b/config/Dockerfiles/JenkinsfileContainer @@ -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__': @@ -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 { @@ -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) ], diff --git a/config/Dockerfiles/centos8/Dockerfile b/config/Dockerfiles/centos8/Dockerfile new file mode 100644 index 000000000..6bd2d620b --- /dev/null +++ b/config/Dockerfiles/centos8/Dockerfile @@ -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"] diff --git a/config/Dockerfiles/fedora30/Dockerfile b/config/Dockerfiles/fedora30/Dockerfile index 4a7258f77..0f1b67cff 100644 --- a/config/Dockerfiles/fedora30/Dockerfile +++ b/config/Dockerfiles/fedora30/Dockerfile @@ -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 *; \ diff --git a/config/Dockerfiles/tests.d/aws/05_aws_ec2_vpc_endpoint b/config/Dockerfiles/tests.d/aws/05_aws_ec2_vpc_endpoint index 5c90749a4..8bdd82af7 100755 --- a/config/Dockerfiles/tests.d/aws/05_aws_ec2_vpc_endpoint +++ b/config/Dockerfiles/tests.d/aws/05_aws_ec2_vpc_endpoint @@ -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} diff --git a/config/Dockerfiles/tests.d/aws/06_aws_ec2_elb_lb b/config/Dockerfiles/tests.d/aws/06_aws_ec2_elb_lb index 1ed5c6854..6e10033cd 100755 --- a/config/Dockerfiles/tests.d/aws/06_aws_ec2_elb_lb +++ b/config/Dockerfiles/tests.d/aws/06_aws_ec2_elb_lb @@ -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} diff --git a/config/Dockerfiles/tests.d/aws/07_aws_ec2_template b/config/Dockerfiles/tests.d/aws/07_aws_ec2_template index c7fd3dd7e..01009838b 100755 --- a/config/Dockerfiles/tests.d/aws/07_aws_ec2_template +++ b/config/Dockerfiles/tests.d/aws/07_aws_ec2_template @@ -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} diff --git a/config/Dockerfiles/tests.d/aws/08_aws_ec2_vpc_nat_gateway b/config/Dockerfiles/tests.d/aws/08_aws_ec2_vpc_nat_gateway index 39ff426f7..9d7edad8e 100755 --- a/config/Dockerfiles/tests.d/aws/08_aws_ec2_vpc_nat_gateway +++ b/config/Dockerfiles/tests.d/aws/08_aws_ec2_vpc_nat_gateway @@ -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} diff --git a/config/Dockerfiles/tests.d/aws/08_aws_vpc_internet_gateway b/config/Dockerfiles/tests.d/aws/08_aws_vpc_internet_gateway index 513130514..d319362e5 100755 --- a/config/Dockerfiles/tests.d/aws/08_aws_vpc_internet_gateway +++ b/config/Dockerfiles/tests.d/aws/08_aws_vpc_internet_gateway @@ -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 diff --git a/config/Dockerfiles/tests.d/beaker/03_beaker_inventory b/config/Dockerfiles/tests.d/beaker/03_beaker_inventory index da6ecc076..5b17be757 100755 --- a/config/Dockerfiles/tests.d/beaker/03_beaker_inventory +++ b/config/Dockerfiles/tests.d/beaker/03_beaker_inventory @@ -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 diff --git a/config/Dockerfiles/tests.d/combined/01_beaker_openstack b/config/Dockerfiles/tests.d/combined/01_beaker_openstack index 099b69a53..2e66d7bac 100755 --- a/config/Dockerfiles/tests.d/combined/01_beaker_openstack +++ b/config/Dockerfiles/tests.d/combined/01_beaker_openstack @@ -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 # diff --git a/config/Dockerfiles/tests.d/gcloud/07_gcloud_gcp_compute_router b/config/Dockerfiles/tests.d/gcloud/07_gcloud_gcp_compute_router index 4532b71e6..09f516a60 100755 --- a/config/Dockerfiles/tests.d/gcloud/07_gcloud_gcp_compute_router +++ b/config/Dockerfiles/tests.d/gcloud/07_gcloud_gcp_compute_router @@ -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} diff --git a/config/Dockerfiles/tests.d/general/01_minimal b/config/Dockerfiles/tests.d/general/01_minimal index 282f6ac08..c1ee0cbe6 100755 --- a/config/Dockerfiles/tests.d/general/01_minimal +++ b/config/Dockerfiles/tests.d/general/01_minimal @@ -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} diff --git a/config/Dockerfiles/tests.d/libvirt/02_libvirt-storage b/config/Dockerfiles/tests.d/libvirt/02_libvirt-storage index f18bf1a1c..558033fe4 100755 --- a/config/Dockerfiles/tests.d/libvirt/02_libvirt-storage +++ b/config/Dockerfiles/tests.d/libvirt/02_libvirt-storage @@ -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 diff --git a/config/Dockerfiles/tests.d/libvirt/03_libvirt-network b/config/Dockerfiles/tests.d/libvirt/03_libvirt-network index faef56954..2b64149a2 100755 --- a/config/Dockerfiles/tests.d/libvirt/03_libvirt-network +++ b/config/Dockerfiles/tests.d/libvirt/03_libvirt-network @@ -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 diff --git a/config/Dockerfiles/tests.d/libvirt/05_libvirt-builtins b/config/Dockerfiles/tests.d/libvirt/05_libvirt-builtins index 4ab08b886..b24e2ab42 100755 --- a/config/Dockerfiles/tests.d/libvirt/05_libvirt-builtins +++ b/config/Dockerfiles/tests.d/libvirt/05_libvirt-builtins @@ -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 diff --git a/config/Dockerfiles/tests.d/libvirt/06_libvirt-multi-node-network b/config/Dockerfiles/tests.d/libvirt/06_libvirt-multi-node-network index c573bc525..39a9515b2 100755 --- a/config/Dockerfiles/tests.d/libvirt/06_libvirt-multi-node-network +++ b/config/Dockerfiles/tests.d/libvirt/06_libvirt-multi-node-network @@ -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 diff --git a/config/Dockerfiles/tests.d/libvirt/07_libvirt-static-ip b/config/Dockerfiles/tests.d/libvirt/07_libvirt-static-ip index 843dac2e6..a9983cbd3 100755 --- a/config/Dockerfiles/tests.d/libvirt/07_libvirt-static-ip +++ b/config/Dockerfiles/tests.d/libvirt/07_libvirt-static-ip @@ -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 diff --git a/config/Dockerfiles/tests.d/openshift/01_openshift-create-template b/config/Dockerfiles/tests.d/openshift/01_openshift-create-template index 380e3cf3d..121a7c3af 100755 --- a/config/Dockerfiles/tests.d/openshift/01_openshift-create-template +++ b/config/Dockerfiles/tests.d/openshift/01_openshift-create-template @@ -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 diff --git a/config/Dockerfiles/tests.d/openstack/02_os-server-template b/config/Dockerfiles/tests.d/openstack/02_os-server-template index b4dc51cfb..db0993883 100755 --- a/config/Dockerfiles/tests.d/openstack/02_os-server-template +++ b/config/Dockerfiles/tests.d/openstack/02_os-server-template @@ -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} diff --git a/config/Dockerfiles/tests.d/openstack/08_os_subnet b/config/Dockerfiles/tests.d/openstack/08_os_subnet index 071dc335f..24631ed9e 100755 --- a/config/Dockerfiles/tests.d/openstack/08_os_subnet +++ b/config/Dockerfiles/tests.d/openstack/08_os_subnet @@ -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 diff --git a/config/Dockerfiles/tests.d/openstack/11_os-port b/config/Dockerfiles/tests.d/openstack/11_os-port index f1f04616b..c8812832f 100755 --- a/config/Dockerfiles/tests.d/openstack/11_os-port +++ b/config/Dockerfiles/tests.d/openstack/11_os-port @@ -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} diff --git a/config/Dockerfiles/tests.d/openstack/12_os-zone b/config/Dockerfiles/tests.d/openstack/12_os-zone index 854d6dd71..c8f3dca9d 100755 --- a/config/Dockerfiles/tests.d/openstack/12_os-zone +++ b/config/Dockerfiles/tests.d/openstack/12_os-zone @@ -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} diff --git a/config/Dockerfiles/tests.d/openstack/13_os-recordset b/config/Dockerfiles/tests.d/openstack/13_os-recordset index 6fcc06b79..6bce4770e 100755 --- a/config/Dockerfiles/tests.d/openstack/13_os-recordset +++ b/config/Dockerfiles/tests.d/openstack/13_os-recordset @@ -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} diff --git a/config/s2i/create-containers.sh b/config/s2i/create-containers.sh index d00a2e1cc..1d6302887 100755 --- a/config/s2i/create-containers.sh +++ b/config/s2i/create-containers.sh @@ -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" diff --git a/config/s2i/distros/centos8-buildconfig-template.yaml b/config/s2i/distros/centos8-buildconfig-template.yaml new file mode 100644 index 000000000..34f8208d9 --- /dev/null +++ b/config/s2i/distros/centos8-buildconfig-template.yaml @@ -0,0 +1,56 @@ +apiVersion: v1 +kind: Template +labels: + template: centos8-builder +metadata: + annotations: + description: centos8 container + iconClass: centos8 + tags: instant-app + name: centos8-builder +objects: +- apiVersion: v1 + kind: ImageStream + metadata: + annotations: + labels: + name: centos8 + spec: {} +- apiVersion: v1 + kind: BuildConfig + metadata: + name: centos8 + spec: + output: + to: + kind: ImageStreamTag + name: centos8:latest + resources: {} + source: + contextDir: ${REPO_CONTEXTDIR} + git: + ref: ${REPO_REF} + uri: ${REPO_URL} + type: Git + strategy: + dockerStrategy: + dockerfilePath: centos8/Dockerfile + env: + - name: CONTAINER_NAME + value: centos8 + type: Docker + triggers: + - type: ConfigChange +parameters: +- description: Git repository with Dockerfile and slave entrypoint. + displayName: Repository URL + name: REPO_URL + value: https://github.com/CentOS-PaaS-SIG/linchpin.git +- description: The sub-directory inside the repository. + displayName: Context Directory + name: REPO_CONTEXTDIR + value: config/Dockerfiles +- description: The git ref or tag to use for customization. + displayName: Git Reference + name: REPO_REF + value: develop diff --git a/config/s2i/distros/fedora31-buildconfig-template.yaml b/config/s2i/distros/fedora31-buildconfig-template.yaml index 0aa2d8169..73e7526cd 100644 --- a/config/s2i/distros/fedora31-buildconfig-template.yaml +++ b/config/s2i/distros/fedora31-buildconfig-template.yaml @@ -45,7 +45,7 @@ parameters: - description: Git repository with Dockerfile and slave entrypoint. displayName: Repository URL name: REPO_URL - value: https://github.com/samvarankashyap/linchpin.git + value: https://github.com/CentOS-PaaS-SIG/linchpin.git - description: The sub-directory inside the repository. displayName: Context Directory name: REPO_CONTEXTDIR diff --git a/requirements.txt b/requirements.txt index 57002eac9..cfcdfc127 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,6 +20,7 @@ configparser>=3.5.0 pyasn1>=0.1.9 GitPython>=2.1.15,<3.1.0 gitdb>=0.6.4 +gitdb2>=3.0.1 future openstacksdk>=0.37 tqdm==4.36.1