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

Run integration tests with linux/arm64 platform #114

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
70 changes: 66 additions & 4 deletions .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ jobs:
name: images-windows
path: images-windows.tar.gz

integration:
name: integration (linux)
integration-linux-amd64:
name: integration (linux-amd64)
runs-on: ubuntu-20.04
needs: [cache-deps, images]

Expand Down Expand Up @@ -275,6 +275,68 @@ jobs:
CICD_TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
run: ./.github/workflows/scripts/split.sh | xargs ./test/integration/test.sh

integration-linux-arm64:
name: integration (linux-arm64)
runs-on: ubuntu-20.04
needs: [cache-deps, images]

permissions:
contents: read

strategy:
fail-fast: false
matrix:
num_runners: [5]
runner_id: [1, 2, 3, 4, 5]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# The "upgrade" integration test needs the history to ensure
# that the version number in the source code has been bumped as
# expected. This action does not fetch tags unless we supply a
# fetch depth of zero.
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Install regctl
uses: regclient/actions/regctl-installer@main
- name: Load cached deps
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Load cached build tools
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-tools-${{ github.sha }}
restore-keys: |
${{ runner.os }}-tools-
- name: Download archived images
uses: actions/download-artifact@v3
with:
name: images
path: .
- name: Load archived images
run: |
tar xvf images.tar.gz
PLATFORM=linux/arm64 make load-images
- name: Run integration tests
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu20.04
env: |
NUM_RUNNERS: ${{ matrix.num_runners }}
THIS_RUNNER: ${{ matrix.runner_id }}
TERM: dumb
CICD_TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
./.github/workflows/scripts/split.sh | xargs ./test/integration/test.sh

integration-windows:
name: integration (windows)
runs-on: windows-2022
Expand Down Expand Up @@ -488,8 +550,8 @@ jobs:

success:
runs-on: ubuntu-20.04
needs: [lint, unit-test, unit-test-race-detector, artifacts, integration,
lint-windows, unit-test-windows, artifact-windows, integration-windows]
needs: [lint, unit-test, unit-test-race-detector, artifacts, integration-linux-amd64,
integration-linux-arm64, lint-windows, unit-test-windows, artifact-windows, integration-windows]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/load-oci-archives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ OCI_IMAGES=(
echo "Importing ${OCI_IMAGES[*]} into docker".
for img in "${OCI_IMAGES[@]}"; do
oci_dir="ocidir://${ROOTDIR}oci/${img}"
platform_tar="${img}-${PLATFORM}-image.tar"
platform_tar="${img}-image.tar"

# regclient works with directories rather than tars, so import the OCI tar to a directory
regctl image import "$oci_dir" "${img}-image.tar"
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Agent struct {
// This method initializes the agent, including its plugins,
// and then blocks on the main event loop.
func (a *Agent) Run(ctx context.Context) error {
a.c.Log.Infof("Starting agent with data directory: %q", a.c.DataDir)
a.c.Log.WithField("arch", runtime.GOARCH).WithField("data_directory", a.c.DataDir).Info("Starting SPIRE Agent")
if err := diskutil.CreateDataDirectory(a.c.DataDir); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Server struct {
// This method initializes the server, including its plugins,
// and then blocks until it's shut down or an error is encountered.
func (s *Server) Run(ctx context.Context) error {
s.config.Log.WithField("arch", runtime.GOARCH).Info("Starting SPIRE Server")
if err := s.run(ctx); err != nil {
s.config.Log.WithError(err).Error("Fatal run error")
return err
Expand Down