Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrismathew05/autorun
Send jobs to a remote computer without having to set up a server
https://github.com/chrismathew05/autorun
google-drive remote-execution scripting
Last synced: about 1 month ago
JSON representation
Send jobs to a remote computer without having to set up a server
- Host: GitHub
- URL: https://github.com/chrismathew05/autorun
- Owner: chrismathew05
- License: mit
- Created: 2022-03-13T04:55:22.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-14T23:30:30.000Z (almost 3 years ago)
- Last Synced: 2023-08-12T18:41:56.529Z (over 1 year ago)
- Topics: google-drive, remote-execution, scripting
- Language: Python
- Homepage: https://chrismathew05-autorun.readthedocs.io/
- Size: 423 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Autorun
Autorun allows you to send jobs to a remote computer without having to set up a server (like a sane person would normally do). It works as follows (more details under [Usage](#usage)):
1. You create **Input** and **Output** folders on your Google Drive.
2. Users store input files in these **Input** folders
3. This script periodically checks these **Input** folders for files
4. If files are detected, the script downloads the files in the **Input** folder and searches for a script file named `run.sh`.
5. The script file is executed and output is uploaded to the **Output** folder on GDrive## Setup
1. Clone this repo: `git clone https://github.com/chrismathew05/autorun.git`
2. Create a Google Cloud Project on [GCP](https://console.cloud.google.com/).
3. Enable the [Google Drive API](https://console.cloud.google.com/apis/api/drive.googleapis.com) on your project.
4. Create Credentials > OAuth Client Id > Desktop App. You will be asked to configure an OAuth consent screen first.
5. Download credentials JSON file and rename to `credentials.json`. Drag into the `auth` folder.
6. Run the build script to set up the project:
- Linux: `./build.sh`. You will have to grant permission first (`chmod +x build.sh`)
- Windows: TODO
7. Configure the newly created `config.json` with the desired **Input** and **Output** folder ids from GDrive.
8. To ensure proper file conversions, you should uncheck automatic file conversion in your GDrive [settings](https://drive.google.com/drive/settings).![Drive Settings](docs/drive-settings.png)
## Usage
Usage is simple:
1. Create your python/matlab script, ensuring that somewhere in the script, output is saved to `../temp/output/`
2. Create a bash script named `run.sh`. This script should install necessary requirements, call the python/matlab script, and uninstall once complete. Example below:
```
#!/bin/bash# install required packages temporarily to venv
pip install -r temp/input/requirements-new.txt# run python file
python3 temp/input/test.py# uninstall packages
yes | pip uninstall -r temp/input/requirements-new.txt
```
3. Upload the above to your GDrive **Input** folder.
4. Run `autorun.sh`. Results should appear in your **Output** folder after execution.## Documentation
The documentation for this project can be found [here](https://chrismathew05-autorun.readthedocs.io/en/latest/?).## TODO
- Implement email notifications for when jobs finish processing
- Test with Matlab scripts