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

aarch64 CI test #829

Open
wants to merge 151 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
b3da8e8
secrets!
pfilipko1 Jul 19, 2023
dd3f464
correct tag
pfilipko1 Aug 8, 2023
0d865ad
correct tag
pfilipko1 Aug 8, 2023
7dd2ae3
correct tag
pfilipko1 Aug 8, 2023
06ac8a0
build: Use https link instead of ftp
Jongy Aug 8, 2023
d7caa06
Merge remote-tracking branch 'origin/no-ftp' into aarch64-CI
pfilipko1 Aug 8, 2023
ef0f2cd
different tag approach
pfilipko1 Aug 8, 2023
1604ee5
python
pfilipko1 Aug 8, 2023
d971d94
python
pfilipko1 Aug 8, 2023
d293c70
python
pfilipko1 Aug 8, 2023
a877bf8
python
pfilipko1 Aug 8, 2023
1f5258e
python
pfilipko1 Aug 8, 2023
c23a3f6
python
pfilipko1 Aug 8, 2023
604f76b
python
pfilipko1 Aug 8, 2023
d0b6e7f
python
pfilipko1 Aug 8, 2023
5dbc3d1
apt install
pfilipko1 Aug 8, 2023
51a9819
apt install
pfilipko1 Aug 8, 2023
3a62302
apt install
pfilipko1 Aug 9, 2023
edfa4f8
apt install
pfilipko1 Aug 9, 2023
cfc3cb4
apt install
pfilipko1 Aug 9, 2023
b633cdc
apt install
pfilipko1 Aug 9, 2023
9582dbe
apt install
pfilipko1 Aug 9, 2023
e507d6c
apt install
pfilipko1 Aug 9, 2023
9f0e893
apt install
pfilipko1 Aug 9, 2023
a9ac503
apt install
pfilipko1 Aug 9, 2023
89388c1
apt install
pfilipko1 Aug 9, 2023
2815817
apt install
pfilipko1 Aug 9, 2023
80ffc3c
apt install
pfilipko1 Aug 9, 2023
960e7a4
apt install
pfilipko1 Aug 9, 2023
52b9ffb
apt install
pfilipko1 Aug 9, 2023
586e2e6
apt install
pfilipko1 Aug 9, 2023
9f72251
apt install
pfilipko1 Aug 9, 2023
33eacc3
apt install
pfilipko1 Aug 9, 2023
5524ea5
apt install
pfilipko1 Aug 9, 2023
ceeb6f6
pytest?
pfilipko1 Aug 9, 2023
36c6c0f
pytest?
pfilipko1 Aug 9, 2023
3437f88
pytest?
pfilipko1 Aug 10, 2023
c316a3b
pytest?
pfilipko1 Aug 10, 2023
4eb9433
pytest?
pfilipko1 Aug 10, 2023
b279df1
pytest?
pfilipko1 Aug 10, 2023
74f6e20
pytest?
pfilipko1 Aug 10, 2023
46ec913
pytest?
pfilipko1 Aug 10, 2023
8497de2
pytest?
pfilipko1 Aug 10, 2023
68bdeef
pytest?
pfilipko1 Aug 10, 2023
04354c7
pytest?
pfilipko1 Aug 10, 2023
d3b5e9c
pytest?
pfilipko1 Aug 10, 2023
a3811c8
pytest?
pfilipko1 Aug 10, 2023
356bc6f
PYTHONHOME?
pfilipko1 Aug 10, 2023
0b1fc9b
PYTHONHOME?
pfilipko1 Aug 10, 2023
4353bac
PYTHONHOME?
pfilipko1 Aug 10, 2023
1617c95
PYTHONHOME?
pfilipko1 Aug 10, 2023
7672787
PYTHONHOME?
pfilipko1 Aug 10, 2023
ccef714
PYTHONPATH?
pfilipko1 Aug 10, 2023
8985c8f
PYTHONPATH?
pfilipko1 Aug 10, 2023
5045998
PYTHONPATH?
pfilipko1 Aug 10, 2023
9767996
PYTHONPATH?
pfilipko1 Aug 10, 2023
fdd6084
PYTHONPATH?
pfilipko1 Aug 10, 2023
0288e87
PYTHONPATH?
pfilipko1 Aug 10, 2023
e258e9a
PYTHONPATH?
pfilipko1 Aug 10, 2023
b0420e7
PYTHONPATH?
pfilipko1 Aug 10, 2023
75e716c
PYTHONPATH?
pfilipko1 Aug 10, 2023
3664265
PYTHONPATH?
pfilipko1 Aug 10, 2023
620b8d0
BUILD MAN
pfilipko1 Aug 10, 2023
00437e3
BUILD MAN
pfilipko1 Aug 10, 2023
b93f1b3
BUILD MAN
pfilipko1 Aug 10, 2023
c724215
BUILD MAN
pfilipko1 Aug 10, 2023
2e1dd7f
Merge remote-tracking branch 'origin/master' into aarch64-CI
pfilipko1 Aug 10, 2023
f56031c
ignore installed
pfilipko1 Aug 11, 2023
81d8897
other flows back
pfilipko1 Aug 11, 2023
c6c61ae
other flows back
pfilipko1 Aug 11, 2023
fa85bd9
other flows back
pfilipko1 Aug 11, 2023
84834c2
other flows back
pfilipko1 Aug 11, 2023
145fe0b
Merge remote-tracking branch 'origin/master' into aarch64-CI
pfilipko1 Aug 16, 2023
daac8bc
is it working with current master?
pfilipko1 Aug 16, 2023
0ee2fa1
is it working with current master?
pfilipko1 Aug 16, 2023
0bb6425
is it working with current master?
pfilipko1 Aug 16, 2023
0370890
is it working with current master?
pfilipko1 Aug 16, 2023
da0ff0d
is it working with current master?
pfilipko1 Aug 16, 2023
f07d9a1
is it working with current master?
pfilipko1 Aug 16, 2023
f9607af
is it working with current master?[A
pfilipko1 Aug 16, 2023
c2dc530
Update build-container-and-test-aarch64.yml
pfilipko1 Aug 16, 2023
0c04986
lets extract resources
pfilipko1 Aug 17, 2023
236ddfa
Merge branch 'aarch64-CI' of https://github.com/Granulate/gprofiler i…
pfilipko1 Aug 17, 2023
95019ca
lets extract resources
pfilipko1 Aug 17, 2023
3f1f2a3
lets extract resources
pfilipko1 Aug 17, 2023
e3bfa84
lets extract resources
pfilipko1 Aug 17, 2023
8546a66
lets extract resources
pfilipko1 Aug 17, 2023
217a428
lets extract resources
pfilipko1 Aug 17, 2023
e6894c8
lets extract resources
pfilipko1 Aug 17, 2023
077788f
lets extract resources
pfilipko1 Aug 17, 2023
3a1b3a1
wget installed manually
pfilipko1 Aug 22, 2023
b9b98b2
new zlib version
pfilipko1 Aug 22, 2023
4bbd140
how correct is that
pfilipko1 Aug 22, 2023
bd135c4
how correct is that
pfilipko1 Aug 22, 2023
5eac8c7
how correct is that
pfilipko1 Aug 22, 2023
47dbaa8
how correct is that
pfilipko1 Aug 22, 2023
deed41b
how correct is that
pfilipko1 Aug 22, 2023
1d82edf
Update build-container-and-test-aarch64.yml
pfilipko1 Aug 22, 2023
2369a97
how correct is that
pfilipko1 Aug 22, 2023
2322175
how correct is that
pfilipko1 Aug 22, 2023
9fe633d
how correct is that
pfilipko1 Aug 22, 2023
c88bd12
how correct is that
pfilipko1 Aug 22, 2023
e9137e1
how correct is that
pfilipko1 Aug 22, 2023
227edbb
how correct is that
pfilipko1 Aug 23, 2023
0167c94
how correct is that
pfilipko1 Aug 23, 2023
78b9974
how correct is that
pfilipko1 Aug 23, 2023
3a45b06
how correct is that
pfilipko1 Aug 23, 2023
3d90538
how correct is that
pfilipko1 Aug 23, 2023
307441e
how correct is that
pfilipko1 Aug 23, 2023
20863a8
how correct is that
pfilipko1 Aug 23, 2023
ab49a8c
how correct is that
pfilipko1 Aug 24, 2023
e251f4e
Merge remote-tracking branch 'origin/master' into aarch64-CI
pfilipko1 Aug 24, 2023
8d8f71c
how correct is that
pfilipko1 Aug 24, 2023
7c7af02
how correct is that
pfilipko1 Aug 24, 2023
346d983
how correct is that
pfilipko1 Aug 24, 2023
f481476
how correct is that
pfilipko1 Aug 25, 2023
5552817
pythonpath?
pfilipko1 Aug 26, 2023
5b29cda
pythonpath?
pfilipko1 Aug 26, 2023
83887a0
pythonpath?
pfilipko1 Aug 26, 2023
f5ecbd2
lets check the PYTHONPATH
pfilipko1 Aug 27, 2023
db31537
lets check the PYTHONPATH
pfilipko1 Aug 27, 2023
283dccf
lets check the PYTHONPATH
pfilipko1 Aug 27, 2023
0ca35c8
lets check the PYTHONPATH
pfilipko1 Aug 27, 2023
82c0681
lets check the PYTHONPATH
pfilipko1 Aug 27, 2023
487ea66
venv approach
pfilipko1 Aug 27, 2023
eaaf31c
Update build-container-and-test-aarch64.yml
pfilipko1 Aug 27, 2023
c10ee6c
show me the error mr gprofiler
pfilipko1 Aug 29, 2023
70976d7
Merge branch 'aarch64-CI' of https://github.com/Granulate/gprofiler i…
pfilipko1 Aug 29, 2023
363a4bf
show me the error mr gprofiler
pfilipko1 Aug 29, 2023
00a1106
one more test xfailed
pfilipko1 Aug 30, 2023
f13f92b
one more test xfailed
pfilipko1 Aug 30, 2023
62a72b2
one more test xfailed
pfilipko1 Aug 30, 2023
39036f6
one more test xfailed
pfilipko1 Aug 31, 2023
6c53d00
one more test xfailed
pfilipko1 Aug 31, 2023
9f68cf7
merge with master
pfilipko1 Sep 1, 2023
c1b8a96
scipt removed
pfilipko1 Sep 1, 2023
a4c35dd
output type
pfilipko1 Sep 1, 2023
9888f76
buildx?
pfilipko1 Sep 4, 2023
deb7715
buildx? requirements?
pfilipko1 Sep 4, 2023
cd27bc8
buildx? requirements?
pfilipko1 Sep 4, 2023
7fd7d14
executable aarch tests
pfilipko1 Sep 5, 2023
0e76c21
Merge remote-tracking branch 'origin/master' into aarch64-CI
pfilipko1 Sep 12, 2023
fa4ce53
stupid aarch64 ubuntu
pfilipko1 Sep 12, 2023
933546b
cre
roi-granulate Nov 12, 2023
8bbde84
?
roi-granulate Nov 12, 2023
4111253
remove sudo
roi-granulate Nov 12, 2023
ac7e9ab
?
roi-granulate Nov 12, 2023
8115d7b
?
roi-granulate Nov 12, 2023
bff0e6a
merge
Jongy Nov 24, 2023
bed61f3
fixes
Jongy Nov 24, 2023
f5c86af
fix
Jongy Nov 24, 2023
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
172 changes: 133 additions & 39 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:

test-executable-x64:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
needs: build-executable-x64
runs-on: ubuntu-20.04 # the tests which use ruby/node/python etc and run at non-root privs, fail to read the files when running
# on ubuntu-22.04/ubuntu-latest:
# stderr: ruby: Permission denied -- /home/runner/work/gprofiler/gprofiler/tests/containers/ruby/fibonacci.rb (LoadError)
needs: build-executable-x64
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -107,7 +107,6 @@ jobs:
NO_APT_INSTALL=1 ./tests/test.sh --exec-container-image ${{ matrix.containers }} --executable dist/gprofiler -k test_executable

build-executable-aarch64:
if: startsWith(github.ref, 'refs/tags/')
runs-on:
- self-hosted
- public
Expand All @@ -122,11 +121,6 @@ jobs:
- name: Set up requirements
run: scripts/setup_runner_requirements.sh

- name: Get and verify tag value
Jongy marked this conversation as resolved.
Show resolved Hide resolved
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
./scripts/cmp_tags.sh

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -143,6 +137,63 @@ jobs:
path: output/
retention-days: 1

test-executable-aarch64:
if: !startsWith(github.ref, 'refs/tags/')
needs: build-container-aarch64
runs-on:
- self-hosted
- public
- ARM64
strategy:
fail-fast: false
matrix:
containers:
- alpine
- ubuntu:20.04
- ubuntu:20.10
- ubuntu:22.04
- centos:7
- centos:8
- debian:8
- debian:9
- debian:10
- debian:11
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install Java
uses: actions/setup-java@v1
with:
java-version: '8.0.275'
java-package: jdk
architecture: x64

- name: Install Node.JS
uses: actions/setup-node@v2
with:
# same version as used in tests/containers/nodejs/Dockerfile
node-version: 10.x

- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true

- name: Download the executable from previous job
uses: actions/download-artifact@v2
with:
name: gprofiler_aarch64
path: dist/

- name: Run gProfiler tests
run: |
mv dist/gprofiler_aarch64 dist/gprofiler
chmod +x dist/gprofiler
NO_APT_INSTALL=1 ./tests/test.sh --exec-container-image ${{ matrix.containers }} --executable dist/gprofiler -k test_executable

deploy-executable:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -212,9 +263,7 @@ jobs:
test-container-x64:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
needs: build-container-x64

runs-on: ubuntu-20.04 # for 3.10.0 python tag

strategy:
fail-fast: false # helps detecting flakiness / errors specific to one Python version
matrix:
Expand Down Expand Up @@ -274,50 +323,95 @@ jobs:
run: NO_APT_INSTALL=1 ./tests/test.sh --ignore=tests/test_executable.py

build-container-aarch64:
if: startsWith(github.ref, 'refs/tags/')
needs: build-executable-aarch64
runs-on:
- self-hosted
- public
- ARM64
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
Jongy marked this conversation as resolved.
Show resolved Hide resolved
submodules: true
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Set up runner requirements
run: scripts/setup_runner_requirements.sh
Jongy marked this conversation as resolved.
Show resolved Hide resolved
- name: setup runner requirements
run: ./scripts/setup_runner_requirements.sh

- name: Get and verify tag value
Jongy marked this conversation as resolved.
Show resolved Hide resolved
run: ./scripts/verify_tag.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need sudo?

- name: Get and verify tag value
run: sudo ./scripts/verify_tag.sh

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Download executables from the previous job
uses: actions/download-artifact@v2
with:
name: gprofiler_aarch64
path: output/
- name: Download executables from the previous job
uses: actions/download-artifact@v2
with:
name: gprofiler_aarch64
path: output/

# TODO: Add docker layer caching when GitHub Actions cache is stabilized and works good with "satackey/[email protected]"
- name: Build and push
run: |
set -x
# the tests need the gprofiler image built (from Dockerfile). I run it separately here, because "docker build" prints the build logs
# more nicely. the tests will then be able to use the built image.
- name: Build gProfiler image
run: ./scripts/build_aarch64_container.sh -t gprofiler_aarch64 --output type=docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #790, the gProfiler image is a blank image that contains the executable.

Please see the job build-container-x64 - it has

    needs:
      - build-executable-x64

to make sure the CI runs it after the exe is built, and then it uses the same binary exe built earlier to put it into the image, as done here:

      run: ./scripts/build_x86_64_container.sh --skip-exe-build --build-arg EXE_PATH=output/gprofiler_x86_64 -t gprofiler_x86_64

Please do the same here - by not passing --skip-exe-build you are rebuilding it unnecessarily, and plus, in any case, we'd like them to use the same file exactly.


- name: Export gProfiler image
run: mkdir -p output && docker image save gprofiler_aarch64 > output/gprofiler_aarch64.img

- name: Upload the image artifact
uses: actions/upload-artifact@v2
with:
name: gprofiler_aarch64.img
path: output/
retention-days: 1

test-container-aarch64:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
needs: build-container-aarch64
runs-on:
- self-hosted
- public
- ARM64
steps:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true

- name: Download the executable from previous job
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Download the image from previous job", no?

uses: actions/download-artifact@v2
with:
name: gprofiler_aarch64.img
path: output/

- name: Import gProfiler image
run: docker image load < output/gprofiler_aarch64.img

- name: Extract resources from gProfiler executable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After you follow my suggestion from https://github.com/Granulate/gprofiler/pull/829/files#r1314022332 you can also simplify the code here to use the gProfiler executable instead of image - so it can run the exe and don't need the docker, the mappings etc, just like the x86_64 job.

run: sudo docker run -v $PWD/gprofiler/resources:/app/gprofiler/resources gprofiler_aarch64 extract-resources --resources-dest=/app/gprofiler/resources

BASE_IMAGE="${{ env.GH_REPO }}:${{ env.RELEASE_VERSION }}"
AARCH64_IMAGE="$BASE_IMAGE-aarch64"

# build & push Aarch64
./scripts/build_aarch64_container.sh --skip-exe-build --build-arg EXE_PATH=output/gprofiler_aarch64 -t "$AARCH64_IMAGE" --push
# TODO: Add docker layer caching when GitHub Actions cache is stabilized and works good with "satackey/[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not relevant here, remove pls

- name: Run gProfiler tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x86_64 tests run on 3.8, 3.9, 3.10.

I'm actually planning to deprecate 3.8 and 3.9 soon so there's no need to test all 3 - let's focus on 3.10.

Can you use the GH action to install python? i.e

    steps:
      - name: Set up Python 3.10
        uses: actions/setup-python@v2
        with:
          python-version: "3.10"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what, let's actually do it with strategy like done in the x86_64 tests:

    strategy:
      matrix:
        python-version:
          - "3.10"

this is extendable for a future where we'll want to add 3.11, and also shows up nicely in the job name (gonna be "test-container-aarch64 (3.10)" like we have for the x86 ones)

run: |
sudo python3 -m pip install virtualenv
sudo virtualenv --python python3.8 aarch64-venv
sudo chown -R ${USER} aarch64-venv
sudo chmod -R a+rX aarch64-venv
source aarch64-venv/bin/activate
./tests/test.sh --ignore=tests/test_executable.py

deploy-container:
Jongy marked this conversation as resolved.
Show resolved Hide resolved
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion scripts/cmp_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -euo pipefail
# Used in CI and checks that last pushed tag is greater than last existing tag.
# Using python package 'cmp_version' to do the compare work

pip install cmp_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need it?

sudo pip install cmp_version
TAGS=$(git tag --sort=creatordate | tail -2)

# shellcheck disable=SC2206 # expansion is desired here to get array values
Expand Down
4 changes: 3 additions & 1 deletion tests/test_preconditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from docker.models.containers import Container
from docker.models.images import Image

from tests.utils import start_gprofiler_in_container_for_one_session, wait_for_container, wait_for_log
from tests.utils import is_aarch64, start_gprofiler_in_container_for_one_session, wait_for_container, wait_for_log


def start_gprofiler(
Expand Down Expand Up @@ -84,6 +84,8 @@ def test_not_root(
"""
gProfiler must run as root and should complain otherwise.
"""
if is_aarch64():
pytest.xfail("This combination fails on aarch64, see https://github.com/Granulate/gprofiler/issues/849")
gprofiler = start_gprofiler(docker_client, gprofiler_docker_image, user=42)

# exits without an error
Expand Down
Loading