RMI-PACTA / docker

Docker images
https://2degreesinvesting.github.io/docker/
MIT License
1 stars 0 forks source link

fatal: tag already exists warning #45

Closed cjyetman closed 3 years ago

cjyetman commented 3 years ago

I got this message while running the pacta docker build. I had previous run the same process and had to rerun it, so that may be where the 0.0.12 tag came from, but as I understood it when I remove all the existing docker images before running the script, there shouldn't be any tags left to "already exist", so I'm not sure where this comes from or how it's possible. @maurolepore any ideas?

Tagging docker with 0.0.12
fatal: tag '0.0.12' already exists
full output ``` shell CJs-MacBook-Pro-2:docker cj2dii$ cd pacta/ CJs-MacBook-Pro-2:pacta cj2dii$ docker rmi --force $(docker images -q '2dii_pacta' | uniq) Untagged: 2dii_pacta:0.0.12 Untagged: 2dii_pacta:latest Deleted: sha256:b43c79db9ce6773b14a9ae093a90b37e31cf4e9b9c86d99762ae718d74a76630 Deleted: sha256:7bd8ff7e48f89d4fd67d57a368e540d7061f58b960ba29bd53898f4d7c2c39a2 Deleted: sha256:89b3d33ef288d1ec1c8f76be6c520b7d0e1f8f2a87d6cdf99e207dddfeb8fa78 Deleted: sha256:68a6b78eeb94f949475cf830fff4bff3d67b477dbccf6fce104a11eeb9890410 Deleted: sha256:83dd93ac313f1669b369503fd5e9e33cc5f5392bc2712c96ee17e19a4c48ceeb Deleted: sha256:4017ee99ef9eb5ec2858dd64c015a8a05f000100d9855f7bba3c242713bc2122 Deleted: sha256:e75c1c29cfde3acb4460e7aafd0e7347f23853f09f8803d25f9ebb72d2dfd461 Deleted: sha256:c2188794a17fe21d5015201547227c8581c33c75d91a1455cf905fd0f6b3388b Deleted: sha256:57dfe34a3bd6a16111163a1026c78175e770779e8530363fc3d1026b3c9c01a2 Deleted: sha256:508921120243da0f2d1a9369b033c959ce4d2c7f6ce7ca4d89fd8bf01619e25d Deleted: sha256:3b0c28eac8a2e5e2b57295d74abe24cda7d1a781e5f6a0472b1b322a2dafdb45 Deleted: sha256:cf87108e32e2339df9a0d92dfd04ed56ca428015cff2179d5209771a3685ea7a Deleted: sha256:24e1428ea65e482e8c877308288c33185c79f5cf8214122eb0971e7c863adcfc Deleted: sha256:66b65211833b00949541ab941efd5daa14af0426b993369af35c005b97a8355d Deleted: sha256:2148e4912b40c7eed738a395bc6e0c87362333875519d888556244f9300c7b96 Deleted: sha256:1dc0fbf725a6f6186e02a648dae6f6b5d1c8374de462316fe27e21e34d61ee68 Deleted: sha256:acdefc49580730b1d965da7ab39359b94042344fd5fbd7029e98e30071f1879a Deleted: sha256:aea61bb0b1732b251055f468c52ac4c6dcd66b03e62bc7f059abc071ce4c0ce9 Deleted: sha256:ef8e4967c2a5d20f559f78554798beea54ec80b03426905f73bd0792f30dc386 Deleted: sha256:86d2ec3218cc30603701148869aae768394fbcd537cdadc45df3e1bb936f928f Deleted: sha256:3049f1a77da8f80bb6309ca2723bd6560939cc9291fd03a6306e6a6a821facb8 Deleted: sha256:5f33de1c2410e2de044a26ec0af4387660268303b76141ae74c10f479dfe2c94 Deleted: sha256:5de5a61b4ac1a1de529e22590bc9e89437394b0b1175e4767ab961bf0fad4b51 Deleted: sha256:66b02fd2c87f164ed621e3fd6e78910f2d20257c5cf7ca36f9adb5019b332354 CJs-MacBook-Pro-2:pacta cj2dii$ ./build_with_tag.sh 0.0.12 Cloning into 'PACTA_analysis'... remote: Enumerating objects: 132, done. remote: Counting objects: 100% (132/132), done. remote: Compressing objects: 100% (115/115), done. remote: Total 132 (delta 11), reused 73 (delta 10), pack-reused 0 Receiving objects: 100% (132/132), 3.59 MiB | 3.55 MiB/s, done. Resolving deltas: 100% (11/11), done. Cloning into 'create_interactive_report'... remote: Enumerating objects: 251, done. remote: Counting objects: 100% (251/251), done. remote: Compressing objects: 100% (209/209), done. remote: Total 251 (delta 52), reused 156 (delta 34), pack-reused 0 Receiving objects: 100% (251/251), 7.80 MiB | 7.68 MiB/s, done. Resolving deltas: 100% (52/52), done. Cloning into 'StressTestingModelDev'... remote: Enumerating objects: 94, done. remote: Counting objects: 100% (94/94), done. remote: Compressing objects: 100% (88/88), done. remote: Total 94 (delta 6), reused 58 (delta 2), pack-reused 0 Receiving objects: 100% (94/94), 9.31 MiB | 11.06 MiB/s, done. Resolving deltas: 100% (6/6), done. Cloning into 'pacta-data'... remote: Enumerating objects: 49, done. remote: Counting objects: 100% (49/49), done. remote: Compressing objects: 100% (46/46), done. remote: Total 49 (delta 3), reused 37 (delta 2), pack-reused 0 Receiving objects: 100% (49/49), 283.54 MiB | 8.32 MiB/s, done. Resolving deltas: 100% (3/3), done. Updating files: 100% (45/45), done. Tagging PACTA_analysis with 0.0.12 36ab41c (grafted, HEAD -> master, tag: 0.0.12, origin/master, origin/HEAD) (2 minutes ago) Tagging create_interactive_report with 0.0.12 1d3a106 (grafted, HEAD -> master, tag: 0.0.12, origin/master, origin/HEAD) (27 hours ago) Tagging StressTestingModelDev with 0.0.12 50098c6 (grafted, HEAD -> master, tag: 0.0.12, origin/master, origin/HEAD) (4 hours ago) Tagging pacta-data with 0.0.12 b5a5d50 (grafted, HEAD -> master, tag: 0.0.12, origin/master, origin/HEAD) (2 hours ago) Sending build context to Docker daemon 1.073GB Step 1/14 : FROM 2dii/r-packages:latest ---> f981d64df1af Step 2/14 : LABEL maintainer='Mauro Lepore' ---> Running in 597a1c8e0395 Removing intermediate container 597a1c8e0395 ---> 04f7c3b9d53c Step 3/14 : COPY PACTA_analysis /bound ---> b237f3cca981 Step 4/14 : COPY create_interactive_report /create_interactive_report ---> 05b5ba3714d3 Step 5/14 : COPY pacta-data /pacta-data ---> 3979ad36ed99 Step 6/14 : COPY StressTestingModelDev /StressTestingModelDev ---> cef398711388 Step 7/14 : RUN chmod -R a+rwX /bound ---> Running in 429b59411ea3 Removing intermediate container 429b59411ea3 ---> 29e5653c4be3 Step 8/14 : RUN chmod -R a+rwX /create_interactive_report ---> Running in 6a42eb1e3bc5 Removing intermediate container 6a42eb1e3bc5 ---> 135118a1d497 Step 9/14 : RUN chmod -R a+rwX /pacta-data ---> Running in 5f25c33fe199 Removing intermediate container 5f25c33fe199 ---> 135af79bc66a Step 10/14 : RUN chmod -R a+rwX /StressTestingModelDev ---> Running in e91e7c094e60 Removing intermediate container e91e7c094e60 ---> 2f8357e53a8f Step 11/14 : RUN echo "options(tinytex.tlmgr.path = '/root/.TinyTeX/bin/x86_64-linux/tlmgr')" > .Rprofile ---> Running in fa4af767b728 Removing intermediate container fa4af767b728 ---> 4c8e9e8601af Step 12/14 : RUN chmod -R a+rwX /root ---> Running in 0c017b3e6214 Removing intermediate container 0c017b3e6214 ---> 7a1dd0cdfea0 Step 13/14 : RUN /root/.TinyTeX/bin/*/tlmgr path add ---> Running in 33a0427c3839 Removing intermediate container 33a0427c3839 ---> e64b5877939e Step 14/14 : RUN exit 0 ---> Running in 453d8c0cf0f9 Removing intermediate container 453d8c0cf0f9 ---> cda9e3332542 Successfully built cda9e3332542 Successfully tagged 2dii_pacta:0.0.12 Successfully tagged 2dii_pacta:latest Tagging docker with 0.0.12 fatal: tag '0.0.12' already exists A temporary directory was created at: /var/folders/2c/kl_d1j0j3k3_gk_s110hh9mw0000gp/T/tmp.fqXGNqBa You may remove it with: rm -rf /var/folders/2c/kl_d1j0j3k3_gk_s110hh9mw0000gp/T/tmp.fqXGNqBa ```
cjyetman commented 3 years ago

I think this is because the docker repo, unlike the other repos, is not in a temp directory during this process... so the tag that gets set in the docker repo sticks around if you rerun this process. @maurolepore do you see any problem with that?

cjyetman commented 3 years ago

Also, it seems like this may have been an error, not a warning, that prevented the final "Saving 2dii_pacta into 2dii_pacta_v0.0.12.tar.gz ..." part from running, which is a bit of a concern

maurolepore commented 3 years ago

Thanks for explaining.

If I understand correctly, two ways to improve would be to:

  1. Make it easy to delete the tag from the docker repo -- maybe with a message pointing to git tag --delete ....

  2. Tag the docker repo at the very end, so it does not get tagged unless everything else worked okay. Maybe we could ask the user to confirm they want to tag the docker repo before the program exits?

cjyetman commented 3 years ago

both sound like a good idea to me, and maybe also (kind of part of 1, but to be explicit)...

  1. test if the given tag exists in the current "docker" repo and error/fail early with the message so you can fix it before running the whole thing

I thought we were doing that already, but maybe we're only testing the tags in the remote repos, not "docker".