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 RHEL Centos 8 RPM #2190

Merged
merged 18 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fde81a5
Added support for Centos 8 RPM packaging.
egieseke May 25, 2021
6a1473b
Limit build to AMD64 for testing centos8.
egieseke May 26, 2021
9be50ea
Merge branch 'master' of https://github.com/algorand/go-algorand into…
egieseke May 26, 2021
6b13ca8
Updated goproxy path to include proxy.golang.org
egieseke May 26, 2021
bae59e4
include call to ./scripts/configure_dev.sh in docker/build/cicd.cento…
egieseke May 26, 2021
c73046e
Merge branch 'master' of https://github.com/algorand/go-algorand into…
egieseke Jun 1, 2021
436d6b4
include call to ./scripts/configure_dev.sh in docker/build/cicd.ubunt…
egieseke Jun 1, 2021
a51d23f
include call to ./scripts/configure_dev.sh in docker/build/cicd.cento…
egieseke Jun 1, 2021
60b49e0
remove call to ./scripts/configure_dev.sh in docker/build/cicd.centos…
egieseke Jun 1, 2021
81fe6fb
Remove install of ShellCheck from centos8.
egieseke Jun 1, 2021
fb5cf8e
Use dnf to install sqlite, libstdc++-static, and make.
egieseke Jun 1, 2021
b309c83
Enable arm64 and docker jobs in mule.yaml.
egieseke Jun 2, 2021
780a944
Remove use of ./scripts/configure_dev.sh
egieseke Jun 3, 2021
e864ee7
Use branch of go-algorand-ci
egieseke Jun 8, 2021
98e95f7
Merge branch 'master' into add-centos8-rpm
onetechnical Jun 9, 2021
2424983
Replaced centos8 base image with centos stream 8.
egieseke Jun 9, 2021
9361c2d
Merge remote-tracking branch 'origin/add-centos8-rpm' into add-centos…
egieseke Jun 9, 2021
bc7b3f8
Prefetch centos stream 8 docker image.
egieseke Jun 9, 2021
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
35 changes: 35 additions & 0 deletions docker/build/cicd.centos8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG ARCH="amd64"

FROM quay.io/centos/centos:stream8
ARG GOLANG_VERSION
ARG ARCH="amd64"
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
dnf update -y && \
dnf install -y autoconf wget awscli git gnupg2 nfs-utils python3-devel boost-devel expect jq \
libtool gcc-c++ libstdc++-devel rpmdevtools createrepo rpm-sign bzip2 which \
libffi-devel openssl-devel
RUN dnf install -y epel-release && \
dnf update && \
dnf -y install sqlite && \
dnf -y --enablerepo=powertools install libstdc++-static && \
dnf -y install make
RUN echo "${BOLD}Downloading and installing binaries...${RESET}" && \
curl -Of https://shellcheck.storage.googleapis.com/shellcheck-v0.7.0.linux.x86_64.tar.xz && \
tar -C /usr/local/bin/ -xf shellcheck-v0.7.0.linux.x86_64.tar.xz --no-anchored 'shellcheck' --strip=1
WORKDIR /root
RUN wget https://dl.google.com/go/go${GOLANG_VERSION}.linux-${ARCH%v*}.tar.gz \
&& tar -xvf go${GOLANG_VERSION}.linux-${ARCH%v*}.tar.gz && \
mv go /usr/local
ENV GOROOT=/usr/local/go \
GOPATH=$HOME/go \
ARCH_TYPE=${ARCH}
RUN mkdir -p $GOPATH/src/github.com/algorand
COPY . $GOPATH/src/github.com/algorand/go-algorand
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH \
GOPROXY=https://proxy.golang.org,https://pkg.go.dev,https://goproxy.io,direct
WORKDIR $GOPATH/src/github.com/algorand/go-algorand
RUN make clean
RUN rm -rf $GOPATH/src/github.com/algorand/go-algorand && \
mkdir -p $GOPATH/src/github.com/algorand/go-algorand
RUN echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
CMD ["/bin/bash"]
1 change: 0 additions & 1 deletion docker/build/cicd.ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ RUN rm -rf $GOPATH/src/github.com/algorand/go-algorand && \
mkdir -p $GOPATH/src/github.com/algorand/go-algorand
RUN echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
CMD ["/bin/bash"]

