logo

Python πŸŽ₯

Execute scripts with Hoop connections

Allows executing one-off scripts using the underlying Operating System tools.

Configuration

shell
hoop admin create conn python3 -a <agent> -- python3

Connect It

Now it’s possible to execute python scripts straight from Hoop
shell
hoop exec python3 -i 'import os; print(os.environ)'
shell
hoop exec python3 <<EOF s3 = boto3.client('s3') response = s3.list_buckets() print('Existing buckets:') for bucket in response['Buckets']: print(f' {bucket["Name"]}') EOF
asumes the runtime has the boto3 dependency installed
Execute scripts directly
shell
hoop exec python3 -- /tmp/myscript.py

Interactive Session

shell
$ hoop connect python3 connection: python3 | session: ac8afefe-3d7b-46b1-b905-ed0a65a4b8dc Python 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>

Powered by Notaku