Skip to content

Commit

Permalink
Enforce GCE lifespan during instantiation
Browse files Browse the repository at this point in the history
FPF used to have a GCE instance culler tool:
 https://github.com/freedomofpress/container-gce-instance-culler
which was packed into a container and run as a cronjob ever other hour
on Codefresh. Instead of trying to maintain said tool and Codefresh
pipeline, define a lifespan during VM creation that GCP will enforce.
  • Loading branch information
leee committed Aug 15, 2024
1 parent bf83ffc commit 96c542b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion devops/gce-nested/gce-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function create_sd_ci_gce_instance() {
--subnet ci-subnet \
--boot-disk-type=pd-ssd \
--machine-type="${GCLOUD_MACHINE_TYPE}" \
--metadata "ssh-keys=${SSH_USER_NAME}:$(cat $SSH_PUBKEY)"
--metadata "ssh-keys=${SSH_USER_NAME}:$(cat $SSH_PUBKEY)" \
--instance-termination-action=DELETE \
--max-run-duration=3h

# Give box a few more seconds for SSH to become available
echo "Sleeping for 20s to wait for SSH to become available"
Expand Down

0 comments on commit 96c542b

Please sign in to comment.