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

IaC done two ways #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

IaC done two ways #2

wants to merge 2 commits into from

Conversation

hdahme
Copy link

@hdahme hdahme commented Nov 21, 2022

Here we

  • Move the mnemonic into a .env file so there's no accidental committing
  • Provide a GCP Cloud Run config so the script can be run in ~~the cloud on an hourly basis (a hack to get around the TTL limits of jobs)
  • Provide terraform config so the code can also be run on a GCE instance if hour-long cron isn't the right solution for your use case.

Testing

We're running both versions using these instructions

Future work

  • Maybe wrap the mnemonic in a secret for the Cloud Run config - but it will still be visible within the job itself, so the usefulness of this is limited
  • Publish the docker image of the bot
  • Run the published image on GCE via docker compose and a similar startup script
    • This would require finding (or publishing) a GCE machine image with docker installed. If you know of one, please let me know

@hdahme hdahme changed the title IaS done two ways IaC done two ways Jan 9, 2023
@bpiv400
Copy link

bpiv400 commented Jan 12, 2023

Could you open the future work notes as an issue?

Comment on lines 1 to 3
Cloudrun is if you want the easiest, lowest overhead way of running a bot. If you want more flexibility and customizability, check out the `terraform` config.

Since a job times out after a maximum of 1 hour, we get around that by scheduling this job to run every hour, at minute 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the pre-reqs? Looks like we need to gcloud cli installed? An account logged in as well?

Let's list them explicitly

@@ -0,0 +1,72 @@
If you want to use a persistent GCE instance to manage your bot, use this config. A persistent GCE instance offers more flexibility in line with more overhead, say if you want to run sidecar services and so on. Use the cloudrun config if you're just looking for the quick and dirty.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again pre-reqs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants