From 7cdb65929767e8b71913f5519a6c67e005bba104 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 17 Oct 2024 17:03:30 +0300 Subject: [PATCH] PMM-7 Update default RPM build vars (#3245) * PMM-7 Update default RPM build vars * PMM-7 remove Dockerfile(s) for RHEL7 * PMM-7 remove submodules update * PMM-7 revert the default docker image value --- build/docker/rpmbuild/Dockerfile | 52 -------------------------------- build/docker/server/Dockerfile | 36 ---------------------- build/scripts/build-submodules | 3 -- build/scripts/vars | 2 +- 4 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 build/docker/rpmbuild/Dockerfile delete mode 100644 build/docker/server/Dockerfile diff --git a/build/docker/rpmbuild/Dockerfile b/build/docker/rpmbuild/Dockerfile deleted file mode 100644 index 98561c7831..0000000000 --- a/build/docker/rpmbuild/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM centos:7 - -# enable nodesource repo for nodejs -RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash - -RUN curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo - -RUN yum update -y && \ - yum install -y --setopt=skip_missing_names_on_install=False \ - gcc gcc-c++ \ - nodejs \ - libtool libtool-ltdl \ - make cmake \ - git \ - pkgconfig \ - sudo \ - automake autoconf \ - rpmdevtools createrepo_c epel-release \ - yum-utils rpm-build \ - wget \ - glibc-static \ - yarn && \ - yum -y remove nodesource-release-el7-1.noarch && \ - yum clean all && rm -rf /var/cache/yum - -# keep that format for easier search -ENV GO_VERSION 1.23.2 -ENV GO_RELEASER_VERSION 1.24.0 - -RUN if [ `uname -i` == "x86_64" ]; then ARCH=amd64; else ARCH=arm64; fi && \ - wget --progress=dot:giga https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz -O /tmp/golang.tar.gz && \ - wget --progress=dot:giga https://github.com/goreleaser/goreleaser/releases/download/v${GO_RELEASER_VERSION}/goreleaser-${GO_RELEASER_VERSION}-1.`uname -i`.rpm -O /tmp/goreleaser.rpm && \ - tar -C /usr/local -xzf /tmp/golang.tar.gz && \ - yum install -y /tmp/goreleaser.rpm && \ - rm /tmp/golang.tar.gz /tmp/goreleaser.rpm - -RUN update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 0 -RUN update-alternatives --set go /usr/local/go/bin/go -RUN update-alternatives --install "/usr/bin/gofmt" "gofmt" "/usr/local/go/bin/gofmt" 0 -RUN update-alternatives --set gofmt /usr/local/go/bin/gofmt - -RUN useradd builder -u 1000 -m -G users,wheel && \ - echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \ - echo "# macros" > /home/builder/.rpmmacros && \ - echo "%_topdir /home/builder/rpm" >> /home/builder/.rpmmacros && \ - mkdir /home/builder/rpm && \ - chmod 755 /home/builder && \ - chown -R builder:builder /home/builder - -USER builder - -ENV FLAVOR=rpmbuild OS=centos DIST=el7 -WORKDIR /home/builder/rpm diff --git a/build/docker/server/Dockerfile b/build/docker/server/Dockerfile deleted file mode 100644 index ca48e5d55e..0000000000 --- a/build/docker/server/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM centos:7 - -ARG VERSION -ARG BUILD_DATE - -LABEL org.opencontainers.image.created ${BUILD_DATE} -LABEL org.opencontainers.image.licenses AGPL-3.0 -LABEL org.opencontainers.image.title Percona Monitoring and Management -LABEL org.opencontainers.image.vendor Percona -LABEL org.opencontainers.image.version ${VERSION} - -EXPOSE 80 443 - -WORKDIR /opt - -# Disable fastestmirror plugin and update repo URLs -RUN sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf && \ - sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo && \ - sed -i -e 's|^#baseurl.*|baseurl=http://vault.centos.org/centos/\$releasever/os/\$basearch/|g' /etc/yum.repos.d/CentOS-Base.repo - -# Install EPEL repository and Ansible -RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum -y install ansible - -COPY RPMS /tmp/RPMS -COPY gitCommit /tmp/gitCommit - -COPY ansible /opt/ansible -RUN cp -r /opt/ansible/roles /opt/ansible/pmm2-docker/roles -RUN ansible-playbook -vvv -i 'localhost,' -c local /opt/ansible/pmm2-docker/main.yml \ - && ansible-playbook -vvv -i 'localhost,' -c local /usr/share/pmm-update/ansible/playbook/tasks/update.yml \ - && ansible-playbook -vvv -i 'localhost,' -c local /opt/ansible/pmm2/post-build-actions.yml - -COPY entrypoint.sh /opt/entrypoint.sh -HEALTHCHECK --interval=3s --timeout=2s --start-period=10s --retries=3 CMD curl -f http://127.0.0.1/v1/readyz || exit 1 -CMD ["/opt/entrypoint.sh"] diff --git a/build/scripts/build-submodules b/build/scripts/build-submodules index e7dc1d7c47..aabb5e66c6 100755 --- a/build/scripts/build-submodules +++ b/build/scripts/build-submodules @@ -1,9 +1,6 @@ #!/bin/bash set -o errexit -git submodule update --init --jobs 10 -git submodule status - if [ -s ci.yml ]; then if [ -f /home/ec2-user/venv/bin/activate ]; then source /home/ec2-user/venv/bin/activate diff --git a/build/scripts/vars b/build/scripts/vars index bf567ce109..26f95d44ac 100644 --- a/build/scripts/vars +++ b/build/scripts/vars @@ -45,7 +45,7 @@ echo -e "\n\n\n>>> full_pmm_version=${full_pmm_version} pmm_version=${pmm_versio rpmbuild_docker_image=${RPMBUILD_DOCKER_IMAGE:-public.ecr.aws/e7j3v3n0/rpmbuild:2} rpms_dir=${root_dir}/tmp/pmm-server/RPMS rpmbuild_dir=${root_dir}/sources/pmm/src/github.com/percona/pmm/build/packages/rpm/server -rpmbuild_dist=${RPMBUILD_DIST:-"el7"} +rpmbuild_dist=${RPMBUILD_DIST:-"el9"} source_dir=${root_dir}/tmp/source/pmm2-client-${pmm_version} binary_dir=${root_dir}/tmp/binary/pmm2-client-${pmm_version} client_properties=${root_dir}/results/pmm-client.properties