-
Notifications
You must be signed in to change notification settings - Fork 15
Build and push kmake image to AWS ECR #113
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
base: main
Are you sure you want to change the base?
Conversation
3bc4a47 to
2a0dbde
Compare
hasiburr-qti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
We could significantly improve the safety and flexibility of this workflow by adding an optional input like kmake-image-pr-number.
If provided, the workflow would build the image from the PR’s head ref (using actions/checkout with ref:); if not, it would default to main.
This Enables testing Docker images from PRs before merge, without committing to main.
Avoids unnecessary prod image rebuilds and rollbacks when issues are caught late.
Keeps the existing flow unchanged for standard prod builds (opt‑in behavior only).
Aligns well with GitHub Actions’ native PR ref support and common CI best practices.
This would give us a clean pre‑merge validation path for image changes while keeping the prod workflow stable and simple. Having in mind that there won't be frequent changes to kmake-image repo but still this looks a robust way.
| - name: Checkout repository | ||
| run: | | ||
| git clone "$GIT_REPO_URL" repo | ||
| cd repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - name: Checkout repository | |
| run: | | |
| git clone "$GIT_REPO_URL" repo | |
| cd repo | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: qualcomm-linux/kmake-image | |
| fetch-depth: 0 | |
| ref: <can depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd into repo dir won't persist on next steps, better to use checkout action
| --repository-name "$TECH_TEAM_NAMESPACE/$IMAGE_NAME" \ | ||
| --tags Key=environment,Value="$ENVIRONMENT_VALUE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$TECH_TEAM_NAMESPACE, $IMAGE_NAME, and $ENVIRONMENT_VALUE.
These are not defined in the github environment, but accessed directly without ${{ inputs.<VAR_NAME>}} so the ECR check/create step will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already parsed the inputs in first step
|
|
||
| - name: Push Docker image to ECR | ||
| run: | | ||
| docker push "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$IMAGE_REF" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create a github step summary pointing out the job status. (optional)
| - name: Build Docker image | ||
| working-directory: repo | ||
| run: | | ||
| docker build -f "$DOCKERFILE_PATH" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to specify these labels to image as these are a part of input:
--label "org.opencontainers.image.source=$GIT_REPO_URL" \
--label "org.opencontainers.image.revision=${CHECKOUT_REF}" \ (if we are going with the checkout specific ref based approach)
This change adds a workflow to build the kmake Docker image and push it to AWS Elastic Container Registry (ECR). The image will be available for use in pre-merge Docker pulls, ensuring consistent environments during testing and integration. Signed-off-by: Vishal Kumar <viskuma@qti.qualcomm.com>
This change adds a workflow to build the kmake Docker image and push it to AWS Elastic Container Registry (ECR). The image will be available for use in pre-merge Docker pulls, ensuring consistent environments during testing and integration.