Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Test packaged EOSIO Linux artifacts against standard dockers. #10429

Merged
merged 2 commits into from
Jun 16, 2021
Merged
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
55 changes: 55 additions & 0 deletions .cicd/generate-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,33 @@ cat <<EOF
PKGTYPE: "rpm"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
key: "centos7pb"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_CENTOS_7_7}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

- label: ":centos: CentOS 7 - Test Package"
command:
- "buildkite-agent artifact download '*.rpm' . --step ':centos: CentOS 7.7 - Package Builder' --agent-access-token \$\$BUILDKITE_AGENT_ACCESS_TOKEN"
- "./.cicd/test-package.sh"
env:
IMAGE: "centos:7"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
depends_on: "centos7pb"
allow_dependency_failure: false
timeout: ${TIMEOUT:-10}
skip: ${SKIP_CENTOS_7_7}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

- label: ":aws: Amazon Linux 2 - Test Package"
command:
- "buildkite-agent artifact download '*.rpm' . --step ':centos: CentOS 7.7 - Package Builder' --agent-access-token \$\$BUILDKITE_AGENT_ACCESS_TOKEN"
- "./.cicd/test-package.sh"
env:
IMAGE: "amazonlinux:2"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
depends_on: "centos7pb"
allow_dependency_failure: false
timeout: ${TIMEOUT:-10}
skip: ${SKIP_CENTOS_7_7}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

Expand All @@ -555,6 +582,20 @@ cat <<EOF
PKGTYPE: "deb"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
key: "ubuntu1604pb"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_16_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

- label: ":ubuntu: Ubuntu 16.04 - Test Package"
command:
- "buildkite-agent artifact download '*.deb' . --step ':ubuntu: Ubuntu 16.04 - Package Builder' --agent-access-token \$\$BUILDKITE_AGENT_ACCESS_TOKEN"
- "./.cicd/test-package.sh"
env:
IMAGE: "ubuntu:16.04"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
depends_on: "ubuntu1604pb"
allow_dependency_failure: false
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_16_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

Expand All @@ -569,6 +610,20 @@ cat <<EOF
PKGTYPE: "deb"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
key: "ubuntu1804pb"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_18_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

- label: ":ubuntu: Ubuntu 18.04 - Test Package"
command:
- "buildkite-agent artifact download '*.deb' . --step ':ubuntu: Ubuntu 18.04 - Package Builder' --agent-access-token \$\$BUILDKITE_AGENT_ACCESS_TOKEN"
- "./.cicd/test-package.sh"
env:
IMAGE: "ubuntu:18.04"
agents:
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
depends_on: "ubuntu1804pb"
allow_dependency_failure: false
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_18_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}

Expand Down
25 changes: 25 additions & 0 deletions .cicd/test-package.run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -eu

echo '+++ :minidisc: Installing EOSIO'

if [[ $(apt-get --version 2>/dev/null) ]]; then # debian family
UPDATE='apt-get update'
echo "$ $UPDATE"
eval $UPDATE
INSTALL="apt-get install -y /eos/*.deb"
echo "$ $INSTALL"
eval $INSTALL
elif [[ $(yum --version 2>/dev/null) ]]; then # RHEL family
UPDATE='yum check-update || :'
echo "$ $UPDATE"
eval $UPDATE
INSTALL="yum install -y /eos/*.rpm"
echo "$ $INSTALL"
eval $INSTALL
else
echo 'ERROR: Package manager not detected!'
exit 3
fi

nodeos --full-version
7 changes: 7 additions & 0 deletions .cicd/test-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add set -e here so this script fails on error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we should. I'm going to add -u also. I did it for the test script, but I guess not the wrapper...

set -eu

Copy link
Contributor

Choose a reason for hiding this comment

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

We should use log-folding groups to hide everything from our customers except what they care about, which is just the installation and the nodeos --full-version. This makes what the pipeline is doing more obvious and reduces our support load.

echo '+++ :minidisc: Installing EOSIO'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok. Should I put the the nodeos --full-version into a separate fold since its a basic test layer that nodeos runs after installed? We might put other stuff there eventually.

Copy link
Contributor

@kj4ezj kj4ezj Jun 15, 2021

Choose a reason for hiding this comment

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

Up to you. If you do, I would make both the installation and invocation expanded log groups (+++).

Copy link
Contributor

@kj4ezj kj4ezj Jun 15, 2021

Choose a reason for hiding this comment

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

Emoji are here.

echo '--- :docker: Selecting Container'

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider another log folding group here to match the style of the other job steps.

echo '--- :docker: Selecting Container'

docker pull $IMAGE
docker run --rm -v "$(pwd):/eos" -w '/eos' -it $IMAGE ./.cicd/test-package.run.sh