Skip to content

Commit

Permalink
Run docker image smoke test for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Mar 16, 2023
1 parent 67d51c8 commit 0b8c4df
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 54 deletions.
76 changes: 51 additions & 25 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,15 @@ commands:
- restore_cache:
key: *BUILD_CACHE_KEY
persist_workspace:
parameters:
pattern:
type: string
default: "*"
steps:
- run: git gc
- persist_to_workspace:
root: ~/project/
paths: ["*"]
paths: [<<parameters.pattern>>]
restore_workspace:
steps:
- attach_workspace: {at: ~/project}
Expand Down Expand Up @@ -331,6 +335,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 +459,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 @@ -943,27 +963,33 @@ workflows:
context: mongooseim-org
requires:

- small_tests_24
- ldap_mnesia_24
- pgsql_mnesia_24
- riak_mnesia_24
- dynamic_domains_pgsql_mnesia_24
- dialyzer_24

# - small_tests_24
# - ldap_mnesia_24
# - pgsql_mnesia_24
# - riak_mnesia_24
# - dynamic_domains_pgsql_mnesia_24
# - dialyzer_24
#
- small_tests_25
- internal_mnesia_25
- pgsql_mnesia_25
- mysql_redis_25
- mssql_mnesia_25
- ldap_mnesia_25
- elasticsearch_and_cassandra_25
- dynamic_domains_pgsql_mnesia_25
- dynamic_domains_mysql_redis_25
- dynamic_domains_mssql_mnesia_25
- dialyzer_25
# - internal_mnesia_25
# - pgsql_mnesia_25
# - mysql_redis_25
# - mssql_mnesia_25
# - ldap_mnesia_25
# - elasticsearch_and_cassandra_25
# - dynamic_domains_pgsql_mnesia_25
# - dynamic_domains_mysql_redis_25
# - dynamic_domains_mssql_mnesia_25
# - dialyzer_25
- small_tests_25_arm64

- xref
- edoc

#
# - xref
# - edoc
#
filters: *all_tags
- docker_smoke_test:
requires:
- docker_build_and_ship
- docker_smoke_test_arm64:
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

0 comments on commit 0b8c4df

Please sign in to comment.