Skip to content

Commit

Permalink
update travis for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
anmol372 committed Sep 24, 2024
1 parent 79a6739 commit e985e2b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 36 deletions.
34 changes: 4 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
os: linux
arch: arm64-graviton2
language: c++
compiler:
- gcc
services: docker
os: linux
dist: jammy

jobs:
include:
- stage: check
if: tag IS NOT present
addons:
apt:
packages:
- libuv1-dev
- libboost-all-dev
- rapidjson-dev
- autoconf
- openjdk-11-jdk-headless
- maven
- lcov
- cmake
- libunbound8
- libunbound-dev
# In case we need to run perf, install the below in bionic:
# linux-tools-common
# linux-tools-4.15.0-72-generic
install: bash ./.travis/install-dependencies.sh
before_script: sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
env:
- TEST_SUITE=travis-build.sh
script: bash ./.travis/$TEST_SUITE
after_success:
- bash ./.travis/coveralls-deploy.sh

- stage: build-images
if: tag IS present
before_install:
- mkdir -vp ~/.docker/cli-plugins/
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
Expand All @@ -46,8 +20,8 @@ jobs:
- export UPSTREAM_ID=81c2369
script:
- echo "Skip running UTs"
- git clone http://www.github.com/noironetworks/cicd -b main /tmp/cicd
- /tmp/cicd/travis/check-git-tag.sh; RETURN_CODE=$? ; if [ $RETURN_CODE -eq 140 ]; then travis_terminate 0; elif [ $RETURN_CODE -ne 0 ]; then travis_terminate $RETURN_CODE; fi
- git clone http://www.github.com/noironetworks/cicd -b arm64-build /tmp/cicd
#- /tmp/cicd/travis/check-git-tag.sh; RETURN_CODE=$? ; if [ $RETURN_CODE -eq 140 ]; then travis_terminate 0; elif [ $RETURN_CODE -ne 0 ]; then travis_terminate $RETURN_CODE; fi
- /tmp/cicd/travis/build-push-opflex-images.sh || travis_terminate 1

cache:
Expand Down
2 changes: 1 addition & 1 deletion docker/travis/Dockerfile-opflex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
RUN microdnf install -y yum yum-utils
RUN yum update -y --nogpgcheck --disablerepo=* --repofrompath=centos,https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/os --repofrompath=centos-app,https://mirror.stream.centos.org/9-stream/AppStream/aarch64/os && rm -rf /var/cache/yum
RUN yum install -y --nogpgcheck --disablerepo=* --repofrompath=centos,https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/os --repofrompath=centos-app,https://mirror.stream.centos.org/9-stream/AppStream/aarch64/os \
Expand Down
4 changes: 2 additions & 2 deletions docker/travis/Dockerfile-opflex-build-base
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
ENV ROOT=/usr/local
ARG make_args=-j1
RUN microdnf install -y yum yum-utils \
&& yum-config-manager --add-repo=https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/os \
&& yum-config-manager --add-repo=https://mirror.stream.centos.org/9-stream/AppStream/aarch64/os \
&& yum-config-manager --add-repo=https://mirror.stream.centos.org/9-stream/CRB/aarch64/os/ \
&& yum-config-manager --add-repo=https://mirror.stream.centos.org/9-stream/AppStream/aarch64/debug/tree \
&& yum --nogpgcheck -y update
&& yum --nogpgcheck -y update --allowerasing
RUN yum --nogpgcheck install -y \
libtool pkgconfig autoconf automake make cmake file python3-six \
openssl-devel git gcc gcc-c++ diffutils python3-devel \
Expand Down
9 changes: 6 additions & 3 deletions docker/travis/build-opflex-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ set -Eeuxo pipefail

echo "starting opflex build"

docker buildx build $BUILDARG $SECOPT --platform linux/arm64 -t $DOCKER_HUB_ID/opflex-build-base:$DOCKER_TAG -f $DOCKER_DIR/Dockerfile-opflex-build-base . &> /tmp/opflex-build-base.log &
docker build $BUILDARG $SECOPT -t $DOCKER_HUB_ID/opflex-build-base:$DOCKER_TAG -f $DOCKER_DIR/Dockerfile-opflex-build-base . &> /tmp/opflex-build-base.log &
while [ ! -f /tmp/opflex-build-base.log ]; do sleep 10; done
tail -f /tmp/opflex-build-base.log | awk 'NR%100-1==0' &

#while [[ "$(docker images -q $DOCKER_HUB_ID/opflex-build-base:$DOCKER_TAG 2> /dev/null)" == ""]] && [[ "$(pgrep -x 'docker' 2> /dev/null)" != '' ]]; do sleep 60; done
while [[ "$(pgrep -x 'docker' 2> /dev/null)" != '' ]]; do sleep 60; done

# Display the entire log at the end
cat /tmp/opflex-build-base.log

#docker push $DOCKER_HUB_ID/opflex-build-base:$DOCKER_TAG
#docker pull quay.io/noirolabs/opflex-build-base:sumit-kmr2-test

Expand All @@ -45,7 +48,7 @@ tar cvfz opflex.tgz opflex
cp opflex.tgz opflex/
popd

docker buildx build $BUILDARG --build-arg DOCKER_HUB_ID=$DOCKER_HUB_ID --build-arg DOCKER_TAG=$DOCKER_TAG $SECOPT --platform linux/arm64 -t $DOCKER_HUB_ID/opflex-build:$DOCKER_TAG -f $DOCKER_DIR/Dockerfile-opflex-build $OPFLEX_DIR &> /tmp/opflex-build.log &
docker build $BUILDARG --build-arg DOCKER_HUB_ID=$DOCKER_HUB_ID --build-arg DOCKER_TAG=$DOCKER_TAG $SECOPT -t $DOCKER_HUB_ID/opflex-build:$DOCKER_TAG -f $DOCKER_DIR/Dockerfile-opflex-build $OPFLEX_DIR &> /tmp/opflex-build.log &
#docker buildx build $SECOPT --platform linux/arm64 -t $DOCKER_HUB_ID/opflex-build:$DOCKER_TAG -f $DOCKER_DIR/Dockerfile-opflex-build $OPFLEX_DIR
##docker push $DOCKER_HUB_ID/opflex-build$DOCKER_TAG
while [ ! -f /tmp/opflex-build.log ]; do sleep 10; done
Expand Down Expand Up @@ -124,4 +127,4 @@ mkdir build/opflex/dist/licenses
cp $DOCKER_DIR/../licenses/* build/opflex/dist/licenses

#######################################################################################
docker buildx build $BUILDARG --platform linux/arm64 -t $DOCKER_HUB_ID/opflex:$DOCKER_TAG -f ./build/opflex/dist/Dockerfile-opflex build/opflex/dist
docker build $BUILDARG -t $DOCKER_HUB_ID/opflex:$DOCKER_TAG -f ./build/opflex/dist/Dockerfile-opflex build/opflex/dist

0 comments on commit e985e2b

Please sign in to comment.