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

Docker arm64 smoke test #3988

Merged
merged 3 commits into from
Mar 17, 2023
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
32 changes: 28 additions & 4 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

references:
- &OTP24 mongooseim/cimg-erlang:24.3.4.9
- &OTP25 mongooseim/cimg-erlang:25.2.3
- &OTP25 mongooseim/cimg-erlang:25.3
- &ENTRYPOINT ["/bin/sh", "-c", "eval ${INSTALL_DEPS_CMD:-echo} && echo __INJECT_FILES__ | eval ${BASE32DEC:-base32 --decode} | bash"]
# Caches created via the save_cache step are stored for up to 15 days
- &CERT_KEY certs-cache-{{ checksum "certs_cache_key" }}-v3
Expand Down Expand Up @@ -331,6 +331,14 @@ commands:
- run_coverage_analysis
- upload_results_to_aws
- publish_github_comment
run_docker_smoke_test:
steps:
- checkout
- run:
name: Smoke testing
command: |
source tools/circleci-prepare-mongooseim-docker.sh
./smoke_test.sh
upload_results_to_aws:
steps:
- run:
Expand Down Expand Up @@ -447,9 +455,17 @@ jobs:
- run:
name: Execute Docker image build and upload
command: tools/circle-build-and-push-docker.sh
- run:
name: Smoke testing
command: IMAGE_TAG=`cat image_tag` mongooseim-docker/smoke_test.sh

docker_smoke_test:
executor: otp_25
steps:
- setup_remote_docker
- run_docker_smoke_test

docker_smoke_test_arm64:
executor: arm64
steps:
- run_docker_smoke_test

docs_build_deploy:
parallelism: 1
Expand Down Expand Up @@ -967,3 +983,11 @@ workflows:
- edoc

filters: *all_tags
- docker_smoke_test:
context: mongooseim-org
requires:
- docker_build_and_ship
- docker_smoke_test_arm64:
context: mongooseim-org
requires:
- docker_build_and_ship
31 changes: 2 additions & 29 deletions tools/circle-build-and-push-docker.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
#!/bin/bash

set -e
# From https://github.com/esl/mongooseim-docker/pull/49
MIM_DOCKER_VERSION=6b62e9cf26c523e35fe78c57cbae2e8832f555d2

# We use output of generate_vsn, because it does not contain illegal characters, returns
# git tag when building from tag itself, and is unique in any other case
VERSION=`tools/generate_vsn.sh`
DOCKERHUB_TAG=${VERSION}
GIT_REF=`git rev-parse HEAD`
GIT_COMMIT_MSG=`git log --format=%B -n 1 HEAD`

if [ -n "$CIRCLE_PULL_REQUEST" ]; then
# CircleCI doesn't provide PR number in env. var., so we need to extract it from PR URL
# May not work with different service than GitHub
# TODO: Possibly change it to something else during Tide integration
PR_NUMBER=${CIRCLE_PULL_REQUEST##*/}
DOCKERHUB_TAG="PR-${PR_NUMBER}"
elif [ ${CIRCLE_BRANCH} == 'master' ]; then
DOCKERHUB_TAG="latest";
fi

echo "Tag: ${DOCKERHUB_TAG}"

IMAGE_TAG=${DOCKERHUB_REPO}/mongooseim:${DOCKERHUB_TAG}

git clone https://github.com/esl/mongooseim-docker.git
cd mongooseim-docker
git checkout $MIM_DOCKER_VERSION
SRC_ROOT="$(dirname "${BASH_SOURCE}")"
source $SRC_ROOT/circleci-prepare-mongooseim-docker.sh

cp ../mongooseim-*.tar.gz member

Expand All @@ -42,5 +17,3 @@ docker buildx build --platform linux/amd64,linux/arm64 \
--build-arg VCS_REF_DESC="${GIT_COMMIT_MSG}" \
--build-arg VERSION=${VERSION} \
.

echo $IMAGE_TAG > ../image_tag
30 changes: 30 additions & 0 deletions tools/circleci-prepare-mongooseim-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e
# From https://github.com/esl/mongooseim-docker/pull/49
MIM_DOCKER_VERSION=6b62e9cf26c523e35fe78c57cbae2e8832f555d2

# We use output of generate_vsn, because it does not contain illegal characters, returns
# git tag when building from tag itself, and is unique in any other case
VERSION=`tools/generate_vsn.sh`
DOCKERHUB_TAG=${VERSION}
GIT_REF=`git rev-parse HEAD`
GIT_COMMIT_MSG=`git log --format=%B -n 1 HEAD`

if [ -n "$CIRCLE_PULL_REQUEST" ]; then
# CircleCI doesn't provide PR number in env. var., so we need to extract it from PR URL
# May not work with different service than GitHub
# TODO: Possibly change it to something else during Tide integration
PR_NUMBER=${CIRCLE_PULL_REQUEST##*/}
DOCKERHUB_TAG="PR-${PR_NUMBER}"
elif [ ${CIRCLE_BRANCH} == 'master' ]; then
DOCKERHUB_TAG="latest";
fi

echo "Tag: ${DOCKERHUB_TAG}"

export IMAGE_TAG=${DOCKERHUB_REPO}/mongooseim:${DOCKERHUB_TAG}

git clone https://github.com/esl/mongooseim-docker.git
cd mongooseim-docker
git checkout $MIM_DOCKER_VERSION