Skip to content

Commit

Permalink
Changes to support centos stream 9 primarily, as well as start laying…
Browse files Browse the repository at this point in the history
… groundwork for universal target in CI
  • Loading branch information
onetechnical committed Jul 25, 2024
1 parent f6fa590 commit b833690
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 93 deletions.
28 changes: 0 additions & 28 deletions docker/build/cicd.centos.Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
ARG ARCH="amd64"

FROM quay.io/centos/centos:stream8
FROM quay.io/centos/centos:stream9
ARG GOLANG_VERSION
ARG ARCH="amd64"
RUN dnf update rpm -y && \
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
RUN dnf install -y epel-release epel-next-release && dnf config-manager --set-enabled crb && \
dnf update -y && \
dnf install -y autoconf wget awscli git gnupg2 nfs-utils python3-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 --enablerepo=powertools install libstdc++-static && \
dnf -y install make
libffi-devel openssl-devel 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
Expand Down
4 changes: 2 additions & 2 deletions package-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ agents:
workDir: $HOME/projects/go-algorand

- name: rpm
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/go-algorand-ci-linux-centos8
dockerFilePath: docker/build/cicd.centos9.Dockerfile
image: algorand/go-algorand-ci-linux-centos9
version: scripts/configure_dev-deps.sh
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
Expand Down
4 changes: 2 additions & 2 deletions package-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ agents:
workDir: $HOME/projects/go-algorand

- name: rpm
dockerFilePath: docker/build/cicd.centos.Dockerfile
image: algorand/mule-linux-centos
dockerFilePath: docker/build/cicd.centos9.Dockerfile
image: algorand/mule-linux-centos9
version: scripts/configure_dev-deps.sh
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
Expand Down
4 changes: 2 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ agents:
workDir: $HOME/projects/go-algorand

- name: rpm
dockerFilePath: docker/build/cicd.centos.Dockerfile
image: algorand/go-algorand-ci-linux-centos
dockerFilePath: docker/build/cicd.centos9.Dockerfile
image: algorand/go-algorand-ci-linux-centos9
version: scripts/configure_dev-deps.sh
buildArgs:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
Expand Down
8 changes: 4 additions & 4 deletions scripts/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This section briefly describes the expected outcomes of the current build pipeli

1. build

1. Build (compile) the binaries in a Centos 7 & 8 docker container that will then be used by both `deb` and `rpm` packaging.
1. Build (compile) the binaries in a Centos 9 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 20.04 and Centos 7 & 8, respectively.

Expand All @@ -69,9 +69,9 @@ This section briefly describes the expected outcomes of the current build pipeli
- The signatures are correct.
- 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
- quay.io/centos/centos:stream8
- fedora:38
- quay.io/centos/centos:stream9
- fedora:39
- fedora:40
- ubuntu:20.04
- ubuntu:22.04

Expand Down
4 changes: 2 additions & 2 deletions scripts/release/build/stage/build/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ else
echo ${BUILD_NUMBER} > "${REPO_ROOT}"/buildnumber.dat
fi

# Run RPM build in Centos 7 & 8 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 Centos 9 Docker container
sg docker "docker build -t algocentosbuild - < $HOME/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos9.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"

echo
Expand Down
8 changes: 0 additions & 8 deletions scripts/release/common/docker/centos.Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM quay.io/centos/centos:stream8
FROM quay.io/centos/centos:stream9

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

Expand Down
3 changes: 1 addition & 2 deletions scripts/release/common/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ else
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 quay.io/centos/centos:stream9"
sg docker "docker pull ubuntu:22.04"

cat << EOF >> "${HOME}/.bashrc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -exo pipefail

# Ensure the centos8 docker image is built and available
# Ensure the centos docker image is built and available

DOCKER_IMAGE="algorand/go-algorand-ci-linux-centos8:amd64-$(sha1sum scripts/configure_dev-deps.sh | cut -f1 -d' ')"
DOCKER_IMAGE="algorand/go-algorand-ci-linux-centos9:amd64-$(sha1sum scripts/configure_dev-deps.sh | cut -f1 -d' ')"
MATCH=${DOCKER_IMAGE/:*/}

