Execute scripts with Hoop connections
Allows executing one-off scripts using the underlying Operating System tools.
Connection Command
plain textpython3
:::info note This mode requires the agent running on top of a Linux that has the python3 runtime. :::
How to Use
Now itβs possible to execute python scripts straight from Hoop
plain texthoop exec python3-prod -i 'import os; print(os.environ)' # asumming the runtime has the boto3 dependency installed hoop exec python3-prod <<EOF s3 = boto3.client('s3') response = s3.list_buckets() print('Existing buckets:') for bucket in response['Buckets']: print(f' {bucket["Name"]}') EOF
Itβs possible to start an interactive session with pyhon
plain texthoop connect python3-prod
Calling scripts are easy too
plain texthoop exec python3-prod -- /tmp/myscript.py