I'm running a lot of atlantis plan using the api. ...
# atlantis-community
s
I'm running a lot of atlantis plan using the api. however, i find i'm running out of free disk space and there doesn't seem to be an api call that would allow me to free that. what is the best course of action here? does atlantis eventually free up that space? 2024-04-03 194040,331 DEBUG Starting new HTTPS connection (1): gitlab.server.com:443 2024-04-03 194040,610 DEBUG https://gitlab.server.com:443 "GET /api/v4/projects/2126 HTTP/1.1" 200 1593 2024-04-03 194040,795 DEBUG https://gitlab.server.com:443 "GET /api/v4/projects/2126/repository/files/atlantis.yaml?ref=master HTTP/1.1" 200 18304 2024-04-03 194040,949 DEBUG Starting new HTTPS connection (1): atlantis.atlantisserver.com:443 2024-04-03 194040,949 DEBUG Starting new HTTPS connection (1): atlantis.atlantisserver.com:443 2024-04-03 194040,950 DEBUG Starting new HTTPS connection (1): atlantis.atlantisserver.com:443 2024-04-03 194041,822 DEBUG https://atlantis.atlantisserver.com:443 "POST /api/plan HTTP/1.1" 500 169 2024-04-03 194041,826 INFO Atlantis plan request failed with status code: 500 2024-04-03 194041,826 INFO {"error":"failed to build command: creating new workspace: mkdir /home/atlantis/.atlantis/repos/data/infrastructure/terraform/0/default: no space left on device"} 2024-04-03 194041,844 DEBUG https://atlantis.atlantisserver.com:443 "POST /api/plan HTTP/1.1" 500 169 2024-04-03 194041,846 INFO Atlantis plan request failed with status code: 500 2024-04-03 194041,846 INFO {"error":"failed to build command: creating new workspace: mkdir /home/atlantis/.atlantis/repos/data/infrastructure/terraform/0/default: no space left on device"} 2024-04-03 194041,848 DEBUG https://atlantis.atlantisserver.com:443 "POST /api/plan HTTP/1.1" 500 169 2024-04-03 194041,849 INFO Atlantis plan request failed with status code: 500
p
many plans in many PRs?
s
28 locks, 283 jobs, 6 MR
p
find / -name .terraform --print
but…6 MRs….
you should have only 6 of those dirs
s
hmmm, that's. it's in ECS =/
p
28 locks?
so 28 PRs then
so 28x`.terraform` dirs = many aws provider copies
s
well, when i call the plan from atlantis API, it doesn't really use an MR. it seems to use #0
p
how big is you HD?
s
pretty small let me check
p
can you just make it bigger?
I think I used like a 20GB disk in my setup
s
i could definitely make it bigger. question though. if i call the atlantis plan API 100 times, does it create 100 copies of the terraformr repo?
p
no, unless is a different PR number
s
i'm not specifying a PR number hmmm
so it seems to default to 0
p
it looks like since the api is using it then is this
/home/atlantis/.atlantis/repos/data/infrastructure/terraform/0/default:
s
yeah that seems like the one
i can try increasing disk size. was just confused why it was running out of space.
thanks pepe, let me know if anything crosses your mind.
p
I think there is a way in fargate to log in to the container now
maybe you can try that and see what is taking so much space
s
i'll try that. thanks again pepe for the fast response.
👍🏽 1
okay, i was able to get to the container shell. thanks for that 🙂 i had no idea that was possible.
i have 30gb of space. 12g used by mr 0 directory in the .atlantis..../terraform/0 folder
i find that each workspace inside 0 folder, has it's own copy of the git repo, as seen in .git folder.
there are currently 184 workspaces in 0/ directory
i need to calculate how many workspaces i have....
p
ohhh I see
you could potentially do a shallow clone too , there is an option for that
s
looks like i got 318 workspaces total in my atlantis file
oh shallow clone
So i'm using "merge". just thinking out loud, can anything go wrong here settting this to 1?
p
no, I think it will still work
s
thanks
r
You can try this pre workflow hook which has helped me a bunch https://github.com/runatlantis/atlantis/issues/3238#issuecomment-1869094337