echo "Checking for RPM image"
Expand All @@ -13,5 +13,5 @@ if docker images $DOCKER_IMAGE | grep -qs $MATCH > /dev/null 2>&1; then
else
echo "RPM image doesn't exist, building"
docker build --platform=linux/amd64 --build-arg ARCH=amd64 \
--build-arg GOLANG_VERSION=$(./scripts/get_golang_version.sh) -t $DOCKER_IMAGE -f docker/build/cicd.centos8.Dockerfile .
--build-arg GOLANG_VERSION=$(./scripts/get_golang_version.sh) -t $DOCKER_IMAGE -f docker/build/cicd.centos9.Dockerfile .
fi
2 changes: 1 addition & 1 deletion scripts/release/mule/package/rpm/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ find tmp/node_pkgs -name "*${CHANNEL}*linux*${VERSION}*.tar.gz" | cut -d '/' -f3
-e "s,@REQUIRED_ALGORAND_PKG@,$REQUIRED_ALGORAND_PACKAGE," \
> "$TEMPDIR/$ALGORAND_PACKAGE_NAME.spec"

rpmbuild --buildroot "$HOME/foo" --define "_rpmdir $RPMTMP" --define "RELEASE_GENESIS_PROCESS xtrue" --define "LICENSE_FILE ./COPYING" -bb "$TEMPDIR/$ALGORAND_PACKAGE_NAME.spec" --target $ARCH_UNAME
rpmbuild --buildroot "$HOME/foo" --define "_rpmdir $RPMTMP" --define "RELEASE_GENESIS_PROCESS \"xtrue\"" --define "LICENSE_FILE ./COPYING" -bb "$TEMPDIR/$ALGORAND_PACKAGE_NAME.spec" --target $ARCH_UNAME

cp -p "$RPMTMP"/*/*.rpm "./tmp/node_pkgs/$OS_TYPE/$ARCH_TYPE"
echo "${RPMTMP}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/prod/rpm/run_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -ex

. "${HOME}"/build_env

# Run RPM build in Centos 7 & 8 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 Centos 9 Docker container
sg docker "docker build -t algocentosbuild - < ${HOME}/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos9.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 algocentosbuild /root/subhome/go/src/github.com/algorand/go-algorand/scripts/release/prod/rpm/snapshot.sh"

4 changes: 2 additions & 2 deletions scripts/release/test/rpm/run_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if [ "$CHANNEL" = beta ]; then
exit 0
fi

# Run RPM build in Centos 7 & 8 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 Centos 9 Docker container
sg docker "docker build -t algocentosbuild - < ${HOME}/go/src/github.com/algorand/go-algorand/scripts/release/common/docker/centos9.Dockerfile"

cat <<EOF>"${HOME}"/dummyrepo/algodummy.repo
[algodummy]
Expand Down
6 changes: 3 additions & 3 deletions scripts/release/test/util/test_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ set -ex
. "${HOME}"/build_env

OS_LIST=(
centos:7
quay.io/centos/centos:stream8
fedora:38
quay.io/centos/centos:stream9
fedora:39
fedora:40
ubuntu:20.04
ubuntu:22.04
)
Expand Down
24 changes: 5 additions & 19 deletions test/muleCI/mule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,9 @@ agents:
- GOLANG_VERSION=`./scripts/get_golang_version.sh`
- ARCH=amd64
- GOARCH=amd64
- name: cicd.centos.amd64
dockerFilePath: docker/build/cicd.centos.Dockerfile
image: algorand/go-algorand-ci-linux-centos
version: scripts/configure_dev-deps.sh
arch: amd64
env:
- TRAVIS_BRANCH=${GIT_BRANCH}
- NETWORK=$NETWORK
- VERSION=$VERSION
- BUILD_NUMBER=$BUILD_NUMBER
- GOHOSTARCH=amd64
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
- name: cicd.centos9.amd64
dockerFilePath: docker/build/cicd.centos9.Dockerfile
image: algorand/go-algorand-ci-linux-centos9
version: scripts/configure_dev-deps.sh
arch: amd64
env:
Expand Down Expand Up @@ -106,12 +92,12 @@ tasks:

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

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

- task: docker.Make
Expand Down
6 changes: 3 additions & 3 deletions test/platform/test_linux_amd64_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ BLUE_FG=$(tput setaf 4 2>/dev/null)
END_FG_COLOR=$(tput sgr0 2>/dev/null)

OS_LIST=(
centos:7
quay.io/centos/centos:stream8
fedora:38
quay.io/centos/centos:stream9
fedora:39
fedora:40
ubuntu:20.04
ubuntu:22.04
)
Expand Down

0 comments on commit b833690

Please sign in to comment.