26 changes: 26 additions & 0 deletions package-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ agents:
- $HOME/.gnupg/pubring.kbx:/root/.gnupg/pubring.kbx
workDir: $HOME/projects/go-algorand


- name: rpm.centos8
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/go-algorand-ci-linux-centos8
version: scripts/configure_dev-deps.sh
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
env:
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- NETWORK=$NETWORK
- PACKAGES_DIR=$PACKAGES_DIR
- NO_DEPLOY=$NO_DEPLOY
- S3_SOURCE=$S3_SOURCE
- VERSION=$VERSION
volumes:
- $XDG_RUNTIME_DIR/gnupg/S.gpg-agent:/root/.gnupg/S.gpg-agent
- $HOME/.gnupg/pubring.kbx:/root/.gnupg/pubring.kbx
workDir: $HOME/projects/go-algorand

tasks:
- task: docker.Make
name: docker
Expand All @@ -84,6 +104,11 @@ tasks:
agent: rpm
target: mule-deploy-rpm

- task: docker.Make
name: rpm.centos8
agent: rpm.centos8
target: mule-deploy-rpm-centos8

jobs:
package-deploy:
tasks:
Expand All @@ -99,6 +124,7 @@ jobs:
package-deploy-rpm:
tasks:
- docker.Make.rpm
- docker.Make.rpm.centos8

docker-hub:
tasks:
Expand Down
23 changes: 23 additions & 0 deletions package-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ agents:
- VERSION=$VERSION
workDir: $HOME/projects/go-algorand

- name: rpm-centos8
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/mule-linux-centos8
version: scripts/configure_dev-deps.sh
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
env:
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- BRANCH=$BRANCH
- NETWORK=$NETWORK
- S3_SOURCE=$S3_SOURCE
- SHA=$SHA
- VERSION=$VERSION
workDir: $HOME/projects/go-algorand

tasks:
- task: docker.Make
name: package-test-deb
Expand All @@ -42,11 +58,17 @@ tasks:
agent: rpm
target: mule-test-rpm

- task: docker.Make
name: package-test-rpm-centos8
agent: rpm-centos8
target: mule-test-rpm-centos8

jobs:
package-test:
tasks:
- docker.Make.package-test-deb
- docker.Make.package-test-rpm
- docker.Make.package-test-rpm-centos8

package-test-deb:
tasks:
Expand All @@ -55,4 +77,5 @@ jobs:
package-test-rpm:
tasks:
- docker.Make.package-test-rpm
- docker.Make.package-test-rpm-centos8

18 changes: 18 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ agents:
- VERSION=$VERSION
workDir: $HOME/projects/go-algorand

- name: rpm.centos8
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/go-algorand-ci-linux-centos8
version: scripts/configure_dev-deps.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this file still exist? I thought tsachi was removing it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleared it's content, but kept it around so it won't create build failures.

buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
env:
- NETWORK=$NETWORK
- VERSION=$VERSION
workDir: $HOME/projects/go-algorand

- name: docker
dockerFilePath: docker/build/docker.ubuntu.Dockerfile
image: algorand/go-algorand-docker-linux-ubuntu
Expand All @@ -45,6 +56,11 @@ tasks:
agent: rpm
target: mule-package-rpm

- task: docker.Make
name: rpm.centos8
agent: rpm.centos8
target: mule-package-rpm.centos8

- task: docker.Make
name: deb
agent: deb
Expand All @@ -61,6 +77,7 @@ jobs:
- docker.Make.build
- docker.Make.deb
- docker.Make.rpm
- docker.Make.rpm.centos8
- docker.Make.docker

package-deb:
Expand All @@ -71,6 +88,7 @@ jobs:
tasks:
- docker.Make.build
- docker.Make.rpm
- docker.Make.rpm.centos8

package-docker:
tasks:
Expand Down
5 changes: 3 additions & 2 deletions scripts/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ This section briefly describes the expected outcomes of the current build pipeli

