diff --git a/.github/actions/build_ubuntu/action.yml b/.github/actions/build_ubuntu/action.yml index 2098037..41e80a6 100644 --- a/.github/actions/build_ubuntu/action.yml +++ b/.github/actions/build_ubuntu/action.yml @@ -58,6 +58,7 @@ runs: with: image: kmake-image-ubuntu-noble-arm64:ver.1.0 tag: ubuntu-noble-arm64 + registry: artifacts.codelinaro.org/clo-420-qli-registry - name: Setup git config and Logging shell: bash diff --git a/.github/actions/pull_docker_image/action.yml b/.github/actions/pull_docker_image/action.yml index 0c34752..a6b5aef 100644 --- a/.github/actions/pull_docker_image/action.yml +++ b/.github/actions/pull_docker_image/action.yml @@ -12,13 +12,38 @@ inputs: required: false default: ver.1.0 + registry: + description: "Registry to pull from. E.g. '.dkr.ecr..amazonaws.com' or 'artifacts.codelinaro.org/clo-420-qli-registry'" + required: true + runs: using: "composite" steps: + - name: Authenticate to registry (ECR only) + shell: bash + run: | + REGISTRY="${{ inputs.registry }}" + if [[ "$REGISTRY" == *.dkr.ecr.*.amazonaws.com ]]; then + echo "ECR registry detected — authenticating..." + REGION=$(echo "$REGISTRY" | grep -oP '(?<=dkr\.ecr\.)[^.]+') + aws ecr get-login-password --region "$REGION" | \ + docker login --username AWS --password-stdin "$REGISTRY" + else + echo "Non-ECR registry — skipping authentication." + fi + - name: Pull Docker image shell: bash run: | - echo "Pulling Docker image: ${{ inputs.image }}" - docker pull artifacts.codelinaro.org/clo-420-qli-registry/${{ inputs.image }} - echo "Docker image pulled successfully:" - docker tag artifacts.codelinaro.org/clo-420-qli-registry/${{ inputs.image }} kmake-image:${{ inputs.tag }} + echo "Pulling Docker image: ${{ inputs.registry }}/${{ inputs.image }}" + docker pull "${{ inputs.registry }}/${{ inputs.image }}" + echo "Docker image pulled successfully." + + - name: Retag image locally + shell: bash + run: | + LOCAL_TAG=$(echo "${{ inputs.image }}" | cut -d: -f1) + echo "Tagging as $LOCAL_TAG:${{ inputs.tag }}" + docker tag "${{ inputs.registry }}/${{ inputs.image }}" "$LOCAL_TAG:${{ inputs.tag }}" + echo "Image tagged successfully." + \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3797913..adf5835 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/actions/pull_docker_image@main with: image: ${{ inputs.docker_image }} + registry: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - name: Build workspace id: build_workspace diff --git a/.github/workflows/build_rt.yml b/.github/workflows/build_rt.yml index 7dee196..3916f41 100644 --- a/.github/workflows/build_rt.yml +++ b/.github/workflows/build_rt.yml @@ -47,6 +47,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/actions/pull_docker_image@main with: image: ${{ inputs.docker_image }} + registry: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - name: Build workspace id: build_workspace diff --git a/.github/workflows/pre_merge.yml b/.github/workflows/pre_merge.yml index 79911b1..7ce4e47 100644 --- a/.github/workflows/pre_merge.yml +++ b/.github/workflows/pre_merge.yml @@ -42,7 +42,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/workflows/build.yml@main secrets: inherit with: - docker_image: kmake-image:ver.1.0 + docker_image: ${{ vars.TECH_TEAM_NAMESPACE }}/kmake-image:ver.1.0 pr_number: ${{ inputs.pr }} branch: ${{ inputs.ref }} repo: ${{ inputs.repo }} @@ -54,7 +54,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/workflows/build_rt.yml@main secrets: inherit with: - docker_image: kmake-image:ver.1.0 + docker_image: ${{ vars.TECH_TEAM_NAMESPACE }}/kmake-image:ver.1.0 pr_number: ${{ inputs.pr }} branch: ${{ inputs.ref }} repo: ${{ inputs.repo }} @@ -79,7 +79,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/workflows/test.yml@main secrets: inherit with: - docker_image: kmake-image:ver.1.0 + docker_image: ${{vars.TECH_TEAM_NAMESPACE}}/kmake-image:ver.1.0 rootfs_matrix: ${{ needs.loading.outputs.rootfs_matrix }} kernel_version: ${{ needs.build.outputs.kernel_version }} commit_SHA: ${{ inputs.sha }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5df7ded..d5f44e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,6 +66,7 @@ jobs: uses: qualcomm-linux/kernel-config/.github/actions/pull_docker_image@main with: image: ${{ inputs.docker_image }} + registry: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - name: Download URLs list if: ${{ inputs.build_type == 'kbdev' }}