Closed philbannon closed 10 months ago
Hi @philbannon! Thanks for opening this issue!
From first glance, it looks like a configuration issue. I'm not sure if we have runtime-platform
argument for the GitHub Action task.
Meanwhile, I found this documentation file where it gives more details about the required and optional arguments for this GH task. Hopefully this would explain a little bit more.
Thanks a million for taking the time to look at this @harryli0108 I actually added in the runtime-platform into the config just see if it would make any difference. Seems that having the config file with or without the runtime-platform arg results in the same error.
Any suggestions on what else to look at?
Many thanks
@philbannon You're very welcome. I searched a little bit and seems like there are some environment variables you might need to set for Java projects. Here's the link to this documentation.
Meanwhile, I also found this that explains how Oryx platform detection works.
Also, I think it is worth noting to see if your Java version used is within our support versions, as the error message you've got may also be triggered due to unsupported Java version.
@philbannon I'm sorry for spamming you with comments here. As one of my colleagues spotted, we currently don't ship Java runtimes with this builder. And because of that, every time when the builder is trying to call oryx dockerfile
to get the runtime argument, it'll prompt you with that error.
There is a workaround for your scenario. You'll either need to provide your own dockerfile to the action that builds the app, or build and publish your own runnable application image external to the action and provide the image to the imagesToDeploy
argument of the action.
Hey @harryli0108 please no need to say sorry. You're doing me a massive help here.
Just on the workaround, and this maybe a stupid question but I'm building the image in the following step:
- name: Build and Push ACR Image
env:
ACR_REGISTRY: xxxx.azurecr.io # Replace with your ACR login server
ACR_REPOSITORY: tfs-search-service # Replace with the desired ACR repository
ACR_IMAGE_TAG: ${{ github.sha }}
run: |
./gradlew jib -Djib.to.auth.username=${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_USERNAME }}\
-Djib.to.auth.password=${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_PASSWORD }} \
-Djib.to.image=xxxx.azurecr.io/tfs-search-service:${{ github.sha }}
And also then trying to use imagesToDeploy
- name: Build and Deploy to Azure Container Apps
uses: azure/container-apps-deploy-action@v1
with:
appSourcePath: ${{ github.workspace }}
registryUrl: xxxxxxcontainerregistry.azurecr.io
registryUsername: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_PASSWORD }}
containerAppName: search-service-production
resourceGroup: xxxxxx-production
imageToDeploy: xxxxxxcontainerregistry.azurecr.io/search-service-production:${{ github.sha }}
Is this what you mean? If so I'm still getting the same error
Thanks again for all the time.
@philbannon Thanks for the info! In your case, if you use the argument imageToDeploy
, you'll need to build the image first outside of the Github Action using docker or your choice of image builder. Since the builder doesn't support Java, the auto detection and building is not going to work here. The workflow yaml file would look something like this:
steps:
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and deploy Container App
uses: azure/container-apps-deploy-action@v1
with:
registryUrl: xxxxxxcontainerregistry.azurecr.io
registryUsername: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_PASSWORD }}
imageToDeploy: xxxxxxcontainerregistry.azurecr.io/search-service-production:xxxxxxxxxx
But if you prefer to use GH Action to build the image for you rather building locally, you can have a Dockerfile with the building steps and layers provided to the task. This would look something like this:
steps:
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and deploy Container App
uses: azure/container-apps-deploy-action@v1
with:
appSourcePath: ${{ github.workspace }}
registryUrl: xxxxxxcontainerregistry.azurecr.io
registryUsername: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.SEARCHSERVICEPRODUCTION_REGISTRY_PASSWORD }}
dockerfilePath: Dockerfile-Path
And for more details of the arguments used for this task, I would suggest to take a look on the task documentation.
This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.
Hi All,
I'm trying to migrate from GCP to Azure. I have a set of spring boot API's which I'm trying to deploy via GitHub Actions to my Container Apps. However I'm getting what to me is a unknown error stating that the runtime-platform arg is empty.
For context, my API's are Spring Boot running Java 17 and with Gradle and built via the JIB build tool.
Please see below my github actions yml file:
And below is the log file of my github action:
If anyone could shed some light that would be great.
Thank you.