Skip to content

fix: migrate.py issues with the new scheduler #4336

fix: migrate.py issues with the new scheduler

fix: migrate.py issues with the new scheduler #4336

Workflow file for this run

name: Build and Test
concurrency:
group: build-and-test-${{ github.workflow }}-${{ github.ref_name }}-${{ github.event_name }}
cancel-in-progress: true
on:
pull_request:
merge_group:
workflow_dispatch:
inputs:
arch:
description: "Architecture to build the image for (amd64/arm64)"
type: choice
default: "amd64"
options:
- "amd64"
- "arm64"
memgraph_version:
description: "Memgraph version built into this image (format: X.Y.Z). You can leave empty if using custom download link."
type: string
required: false
memgraph_download_link:
description: "Memgraph package download link. Leave empty to use the official download link."
type: string
required: false
memgraph_ref:
type: string
description: "Memgraph submodule branch to build query modules from"
default: 'master'
memgraph_ref_update:
type: boolean
description: "Update Memgraph submodule to the latest commit"
default: true
jobs:
# setup some variables for the default memgraph download link/version
TestVariables:
runs-on: ["self-hosted"]
outputs:
mage_version: ${{ steps.compute.outputs.mage_version }}
memgraph_version: ${{ steps.compute.outputs.memgraph_version }}
memgraph_commit: ${{ steps.compute.outputs.memgraph_commit }}
build_date: ${{ steps.compute.outputs.build_date }}
binary_name_base: ${{ steps.compute.outputs.binary_name_base }}
arm_binary_url: ${{ steps.compute.outputs.arm_binary_url }}
x86_binary_url: ${{ steps.compute.outputs.x86_binary_url }}
run_tests: ${{ steps.check_aws_credentials.outputs.AWS_CREDENTIALS_AVAILABLE == 'true' }}
steps:
- name: Set up repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# NOTE: this is a workaround to allow checks to pass before adding to merge group (where tests
# will be able to run with secrets enabled) - This will be corrected in the monorepo as part
# of the external contribution diff workflow.
- name: Check AWS credentials availability
id: check_aws_credentials
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
run: |
if [ -n "$AWS_ACCESS_KEY_ID" ]; then
echo "✅ AWS_ACCESS_KEY_ID is set"
AWS_CREDENTIALS_AVAILABLE=true
else
echo "⚠️ AWS_ACCESS_KEY_ID is not set"
AWS_CREDENTIALS_AVAILABLE=false
fi
echo "AWS_CREDENTIALS_AVAILABLE=${AWS_CREDENTIALS_AVAILABLE}" >> $GITHUB_OUTPUT
- name: Configure AWS Credentials
if: ${{ steps.check_aws_credentials.outputs.AWS_CREDENTIALS_AVAILABLE == 'true' }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Compute variables using Python script
if: ${{ steps.check_aws_credentials.outputs.AWS_CREDENTIALS_AVAILABLE == 'true' }}
id: compute
run: |
read mage_version memgraph_version memgraph_commit build_date < <(python3 scripts/daily_build_vars.py)
echo "mage_version=${mage_version}" >> $GITHUB_OUTPUT
echo "memgraph_version=${memgraph_version}" >> $GITHUB_OUTPUT
echo "memgraph_commit=${memgraph_commit}" >> $GITHUB_OUTPUT
echo "build_date=${build_date}" >> $GITHUB_OUTPUT
binary_name_base=$(python3 -c "import urllib.parse; print(urllib.parse.quote('memgraph_' + '$memgraph_version' + '-1'))")
echo "binary_name_base=${binary_name_base}" >> $GITHUB_OUTPUT
arm_binary_url="https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/daily-build/memgraph/${build_date}/ubuntu-24.04-aarch64/${binary_name_base}_arm64.deb"
x86_binary_url="https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/daily-build/memgraph/${build_date}/ubuntu-24.04/${binary_name_base}_amd64.deb"
echo "arm_binary_url=$arm_binary_url" >> $GITHUB_OUTPUT
echo "x86_binary_url=$x86_binary_url" >> $GITHUB_OUTPUT
# Print to console for debugging:
echo "DEBUG: mage_version=${mage_version}"
echo "DEBUG: memgraph_version=${memgraph_version}"
echo "DEBUG: memgraph_commit=${memgraph_commit}"
echo "DEBUG: build_date=${build_date}"
echo "DEBUG: binary_name_base=memgraph_${memgraph_version}-1"
PR_test:
if: ${{ (github.event_name == 'pull_request' && needs.TestVariables.outputs.run_tests == 'true') || github.event_name == 'merge_group' }}
needs: [TestVariables]
strategy:
fail-fast: false
matrix:
arch: ["amd64","arm64"]
uses: ./.github/workflows/reusable_package_mage.yaml
with:
arch: "${{ matrix.arch }}"
mage_version: ${{ needs.TestVariables.outputs.mage_version }}
memgraph_version: ${{ needs.TestVariables.outputs.memgraph_version }}
memgraph_download_link: ${{ matrix.arch == 'arm64' && needs.TestVariables.outputs.arm_binary_url || needs.TestVariables.outputs.x86_binary_url }}
memgraph_ref: ${{ needs.TestVariables.outputs.memgraph_commit }}
memgraph_ref_update: true
shorten_tag: false
run_tests: true
secrets: inherit
Manual_test:
if: github.event_name == 'workflow_dispatch'
needs: [TestVariables]
uses: ./.github/workflows/reusable_package_mage.yaml
with:
arch: "${{ github.event.inputs.arch }}"
mage_version: ${{ needs.TestVariables.outputs.mage_version }}
memgraph_version: "${{ github.event.inputs.memgraph_version || needs.TestVariables.outputs.memgraph_version }}"
memgraph_download_link: ${{ github.event.inputs.memgraph_download_link || ( github.event.inputs.arch == 'arm64' && needs.TestVariables.outputs.arm_binary_url || needs.TestVariables.outputs.x86_binary_url ) }}
memgraph_ref: "${{ github.event.inputs.memgraph_ref || needs.TestVariables.outputs.memgraph_commit }}"
memgraph_ref_update: ${{ inputs.memgraph_ref_update }}
shorten_tag: false
run_tests: true
secrets: inherit