atlantis: gcp: cloudrun: data dir flag fails on existing directory
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave β+1β or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
Iβm trying to set the environment variable ATLANTIS_DATA_DIR to a /mnt/gcs
When atlantis server is invoked, a cache dir and bin dir is supposed to be created, but this fails:
Error: initializing server: unable to create dir "/mnt/gcs/bin": mkdir /mnt/gcs: file exists
Reproduction Steps
- Create a dir:
/mnt/gcs - Set an environment variable:
ATLANTIS_DATA_DIRto/mnt/gcs - Initiate atlantis server
Logs
Error: initializing server: unable to create dir "/mnt/gcs/bin": mkdir /mnt/gcs: file exists
Environment details
Deploying to Cloud Run, using gcsfuse to mount a Cloud Storage Bucket.
Additional Context
Before the docker-entrypoint.sh is ran I run the following:
# Create mount directory for service
mkdir -p $MNT_DIR
echo "Mounting GCS Fuse."
gcsfuse --debug_gcs --debug_fuse $BUCKET $MNT_DIR
echo "Mounting completed."
It seems like that Atlantis trips over that the data dir is already created.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 24 (19 by maintainers)
@kamilkrampa @bschaatsbergen making atlantis stateless is probably the correct way to go. I do not think there is a way to store the plan in an external storage (database or s3 bucket or similar) but that would be a great feature request.
If the clone isnβt working, Iβm unsure how that can be done in a stateless way unless we used a server + agent model.
related issue https://stackoverflow.com/questions/74913423/error-chmod-on-config-lock-failed-operation-not-permitted
Seems like youβre very close with the network storage.
Here are some related links
Related links
cc @ademariag @gaahrdner