Skip to content
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

`up prune` doesn't appear to prune different stages #647

Closed
arxpoetica opened this Issue Apr 19, 2018 · 11 comments

Comments

Projects
None yet
2 participants
@arxpoetica
Copy link

arxpoetica commented Apr 19, 2018

I have two stages: production & staging.

Run:

up prune

Bug?

Doesn't appear to do anything at all. I even tried up prune staging. Nada.

@tj

This comment has been minimized.

Copy link
Member

tj commented Apr 19, 2018

It does both at the same time currently, but I thinkkkk you're right, having some granular control there would be good!

@tj tj added the Feature Accepted label Apr 19, 2018

@tj tj closed this in 8c3ed95 Apr 19, 2018

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 20, 2018

Oh, ha ha that's not even what I was suggesting, but I do like that. 👍

I was just saying that up prune doesn't appear to work for me:

» up version
0.6.1-pro
» up prune
     prune: 0 old files removed from S3 (0 B) (1.824s)

When I take a peek in the S3 bucket, all the prior zip files are still there.

image

Etc.

@tj

This comment has been minimized.

Copy link
Member

tj commented Apr 21, 2018

Hmm seems to work for me! Maybe this was the wrong bucket? At one point the bucket changed from up-<account>-<app>-<region> to just up-<account>-<region>/<app> to create fewer buckets. Should be fine to remove any old one if that's the case

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 22, 2018

I only have one up bucket, and it's in the newer format (removed the #s): up-xxxxxxxxxxxx-us-east-2.

I'm going to try something drastic and rename the whole bucket though. See if it starts behaving with a new bucket.

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 23, 2018

Update: I completely deleted my stack and started from scratch. (Drastic, I know). But starting fresh solved nothing. I'm still getting prune: 0 old files removed from S3 (0 B) (1.549s) and I know there are (currently) 9 zip files in the staging S3 folder and 4 in the production folder.

Here's a -v dump:

$ up prune -v
     4ms     DEBU up version 0.6.1-pro (os: darwin, arch: amd64)
     0s      DEBU inferred runtime type=node
     0s      DEBU 1 regions from config
     0s      DEBU track "Prune" map[plan:pro versions:60 os:darwin arch:amd64 version:0.6.1-pro ci:false]
     0s      DEBU event prune map[]
     1.418s  DEBU checking for role
     1.493s  DEBU using existing role arn:aws:iam::063543639960:role/abc-function
     0s      DEBU retain index=0 key=abc/staging/1524469766-H24ovaFYGLiIUj8Q.zip last_modified=2018-04-23 07:49:28 +0000 UTC size=33483160
     0s      DEBU retain index=1 key=abc/production/1524467773-Gci8xI7oNHuIW9t6.zip last_modified=2018-04-23 07:16:15 +0000 UTC size=42267426
     0s      DEBU retain index=2 key=abc/production/1524461347-LxyMlrKWuFd4AlGb.zip last_modified=2018-04-23 05:29:09 +0000 UTC size=42264379
     0s      DEBU retain index=3 key=abc/production/1524460932-Bt1qz7YRmeL6VhfK.zip last_modified=2018-04-23 05:22:14 +0000 UTC size=9767733
     0s      DEBU retain index=4 key=abc/production/1524459989-o1Ti8E3vrQDP0nOD.zip last_modified=2018-04-23 05:06:31 +0000 UTC size=46747136
     0s      DEBU retain index=5 key=abc/staging/1524404601-vKKUn1Ru8XyfBKHj.zip last_modified=2018-04-22 13:43:23 +0000 UTC size=46707866
     0s      DEBU retain index=6 key=abc/staging/1524404380-A2WUscGp4sc6Tug3.zip last_modified=2018-04-22 13:39:42 +0000 UTC size=46698169
     0s      DEBU retain index=7 key=abc/staging/1524402119-S3MNVR0wxZyGGFr2.zip last_modified=2018-04-22 13:02:01 +0000 UTC size=44347961
     0s      DEBU retain index=8 key=abc/staging/1524400319-qdyKUG7JAyWtZDdu.zip last_modified=2018-04-22 12:31:59 +0000 UTC size=40698586
     0s      DEBU retain index=9 key=abc/staging/1524395748-OupVhLmOrMAh62Zg.zip last_modified=2018-04-22 11:15:50 +0000 UTC size=32413429
     0s      DEBU retain index=10 key=abc/staging/1524395447-O0iQNKuXiAJJlgMf.zip last_modified=2018-04-22 11:10:49 +0000 UTC size=32411223
     0s      DEBU retain index=11 key=abc/staging/1524394704-XDJuYA4PTDNDLjY4.zip last_modified=2018-04-22 10:58:27 +0000 UTC size=32409024
     0s      DEBU retain index=12 key=abc/staging/1524394339-NX2Guntnsdl69SAZ.zip last_modified=2018-04-22 10:52:20 +0000 UTC size=32406796
   ⠏ 0s      DEBU event prune.complete map[duration:1.496005132s size:0 count:0]

