Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Add support for acorn update --confirm-upgrade on nested Acorns and services #1726

Closed
g-linville opened this issue Jun 6, 2023 · 5 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@g-linville
Copy link
Contributor

We block most acorn update commands on nested Acorns because the user should instead be updating the parent Acorn, since that is the source of truth. However, it is reasonable for a user to use notifyUpgrade on a nested Acorn, in an Acornfile such as this one:

acorns: "myAcorn": {
  image: "myimage:latest"
  autoUpgrade: true
  notifyUpgrade: true
}

And in that circumstance, the user should be able to do acorn update --confirm-upgrade <app name>.myAcorn in order to confirm the upgrade when a new image is available.

Right now, a command like that will fail name validation because a . is present in the name. We need to find a way around this and allow that behavior.

@cjellick cjellick added this to the v0.8.0 milestone Jun 6, 2023
@cjellick cjellick added the kind/bug Something isn't working label Jul 1, 2023
keyallis pushed a commit that referenced this issue Jul 31, 2023
Nested acorn validation support for `acorn update --confirm-upgrade` (#1726)
@sangee2004
Copy link
Contributor

Tested with acorn version -v0.8.0-alpha7-190-gdc9cc3fd+dc9cc3fd

  1. Deployed nested Acorn with following Acornfile
acorns: {
    "my-acorn1": {
        image: "ghcr.io/acorn-io/library/hello-world:latest"
    }
    "my-acorn2": {
        image: "docker.io/sangeetha/myfirstacorn:v#.#.#"
        autoUpgrade: true
        autoUpgradeInterval: "15s"
        notifyUpgrade: true
    }
   "my-acorn3": {
       image: "docker.io/sangeetha/myfirstacorn:v0.0.1"
   }
}
  1. Once app is deployed successfully , make a new version docker.io/sangeetha/myfirstacorn (that matches auto upgrade format) made available.

  2. This result in app getting to confirm upgrade status as expected.

  3. Able to successfully use acorn update --confirm-upgrade mytestnested.my-acorn2 to upgrade the nested acorn.

acorn apps             
NAME                     IMAGE                                             COMMIT         HEALTHY   UP-TO-DATE   CREATED     ENDPOINTS                                                                                MESSAGE
mytestnested             139b02db8b1b                                                     0         0            3m24s ago                                                                                            [acorns: my-acorn2: [confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v42.0.0]]
mytestnested.my-acorn1   ghcr.io/acorn-io/library/hello-world:latest       0c80591be495   1         1            3m24s ago   http://webapp-mytestnested-my-acorn1-b3a46aa5-8680fa04.local.oss-acorn.io => webapp:80   OK
mytestnested.my-acorn2   index.docker.io/sangeetha/myfirstacorn:v41.0.0*                  1         1            3m24s ago   http://myweb-mytestnested-my-acorn2-8fa52205-e12f4584.local.oss-acorn.io => myweb:80     [image-pull: confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v42.0.0]
mytestnested.my-acorn3   docker.io/sangeetha/myfirstacorn:v0.0.1                          2         2            3m24s ago   http://myweb1-mytestnested-my-acorn3-818888b2-772875c5.local.oss-acorn.io => myweb1:80   OK

 % acorn update --confirm-upgrade  mytestnested.my-acorn2
mytestnested.my-acorn2

 % acorn apps
NAME                     IMAGE                                             COMMIT         HEALTHY   UP-TO-DATE   CREATED     ENDPOINTS                                                                                MESSAGE
mytestnested             139b02db8b1b                                                     0         0            8m52s ago                                                                                            OK
mytestnested.my-acorn1   ghcr.io/acorn-io/library/hello-world:latest       0c80591be495   1         1            8m52s ago   http://webapp-mytestnested-my-acorn1-b3a46aa5-8680fa04.local.oss-acorn.io => webapp:80   OK
mytestnested.my-acorn2   index.docker.io/sangeetha/myfirstacorn:v42.0.0*                  1         1            8m52s ago   http://myweb-mytestnested-my-acorn2-8fa52205-e12f4584.local.oss-acorn.io => myweb:80     OK
mytestnested.my-acorn3   docker.io/sangeetha/myfirstacorn:v0.0.1                          2         2            8m52s ago   http://myweb1-mytestnested-my-acorn3-818888b2-772875c5.local.oss-acorn.io => myweb1:80   OK

Question:
I am not able to use acorn update --confirm-upgrade on the parent acorn to update the child acorn. Should we expect to see this succeed as well ?

acorn apps                                                                    
NAME                     IMAGE                                             COMMIT         HEALTHY   UP-TO-DATE   CREATED   ENDPOINTS                                                                                MESSAGE
mytestnested             139b02db8b1b                                                     0         0            12m ago                                                                                            OK
mytestnested.my-acorn1   ghcr.io/acorn-io/library/hello-world:latest       0c80591be495   1         1            12m ago   http://webapp-mytestnested-my-acorn1-b3a46aa5-8680fa04.local.oss-acorn.io => webapp:80   OK
mytestnested.my-acorn2   index.docker.io/sangeetha/myfirstacorn:v42.0.0*                  1         1            12m ago   http://myweb-mytestnested-my-acorn2-8fa52205-e12f4584.local.oss-acorn.io => myweb:80     OK
mytestnested.my-acorn3   docker.io/sangeetha/myfirstacorn:v0.0.1                          2         2            12m ago   http://myweb1-mytestnested-my-acorn3-818888b2-772875c5.local.oss-acorn.io => myweb1:80   OK

 % acorn apps
NAME                     IMAGE                                             COMMIT         HEALTHY   UP-TO-DATE   CREATED   ENDPOINTS                                                                                MESSAGE
mytestnested             139b02db8b1b                                                     0         0            12m ago                                                                                            [acorns: my-acorn2: [confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v43.0.0]]
mytestnested.my-acorn1   ghcr.io/acorn-io/library/hello-world:latest       0c80591be495   1         1            12m ago   http://webapp-mytestnested-my-acorn1-b3a46aa5-8680fa04.local.oss-acorn.io => webapp:80   OK
mytestnested.my-acorn2   index.docker.io/sangeetha/myfirstacorn:v42.0.0*                  1         1            12m ago   http://myweb-mytestnested-my-acorn2-8fa52205-e12f4584.local.oss-acorn.io => myweb:80     [image-pull: confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v43.0.0]
mytestnested.my-acorn3   docker.io/sangeetha/myfirstacorn:v0.0.1                          2         2            12m ago   http://myweb1-mytestnested-my-acorn3-818888b2-772875c5.local.oss-acorn.io => myweb1:80   OK

 % acorn update --confirm-upgrade  mytestnested                                  
mytestnested

% acorn apps                                  
NAME                     IMAGE                                             COMMIT         HEALTHY   UP-TO-DATE   CREATED   ENDPOINTS                                                                                MESSAGE
mytestnested             139b02db8b1b                                                     0         0            13m ago                                                                                            [acorns: my-acorn2: [confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v43.0.0]]
mytestnested.my-acorn1   ghcr.io/acorn-io/library/hello-world:latest       0c80591be495   1         1            13m ago   http://webapp-mytestnested-my-acorn1-b3a46aa5-8680fa04.local.oss-acorn.io => webapp:80   OK
mytestnested.my-acorn2   index.docker.io/sangeetha/myfirstacorn:v42.0.0*                  1         1            13m ago   http://myweb-mytestnested-my-acorn2-8fa52205-e12f4584.local.oss-acorn.io => myweb:80     [image-pull: confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v43.0.0]
mytestnested.my-acorn3   docker.io/sangeetha/myfirstacorn:v0.0.1                          2         2            13m ago   http://myweb1-mytestnested-my-acorn3-818888b2-772875c5.local.oss-acorn.io => myweb1:80   OK

@g-linville
Copy link
Contributor Author

To answer your question at the end @sangee2004, no we would not expect that to work. That would work only to update the image of the parent acorn itself, if it also had notifyUpgrade turned on. If we used that to update child acorns also, there would be no way to distinguish which behavior the user intends.

@sangee2004
Copy link
Contributor

@g-linville It is confusing to see "confirm upgrade" messages show up in the Parent acorns "Messages" field and when user attempts to acorn update --confirm-upgrade mytestnested , there is no error message that suggests that this update did not actually succeed . Can we provide an error message to the user in this case?

@g-linville
Copy link
Contributor Author

@sangee2004 the reason it shows up there is because it is a condition set on the child acorn. The message from the example you gave looks like this:

[acorns: my-acorn2: [confirm upgrade to index.docker.io/sangeetha/myfirstacorn:v43.0.0]]

I think it makes it clear enough that the upgrade is for the child acorn called my-acorn2, not for the parent acorn. Imo it would be overkill to have a custom message for this, but we can talk about this UX at standup to get a wider array of opinions.

@sangee2004
Copy link
Contributor

Followup question is tracked in #2007

cloudnautique pushed a commit to cloudnautique/runtime that referenced this issue Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants