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

Running on Saturn Cloud #28

Open
djdarlo opened this issue Feb 14, 2025 · 7 comments
Open

Running on Saturn Cloud #28

djdarlo opened this issue Feb 14, 2025 · 7 comments

Comments

@djdarlo
Copy link

djdarlo commented Feb 14, 2025

Does anyone know if this is possible to run on Saturn Cloud - I was thinking for people without RPIs, this would be a neat solution.

https://app.community.saturnenterprise.io/auth/login

They offer servers with Python images.

Image

@danmed
Copy link
Contributor

danmed commented Feb 14, 2025

Seems like a very expensive service.. a $1 vps from racknerd would handle it with ease..

@djdarlo
Copy link
Author

djdarlo commented Feb 14, 2025 via email

@joeShuff
Copy link
Contributor

There is a github action that you can have running for you, which is essentially free hosting.

It's the .github/workflows/daily.yml.disabled file.

If you fork this repo, then remove the .disabled from the filename you can run it in your own fork I believe. Unfortunately that will involve some git knowledge and github for setting up the action.

@eelmafia
Copy link
Owner

@djdarlo Are you not able to git clone the repository on the server? After that you just need to follow tutorials on how to install docker and docker compose and just use the command from the README.

@djdarlo
Copy link
Author

djdarlo commented Feb 14, 2025

Thank you. I think I've got it running now on a VM in GCP. I have populated the config file then tried running using the below command.

sudo docker run -d --name MinMaxOctopusBot eelmafia/octopus-minmax-bot

I'm not getting any output though.

Here's my config file....

services:
minmax_octopus_bot:
container_name: MinMaxOctopusBot
image: eelmafia/octopus-minmax-bot
restart: unless-stopped
environment:
- ACC_NUMBER=A-AEXXXXXXXX
- API_KEY=sk_live_XXXXXXXX
- OCTOPUS_LOGIN_EMAIL=[email protected]
- OCTOPUS_LOGIN_PASSWD=XXXXXX
- DISCORD_WEBHOOK=https://discord.com/api/webhooks/XXXXXXX
- ONE_OFF=true
- DRY_RUN=true
- PYTHONUNBUFFERED=1

Am I missing anything?

@adegartland
Copy link

I'm new to docker so take what I'm saying with a pinch of salt.

I think you've used the docker-compose config, but not use docker-compose to start, so you're effectively running with no config

You might have crud running forever in a container so to remove that do:

sudo docker container ls
then if you still see the old stuff running then
sudo docker stop MinMaxOctopusBot
sudo docker container prune

This is what I have for foreground dry run...

create a file env.sh:
----8<-----
#!/bin/s

Add your stuff here

export API_KEY=sk_live_xxxxxxxx

Your Octopus Energy account number. Starts with A-

export ACC_NUMBER=A-xxxxxxxx

export DISCORD_WEBHOOK=https://discord.com/api/webhooks/xxxxxx

export OCTOPUS_LOGIN_EMAIL=xxxxx
export OCTOPUS_LOGIN_PASSWD=xxxx

Whether to just run immediately and exit

export ONE_OFF=True

Don't actually make the switch, just show the prices

export DRY_RUN=True
-----------8<-----------------

create a file: run_docker_fg.sh
----8<-----
#!/bin/sh
. ./env.sh

docker run --rm --init
--name MinMaxOctopusBot
-e ACC_NUMBER="$ACC_NUMBER"
-e API_KEY="$API_KEY"
-e OCTOPUS_LOGIN_EMAIL="$OCTOPUS_LOGIN_EMAIL"
-e OCTOPUS_LOGIN_PASSWD="$OCTOPUS_LOGIN_PASSWD"
-e EXECUTION_TIME="23:00"
-e DRY_RUN="$DRY_RUN"
-e ONE_OFF="$ONE_OFF"
-e PYTHONUNBUFFERED=1
octopus-minmax-bot
----8<-----
chmod 755 run_docker_fg.sh
sudo ./run_docker_fg.sh

You could just get rid of the env.sh if you like and have it all the the same file, but I share the same config with background running variants...

Note, the "docker run" args are different. "--rm" auto prunes (so you can run the command immediately again) "--init" attaches an init process which so signal handling works better, "-d" is removed as you want to run it in the foreground, not as a daemon

@djdarlo
Copy link
Author

djdarlo commented Feb 15, 2025 via email

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

No branches or pull requests

5 participants