1. build

1. Build (compile) the binaries in a Centos 7 docker container that will then be used by both `deb` and `rpm` packaging.
1. Build (compile) the binaries in a Centos 7 & 8 docker container that will then be used by both `deb` and `rpm` packaging.

1. Docker containers will package `deb` and `rpm` artifacts inside of Ubuntu 18.04 and Centos 7, respectively.
1. Docker containers will package `deb` and `rpm` artifacts inside of Ubuntu 18.04 and Centos 7 & 8, respectively.

1. Jenkins will then pause to wait for [the only manual part of the build/package/test phase], which is to forward the `gpg-agent` that establishes a direct between the local machine that contains the signing keys and the remote ec2 instance.

Expand All @@ -70,6 +70,7 @@ This section briefly describes the expected outcomes of the current build pipeli
- The packages are built from the correct branch and channel and are the correct version. This done by running `algod -v`.
+ This is done for the following docker containers:
- centos:7
- centos:8
- fedora:28
- ubuntu:16.04
- ubuntu:18.04
Expand Down
1 change: 1 addition & 0 deletions scripts/release/build/rpm/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ echo
set -ex

sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=${HOME},dst=/root/subhome algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/package.sh"
sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=${HOME},dst=/root/subhome algocentos8build /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/package.sh"

echo
date "+build_release end PACKAGE RPM stage %Y%m%d_%H%M%S"
Expand Down
5 changes: 4 additions & 1 deletion scripts/release/build/stage/build/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ fi

# Run RPM build in Centos7 Docker container
sg docker "docker build -t algocentosbuild - < $HOME/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos.Dockerfile"

sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=${HOME},dst=/root/subhome algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/build.sh"

# Run RPM build in Centos8 Docker container
sg docker "docker build -t algocentos8build - < $HOME/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos8.Dockerfile"
sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=${HOME},dst=/root/subhome algocentos8build /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/build.sh"

echo
date "+build_release end BUILD stage %Y%m%d_%H%M%S"
echo
Expand Down
1 change: 1 addition & 0 deletions scripts/release/build/stage/package/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ echo
"${HOME}"/go/src/github.com/algorand/go-algorand/scripts/release/build/deb/package.sh

sg docker "docker run --rm --env-file $HOME/build_env_docker --mount type=bind,src=$HOME,dst=/root/subhome algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/package.sh"
sg docker "docker run --rm --env-file $HOME/build_env_docker --mount type=bind,src=$HOME,dst=/root/subhome algocentos8build /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/build/rpm/package.sh"

echo
date "+build_release end PACKAGE stage %Y%m%d_%H%M%S"
Expand Down
13 changes: 13 additions & 0 deletions scripts/release/common/docker/centos8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM quay.io/centos/centos:stream8

WORKDIR /root
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
dnf install -y autoconf awscli curl git gnupg2 nfs-utils python36 sqlite boost-devel expect jq libtool gcc-c++ libstdc++-devel rpmdevtools createrepo rpm-sign bzip2 which && \
dnf -y --enablerepo=powertools install libstdc++-static

RUN echo "${BOLD}Downloading and installing binaries...${RESET}" && \
curl -Of https://shellcheck.storage.googleapis.com/shellcheck-v0.7.0.linux.x86_64.tar.xz && \
tar -C /usr/local/bin/ -xf shellcheck-v0.7.0.linux.x86_64.tar.xz --no-anchored 'shellcheck' --strip=1

ENTRYPOINT ["/bin/bash"]

1 change: 1 addition & 0 deletions scripts/release/common/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ fi

sudo usermod -a -G docker ubuntu
sg docker "docker pull centos:7"
sg docker "docker pull quay.io/centos/centos:stream8"
sg docker "docker pull ubuntu:18.04"

cat << EOF >> "${HOME}/.bashrc"
Expand Down
4 changes: 4 additions & 0 deletions scripts/release/prod/rpm/run_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ sg docker "docker build -t algocentosbuild - < ${HOME}/go/src/github.com/algoran

sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=/run/user/1000/gnupg/S.gpg-agent,dst=/root/S.gpg-agent --mount type=bind,src=${HOME}/prodrepo,dst=/root/prodrepo --mount type=bind,src=${HOME}/keys,dst=/root/keys --mount type=bind,src=${HOME},dst=/root/subhome algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/prod/rpm/snapshot.sh"

# Run RPM build in Centos8 Docker container
sg docker "docker build -t algocentos8build - < ${HOME}/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos8.Dockerfile"

sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=/run/user/1000/gnupg/S.gpg-agent,dst=/root/S.gpg-agent --mount type=bind,src=${HOME}/prodrepo,dst=/root/prodrepo --mount type=bind,src=${HOME}/keys,dst=/root/keys --mount type=bind,src=${HOME},dst=/root/subhome algocentos8build /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/prod/rpm/snapshot.sh"
3 changes: 3 additions & 0 deletions scripts/release/test/rpm/run_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ fi

# Run RPM build in Centos7 Docker container
sg docker "docker build -t algocentosbuild - < ${HOME}/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos.Dockerfile"
# Run RPM build in Centos8 Docker container
sg docker "docker build -t algocentos8build - < ${HOME}/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos8.Dockerfile"

cat <<EOF>"${HOME}"/dummyrepo/algodummy.repo
[algodummy]
Expand All @@ -30,6 +32,7 @@ cd "${HOME}"/dummyrepo && python3 "${HOME}"/go/src/github.com/algorand/go-algora
trap "${HOME}"/go/src/github.com/algorand/go-algorand/scripts/kill_httpd.sh 0

sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=/run/user/1000/gnupg/S.gpg-agent,dst=/root/S.gpg-agent --mount type=bind,src=${HOME}/dummyrepo,dst=/root/dummyrepo --mount type=bind,src=${HOME}/keys,dst=/root/keys --mount type=bind,src=${HOME},dst=/root/subhome algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/test/rpm/test_algorand.sh"
sg docker "docker run --rm --env-file ${HOME}/build_env_docker --mount type=bind,src=/run/user/1000/gnupg/S.gpg-agent,dst=/root/S.gpg-agent --mount type=bind,src=${HOME}/dummyrepo,dst=/root/dummyrepo --mount type=bind,src=${HOME}/keys,dst=/root/keys --mount type=bind,src=${HOME},dst=/root/subhome algocentos8build /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/test/rpm/test_algorand.sh"

echo
date "+build_release end TEST stage %Y%m%d_%H%M%S"
Expand Down
26 changes: 26 additions & 0 deletions test/muleCI/mule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ agents:
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
- ARCH=amd64
- name: cicd.centos8.amd64
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/go-algorand-ci-linux-centos8
version: scripts/configure_dev-deps.sh
arch: amd64
env:
- TRAVIS_BRANCH=${GIT_BRANCH}
- NETWORK=$NETWORK
- VERSION=$VERSION
- BUILD_NUMBER=$BUILD_NUMBER
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
- ARCH=amd64
- name: cicd.ubuntu.arm64
dockerFilePath: docker/build/cicd.ubuntu.Dockerfile
image: algorand/go-algorand-ci-linux-ubuntu
Expand Down Expand Up @@ -98,10 +111,21 @@ tasks:
agent: cicd.centos.amd64
target: archive

- task: docker.Make
name: archive.amd64.centos8
agent: cicd.centos8.amd64
target: archive

- task: docker.Make
name: rpm.amd64
agent: cicd.centos.amd64
target: mule-package-rpm

- task: docker.Make
name: rpm.amd64.centos8
agent: cicd.centos8.amd64
target: mule-package-rpm

- task: docker.Make
name: deb.amd64
agent: cicd.ubuntu.amd64
Expand Down Expand Up @@ -206,11 +230,13 @@ jobs:
- stash.Unstash.linux-arm
- docker.Make.deb.amd64
- docker.Make.rpm.amd64
- docker.Make.rpm.amd64.centos8
- stash.Stash.packages
archive-linux-amd64:
tasks:
- stash.Unstash.packages
- docker.Make.archive.amd64
- docker.Make.archive.amd64.centos8
package-docker:
tasks:
- docker.Make.docker-image
Expand Down