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

Fix arm tests on Python PostCommit #28740

Merged
merged 7 commits into from
Oct 4, 2023
Merged
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
22 changes: 18 additions & 4 deletions .github/workflows/beam_PostCommit_Python_Arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
name: PostCommit Python Arm

on:
# issue_comment:
# types: [created]
# schedule:
# - cron: '0 */6 * * *'
issue_comment:
types: [created]
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
Expand Down Expand Up @@ -81,21 +81,35 @@ jobs:
run: |
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: GCloud Docker credential helper
run: |
gcloud auth configure-docker us.gcr.io
- name: Set PY_VER_CLEAN
id: set_py_ver_clean
run: |
PY_VER=${{ matrix.python_version }}
PY_VER_CLEAN=${PY_VER//.}
echo "py_ver_clean=$PY_VER_CLEAN" >> $GITHUB_OUTPUT
- name: Generate TAG unique variable based on timestamp
id: set_tag
run: echo "TAG=$(date +'%Y%m%d-%H%M%S%N')" >> $GITHUB_OUTPUT
- name: run PostCommit Python ${{ matrix.python_version }} script
uses: ./.github/actions/gradle-command-self-hosted-action
with:
gradle-command: :sdks:python:test-suites:dataflow:py${{steps.set_py_ver_clean.outputs.py_ver_clean}}:postCommitArmIT
arguments: |
-PuseWheelDistribution \
-PpythonVersion=${{ matrix.python_version }} \
-Pcontainer-architecture-list=arm64,amd64 \
-Pdocker-repository-root=us.gcr.io/apache-beam-testing/github-actions \
-Pdocker-tag=${{ steps.set_tag.outputs.TAG }} \
-Ppush-containers \
env:
CLOUDSDK_CONFIG: ${{ env.KUBELET_GCLOUD_CONFIG_PATH}}
MULTIARCH_TAG: ${{ steps.set_tag.outputs.TAG }}
USER: github-actions
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
Expand Down
9 changes: 9 additions & 0 deletions sdks/python/scripts/run_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SUITE=""
COLLECT_MARKERS=
REQUIREMENTS_FILE=""
ARCH=""
PY_VERSION=""

# Default test (pytest) options.
# Run WordCountIT.test_wordcount_it by default if no test options are
Expand Down Expand Up @@ -169,6 +170,11 @@ case $key in
shift # past argument
shift # past value
;;
--py_version)
PY_VERSION="$2"
shift # past argument
shift # past value
;;
*) # unknown option
echo "Unknown option: $1"
exit 1
Expand Down Expand Up @@ -242,6 +248,9 @@ if [[ -z $PIPELINE_OPTS ]]; then

if [[ "$ARCH" == "ARM" ]]; then
opts+=("--machine_type=t2a-standard-1")

IMAGE_NAME="beam_python${PY_VERSION}_sdk"
opts+=("--sdk_container_image=us.gcr.io/$PROJECT/$USER/$IMAGE_NAME:$MULTIARCH_TAG")
fi

if [[ ! -z "$KMS_KEY_NAME" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions sdks/python/test-suites/dataflow/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ task postCommitIT {
}

task postCommitArmIT {
def pyversion = "${project.ext.pythonVersion.replace('.', '')}"
dependsOn 'initializeForDataflowJob'
dependsOn ":sdks:python:container:py${pyversion}:docker"

doLast {
def testOpts = basicPytestOpts + ["--numprocesses=8", "--dist=loadfile"]
Expand All @@ -153,6 +155,7 @@ task postCommitArmIT {
"sdk_location": project.ext.sdkLocation,
"suite": "postCommitIT-df${pythonVersionSuffix}",
"collect": "it_postcommit",
"py_version": project.ext.pythonVersion,
"arch": "ARM"
]
def cmdArgs = mapToArgString(argMap)
Expand Down
Loading