Giter VIP home page Giter VIP logo

Comments (12)

vturecek avatar vturecek commented on July 28, 2024 2

@villeah thanks for providing more details, that's super useful. I found a bug on our end where a revision fails to create if you first create an application that specifies a revision suffix ("revisionSuffix": "services-revision"), and then later you update the application without providing a revision suffix. The expected behavior here is that a new revision will be created with a random suffix (which is the default behavior when you don't specify a suffix).

While I work on fixing this, a temporary work around is to always provide a revision suffix when updating the application, or simply omit revision suffixes entirely, until this bug is fixed.

Thanks again for reporting this. I'll leave this issue open until a fix is rolled out.

from azure-container-apps.

vturecek avatar vturecek commented on July 28, 2024 1

Yes, sorry for the delay on this. We have a fix in for it and will roll out soon.

from azure-container-apps.

anthonychu avatar anthonychu commented on July 28, 2024 1

@sshquack Because there were no changes, no revision was created. It's not required that new revisions must have a new image tag, something else (e.g., environment variables) changing will create a new revision too. You can also cause your existing revision's replicas to pick up the updated image by calling az containerapp revision restart.

However, it's not typically a good practice to reuse tags. As different replicas can pull the image at different times, your revision can end up with different replicas running different versions of your app that have the same tag. See this doc for guidance: https://docs.microsoft.com/en-us/azure/container-registry/container-registry-image-tag-version

from azure-container-apps.

lgmorand avatar lgmorand commented on July 28, 2024 1

@vturecek What's the status on this one please ? 5 months ago, you said the fix was rolling out. ACA is GA but the issue is still open. thanks

from azure-container-apps.

torosent avatar torosent commented on July 28, 2024 1

This issue is solved with CLI adding PATCH support

from azure-container-apps.

torosent avatar torosent commented on July 28, 2024

Thanks @villeah. We are investigating it.

from azure-container-apps.

vturecek avatar vturecek commented on July 28, 2024

@villeah did the az containerapp update command succeed? And just to be sure, you provided a different image or tag when you did az containerapp update --image than the one you used when you first created the Container App?

from azure-container-apps.

villeah avatar villeah commented on July 28, 2024

@vturecek Yes it finished without any errors. In output it even shows the new image name. But when listing revisions, I can see only the old one. Here is the example of the commands and outputs (shortened them a bit) I used to test this. Original image is "hellowreg.azurecr.io/helloworld:latest".

$ az containerapp update -g $RESOURCE_GROUP -n dapr-app-2 --image hellowreg.azurecr.io/helloworld:v2
Command group 'containerapp' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
{
  "configuration": {
    "activeRevisionsMode": "Multiple",

    ...
    ...

  "latestRevisionName": "dapr-app-2--services-revision",
  "location": "North Europe",
  "name": "dapr-app-2",
  "provisioningState": "Succeeded",
  "resourceGroup": "my-containerapps-us",

    ...
    ...

  "template": {
    "containers": [
      {
        "args": null,
        "command": null,
        "env": null,
        "image": "hellowreg.azurecr.io/helloworld:v2",
        "name": "service-2",
        "resources": {
          "cpu": 0.5,
          "memory": "1Gi"
        }
      }
    ],

    ...
    ...

    "revisionSuffix": "services-revision",
    "scale": {
      "maxReplicas": 2,
      "minReplicas": 1,
      "rules": null
    }
  },
  "type": "Microsoft.Web/containerApps"
}


$ az containerapp show -g $RESOURCE_GROUP -n dapr-app-2
Command group 'containerapp' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
{
  "configuration": {
    "activeRevisionsMode": "Multiple",

    ...
    ...
    ...


  "template": {
    "containers": [
      {
        "args": null,
        "command": null,
        "env": null,
        "image": "hellowreg.azurecr.io/helloworld:v2",
        "name": "service-2",
        "resources": {
          "cpu": 0.5,
          "memory": "1Gi"
        }
      }
    ],

    ...
    ...

    "revisionSuffix": "services-revision",
    "scale": {
      "maxReplicas": 2,
      "minReplicas": 1,
      "rules": null
    }
  },
  "type": "Microsoft.Web/containerApps"
}

$ az containerapp revision list -g $RESOURCE_GROUP -n dapr-app-2
Command group 'containerapp revision' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
[
  {
    "active": true,
    "createdTime": "2021-11-19T07:28:10+00:00",

    ...
    ...

    "location": "northeurope",
    "name": "dapr-app-2--services-revision",
    "provisioningError": null,
    "provisioningState": "Provisioned",
    "replicas": 1,
    "resourceGroup": "my-containerapps-us",
    "tags": null,
    "template": {
      "containers": [
        {
          "args": null,
          "command": null,
          "env": null,
          "image": "hellowreg.azurecr.io/helloworld:latest",
          "name": "service-2",
          "resources": {
            "cpu": 0.5,
            "memory": "1Gi"
          }
        }

    ...
    ...

      "revisionSuffix": null,
      "scale": {
        "maxReplicas": 2,
        "minReplicas": 1,
        "rules": null
      }
    },
    "trafficWeight": 100,
    "type": "Microsoft.Web/containerapps/revisions"
  }
]

from azure-container-apps.

lgmorand avatar lgmorand commented on July 28, 2024

"a temporary work around is to always provide a revision suffix when updating the application"
it does not work

1- I've a revision 1 (rev-1) with 2 containers (A & B)
2- I've a revision 2 (rev without suffix) with 1 container (C)
3- if I create a revision 3 (rev-3) based on rev-1, it will be created based on rev 2 and container C, even if UI listed A & B

that's quite disturbing :)

from azure-container-apps.

ezYakaEagle442 avatar ezYakaEagle442 commented on July 28, 2024

@vturecek Hi any update on this issue ?

from azure-container-apps.

sshquack avatar sshquack commented on July 28, 2024

Hi @vturecek I ran into a similar issue.

  • I create a new dotnet image and pushed it to ACR under the v1 tag
docker build \
		--platform=linux/amd64 \
		-f demoapp/Dockerfile \
		-t foobar..azurecr.io/demoapp:v1 .
  • Then I created the container app pointing to the v1 tag
az containerapp create \
  --name my-demo-app \
  --resource-group $RESOURCE_GROUP \
  --image $CONTAINER_IMAGE_NAME:v1 \
  --environment $CONTAINERAPPS_ENVIRONMENT \
  --registry-server $REGISTRY_SERVER
  • Then I made some code changes and re-built the docker image using the same v1 tag
  • Then I updated the container app
az containerapp update \
      --name ${PROJ_CAPP_NAME} \
      --resource-group ${RESOURCE_GROUP} \
	  --image CONTAINER_IMAGE_NAME:v1

All commands succeeded with exit code 0. So no errors. But when I access my app on azure portal, it says the app is still in the older version with older timestamp.

Question: For each new revision is it mandatory to create a new docker image tag? Can we not reuse the tag like latest to create a new revision?

from azure-container-apps.

sshquack avatar sshquack commented on July 28, 2024

Thanks @anthonychu Good to know about revision restart and how change in env var can create new revisions.

Regarding tags, I will try to use a new tag for each push to ACR. The deeper problem is that there is no way to disallow overwriting an existing tag in ACR (see question). ACLs and locks are just workaround. This means sooner or later, a mis-configured ACL or RBAC could end-up overwriting an existing tag. For now, it would be helpful to have a clear message after az containerapp update if a new revision was created or not. I'll add my feedback to #182

from azure-container-apps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.