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

Circle CI build job for ARM64 #1997

Merged
merged 3 commits into from
Jun 9, 2022
Merged
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
162 changes: 109 additions & 53 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,51 @@
version: 2
version: 2.1
jobs:
"build-arm64":
machine:
enabled: true
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout:
path: /tmp/source/falco
- run:
name: Prepare project
command: |
mkdir -p /tmp/build && mkdir -p /tmp/build/release && \
docker run -e BUILD_TYPE="release" -it -v /tmp/source:/source -v /tmp/build:/build \
falcosecurity/falco-builder:latest \
cmake
- run:
name: Build
command: |
docker run -e BUILD_TYPE="release" -it -v /tmp/source:/source -v /tmp/build:/build \
falcosecurity/falco-builder:latest \
all
- run:
name: Run unit tests
command: |
docker run -e BUILD_TYPE="release" -it -v /tmp/source:/source -v /tmp/build:/build \
falcosecurity/falco-builder:latest \
tests
- run:
name: Build packages
command: |
docker run -e BUILD_TYPE="release" -it -v /tmp/source:/source -v /tmp/build:/build \
falcosecurity/falco-builder:latest \
package
- run:
name: Prepare Artifacts
command: |
mkdir -p /tmp/packages
cp /tmp/build/release/*.deb /tmp/packages
cp /tmp/build/release/*.tar.gz /tmp/packages
cp /tmp/build/release/*.rpm /tmp/packages
- store_artifacts:
path: /tmp/packages
destination: /packages
# Build a statically linked Falco release binary using musl
# This build is 100% static, there are no host dependencies
"build/musl":
"build-musl":
docker:
- image: alpine:3.12
steps:
Expand Down Expand Up @@ -50,7 +93,7 @@ jobs:
- source-static
# Build using our own builder base image using centos 7
# This build is static, dependencies are bundled in the Falco binary
"build/centos7":
"build-centos7":
docker:
- image: falcosecurity/falco-builder:latest
environment:
Expand Down Expand Up @@ -86,7 +129,7 @@ jobs:
path: /tmp/packages
destination: /packages
# Execute integration tests based on the build results coming from the "build/centos7" job
"tests/integration":
"tests-integration":
docker:
- image: falcosecurity/falco-tester:latest
environment:
Expand All @@ -102,7 +145,7 @@ jobs:
command: /usr/bin/entrypoint test
- store_test_results:
path: /build/release/integration-tests-xunit
"tests/integration-static":
"tests-integration-static":
docker:
- image: falcosecurity/falco-tester:latest
environment:
Expand All @@ -120,7 +163,7 @@ jobs:
command: /usr/bin/entrypoint test
- store_test_results:
path: /build-static/release/integration-tests-xunit
"tests/driver-loader/integration":
"tests-driver-loader-integration":
machine:
image: ubuntu-2004:202107-02
steps:
Expand All @@ -130,7 +173,7 @@ jobs:
name: Execute driver-loader integration tests
command: /tmp/ws/source/falco/test/driver-loader/run_test.sh /tmp/ws/build/release/
# Code quality
"quality/static-analysis":
"quality-static-analysis":
docker:
- image: falcosecurity/falco-builder:latest
environment:
Expand All @@ -157,7 +200,7 @@ jobs:
path: /build/release/static-analysis-reports
destination: /static-analysis-reports
# Sign rpm packages
"rpm/sign":
"rpm-sign":
docker:
- image: falcosecurity/falco-builder:latest
steps:
Expand Down Expand Up @@ -188,7 +231,7 @@ jobs:
paths:
- build/release/*.rpm
# Publish the dev packages
"publish/packages-dev":
"publish-packages-dev":
docker:
- image: docker.io/centos:7
steps:
Expand All @@ -206,19 +249,20 @@ jobs:
name: Publish rpm-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -r rpm-dev
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -f /build/release/falco-${FALCO_VERSION}-aarch64.rpm -r rpm-dev
- run:
name: Publish bin-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-bin -f /build/release/falco-${FALCO_VERSION}-x86_64.tar.gz -r bin-dev -a x86_64
/source/falco/scripts/publish-bin -f /build/release/falco-${FALCO_VERSION}-aarch64.tar.gz -r bin-dev -a aarch64
- run:
name: Publish bin-static-dev
command: |
FALCO_VERSION=$(cat /build-static/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
cp -f /build-static/release/falco-${FALCO_VERSION}-x86_64.tar.gz /build-static/release/falco-${FALCO_VERSION}-static-x86_64.tar.gz
/source/falco/scripts/publish-bin -f /build-static/release/falco-${FALCO_VERSION}-static-x86_64.tar.gz -r bin-dev -a x86_64
"publish/packages-deb-dev":
"publish-packages-deb-dev":
docker:
- image: docker.io/debian:stable
steps:
Expand All @@ -235,9 +279,10 @@ jobs:
name: Publish deb-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -r deb-dev
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -f /build/release/falco-${FALCO_VERSION}-aarch64.deb -r deb-dev

# Publish docker packages
"publish/docker-dev":
"publish-docker-dev":
docker:
- image: cimg/base:stable
user: root
Expand All @@ -257,7 +302,7 @@ jobs:
sudo apt update
sudo apt install groff less python3-pip
pip install awscli
- run:
- run:
name: Build and publish no-driver-dev
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
Expand All @@ -282,7 +327,7 @@ jobs:
name: Login to aws ECR
command: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity

- run:
name: Publish no-driver (dev) to AWS
command: |
Expand All @@ -302,7 +347,7 @@ jobs:
docker push public.ecr.aws/falcosecurity/falco-driver-loader:master

# Publish the packages
"publish/packages":
"publish-packages":
docker:
- image: docker.io/centos:7
steps:
Expand All @@ -320,19 +365,20 @@ jobs:
name: Publish rpm
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -r rpm
/source/falco/scripts/publish-rpm -f /build/release/falco-${FALCO_VERSION}-x86_64.rpm -f /build/release/falco-${FALCO_VERSION}-aarch64.rpm -r rpm
- run:
name: Publish bin
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-bin -f /build/release/falco-${FALCO_VERSION}-x86_64.tar.gz -r bin -a x86_64
/source/falco/scripts/publish-bin -f /build/release/falco-${FALCO_VERSION}-aarch64.tar.gz -r bin -a aarch64
- run:
name: Publish bin-static
command: |
FALCO_VERSION=$(cat /build-static/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
cp -f /build-static/release/falco-${FALCO_VERSION}-x86_64.tar.gz /build-static/release/falco-${FALCO_VERSION}-static-x86_64.tar.gz
/source/falco/scripts/publish-bin -f /build-static/release/falco-${FALCO_VERSION}-static-x86_64.tar.gz -r bin -a x86_64
"publish/packages-deb":
"publish-packages-deb":
docker:
- image: docker.io/debian:stable
steps:
Expand All @@ -349,9 +395,9 @@ jobs:
name: Publish deb
command: |
FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//')
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -r deb
/source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -f /build/release/falco-${FALCO_VERSION}-aarch64.deb -r deb
# Publish docker packages
"publish/docker":
"publish-docker":
docker:
- image: cimg/base:stable
user: root
Expand Down Expand Up @@ -398,7 +444,6 @@ jobs:
name: Login to aws ECR
command: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/falcosecurity

- run:
name: Publish no-driver to AWS
command: |
Expand All @@ -425,30 +470,32 @@ jobs:
docker tag falcosecurity/falco-driver-loader:latest public.ecr.aws/falcosecurity/falco-driver-loader:latest
docker push public.ecr.aws/falcosecurity/falco-driver-loader:latest
workflows:
version: 2
version: 2.1
build_and_test:
jobs:
- "build/musl"
- "build/centos7"
- "tests/integration":
- "build-musl"
- "build-arm64"
- "build-centos7"
- "tests-integration":
requires:
- "build/centos7"
- "tests/integration-static":
- "build-centos7"
- "tests-integration-static":
requires:
- "build/musl"
- "tests/driver-loader/integration":
- "build-musl"
- "tests-driver-loader-integration":
requires:
- "build/centos7"
- "rpm/sign":
- "build-centos7"
- "rpm-sign":
context: falco
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "tests/integration"
- "publish/packages-dev":
- "tests-integration"
- "build-arm64"
- "publish-packages-dev":
context:
- falco
- test-infra
Expand All @@ -458,9 +505,9 @@ workflows:
branches:
only: master
requires:
- "rpm/sign"
- "tests/integration-static"
- "publish/packages-deb-dev":
- "rpm-sign"
- "tests-integration-static"
- "publish-packages-deb-dev":
context:
- falco
- test-infra
Expand All @@ -470,72 +517,81 @@ workflows:
branches:
only: master
requires:
- "tests/integration"
- "publish/docker-dev":
- "tests-integration"
- "build-arm64"
- "publish-docker-dev":
context: falco
filters:
tags:
ignore: /.*/
branches:
only: master
requires:
- "publish/packages-dev"
- "publish/packages-deb-dev"
- "tests/driver-loader/integration"
- "publish-packages-dev"
- "publish-packages-deb-dev"
- "tests-driver-loader-integration"
# - "quality/static-analysis" # This is temporarily disabled: https://github.com/falcosecurity/falco/issues/1526
release:
jobs:
- "build/musl":
- "build-musl":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "build-centos7":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "build/centos7":
- "build-arm64":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "rpm/sign":
- "rpm-sign":
context: falco
requires:
- "build/centos7"
- "build-centos7"
- "build-arm64"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/packages":
- "publish-packages":
context:
- falco
- test-infra
requires:
- "build/musl"
- "rpm/sign"
- "build-musl"
- "rpm-sign"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/packages-deb":
- "publish-packages-deb":
context:
- falco
- test-infra
requires:
- "build/centos7"
- "build-centos7"
- "build-arm64"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/docker":
- "publish-docker":
context:
- falco
- test-infra
requires:
- "publish/packages"
- "publish/packages-deb"
- "publish-packages"
- "publish-packages-deb"
filters:
tags:
only: /.*/
Expand Down