(Note, I changed the app name to abc for some privacy.)

@tj

This comment has been minimized.

Copy link
Member

tj commented Apr 23, 2018

Hmm in that specific case it might be because the default number to retain is 60, maybe try up prune -v -r 5

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 23, 2018

Ah. Gotcha. Makes sense.

@tj

This comment has been minimized.

Copy link
Member

tj commented Apr 23, 2018

Pretty arbitrary number right now hahah.. but the price of retaining 60 should be pretty negligible, definitely open to tuning the default though

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 24, 2018

Oh. INTERESTING. So I just ran it and it worked, except it exposed a different bug--

I ran:

up prune -v -r 2

And it (sure enough) left two zip files—but only the zip files under staging. I would have expected it to leave two under production too, but nope, those are all gone (no worries, but good to know).

Unless that's expected behavior?

output:

$ up prune -v -r 2
     5ms     DEBU up version 0.6.1-pro (os: darwin, arch: amd64)
     0s      DEBU inferred runtime type=node
     0s      DEBU 1 regions from config
     0s      DEBU track "Prune" map[version:0.6.1-pro ci:false plan:pro versions:2 os:darwin arch:amd64]
     1ms     DEBU event prune map[]
     1.495s  DEBU checking for role
     1.461s  DEBU using existing role arn:aws:iam::063543639960:role/abc-function
     0s      DEBU retain index=0 key=abc/staging/1524476209-IL4P6U362K7aQYaC.zip last_modified=2018-04-23 09:36:49 +0000 UTC size=39237685
     0s      DEBU retain index=1 key=abc/staging/1524469766-H24ovaFYGLiIUj8Q.zip last_modified=2018-04-23 07:49:28 +0000 UTC size=33483160
     408ms   DEBU remove index=2 key=abc/production/1524467773-Gci8xI7oNHuIW9t6.zip last_modified=2018-04-23 07:16:15 +0000 UTC size=42267426
     281ms   DEBU remove index=3 key=abc/production/1524461347-LxyMlrKWuFd4AlGb.zip last_modified=2018-04-23 05:29:09 +0000 UTC size=42264379
     265ms   DEBU remove index=4 key=abc/production/1524460932-Bt1qz7YRmeL6VhfK.zip last_modified=2018-04-23 05:22:14 +0000 UTC size=9767733
     345ms   DEBU remove index=5 key=abc/production/1524459989-o1Ti8E3vrQDP0nOD.zip last_modified=2018-04-23 05:06:31 +0000 UTC size=46747136
     392ms   DEBU remove index=6 key=abc/staging/1524404601-vKKUn1Ru8XyfBKHj.zip last_modified=2018-04-22 13:43:23 +0000 UTC size=46707866
     295ms   DEBU remove index=7 key=abc/staging/1524404380-A2WUscGp4sc6Tug3.zip last_modified=2018-04-22 13:39:42 +0000 UTC size=46698169
     675ms   DEBU remove index=8 key=abc/staging/1524402119-S3MNVR0wxZyGGFr2.zip last_modified=2018-04-22 13:02:01 +0000 UTC size=44347961
     286ms   DEBU remove index=9 key=abc/staging/1524400319-qdyKUG7JAyWtZDdu.zip last_modified=2018-04-22 12:31:59 +0000 UTC size=40698586
     284ms   DEBU remove index=10 key=abc/staging/1524395748-OupVhLmOrMAh62Zg.zip last_modified=2018-04-22 11:15:50 +0000 UTC size=32413429
     292ms   DEBU remove index=11 key=abc/staging/1524395447-O0iQNKuXiAJJlgMf.zip last_modified=2018-04-22 11:10:49 +0000 UTC size=32411223
     343ms   DEBU remove index=12 key=abc/staging/1524394704-XDJuYA4PTDNDLjY4.zip last_modified=2018-04-22 10:58:27 +0000 UTC size=32409024
     285ms   DEBU remove index=13 key=abc/staging/1524394339-NX2Guntnsdl69SAZ.zip last_modified=2018-04-22 10:52:20 +0000 UTC size=32406796
   ⠙ 0s      DEBU event prune.complete map[duration:5.612431762s size:449139728 count:12]
@tj

This comment has been minimized.

Copy link
Member

tj commented Apr 24, 2018

8c3ed95 changes that behaviour a bit since it targets the specific stage, but that'll be in the next release. I doubt checked though and it interestingly doesn't seem to affect Lambda if you even delete all the S3 objects hahah. I thought maybe that would explode things

@arxpoetica

This comment has been minimized.

Copy link
Author

arxpoetica commented Apr 25, 2018

Yeah, the Lambda is still there, so it didn't entirely blow up. Thanks for setting a default and hanging in there with me on this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.