-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improving docs and minor fixes (#760)
- Loading branch information
Showing
38 changed files
with
997 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
#!/bin/bash | ||
|
||
test $? -eq 0 || exit $? | ||
#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} | ||
|
||
#To export any variable | ||
#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out | ||
|
||
#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency | ||
|
||
function exit_if_error() { | ||
test $? -eq 0 || exit $? | ||
} | ||
|
||
function run() { | ||
echo "Running: " | ||
echo "$1" | ||
echo "" | ||
if [[ ${CM_FAKE_RUN} != 'yes' ]]; then | ||
eval $1 | ||
fi | ||
} | ||
|
||
#Add your run commands here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<details> | ||
<summary>Click here to see the table of contents.</summary> | ||
|
||
* [Description](#description) | ||
* [Information](#information) | ||
* [Usage](#usage) | ||
* [ CM installation](#cm-installation) | ||
* [ CM script automation help](#cm-script-automation-help) | ||
* [ CM CLI](#cm-cli) | ||
* [ CM Python API](#cm-python-api) | ||
* [ CM GUI](#cm-gui) | ||
* [ CM modular Docker container](#cm-modular-docker-container) | ||
* [Customization](#customization) | ||
* [ Variations](#variations) | ||
* [ Default environment](#default-environment) | ||
* [Script workflow, dependencies and native scripts](#script-workflow-dependencies-and-native-scripts) | ||
* [Script output](#script-output) | ||
* [New environment keys (filter)](#new-environment-keys-(filter)) | ||
* [New environment keys auto-detected from customize](#new-environment-keys-auto-detected-from-customize) | ||
* [Maintainers](#maintainers) | ||
|
||
</details> | ||
|
||
*Note that this README is automatically generated - don't edit! See [more info](README-extra.md).* | ||
|
||
### Description | ||
|
||
|
||
See [more info](README-extra.md). | ||
|
||
#### Information | ||
|
||
* CM GitHub repository: *[mlcommons@ck](https://github.com/mlcommons/ck/tree/master/cm-mlops)* | ||
* GitHub directory for this script: *[GitHub](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent)* | ||
* CM meta description for this script: *[_cm.json](_cm.json)* | ||
* CM "database" tags to find this script: *download,torrent,download-torrent* | ||
* Output cached?: *True* | ||
___ | ||
### Usage | ||
|
||
#### CM installation | ||
|
||
[Guide](https://github.com/mlcommons/ck/blob/master/docs/installation.md) | ||
|
||
##### CM pull repository | ||
|
||
```cm pull repo mlcommons@ck``` | ||
|
||
##### CM script automation help | ||
|
||
```cm run script --help``` | ||
|
||
#### CM CLI | ||
|
||
1. `cm run script --tags=download,torrent,download-torrent[,variations] ` | ||
|
||
2. `cm run script "download torrent download-torrent[,variations]" ` | ||
|
||
3. `cm run script 69b752c5618e45bb ` | ||
|
||
* `variations` can be seen [here](#variations) | ||
|
||
* `input_flags` can be seen [here](#script-flags-mapped-to-environment) | ||
|
||
#### CM Python API | ||
|
||
<details> | ||
<summary>Click here to expand this section.</summary> | ||
|
||
```python | ||
|
||
import cmind | ||
|
||
r = cmind.access({'action':'run' | ||
'automation':'script', | ||
'tags':'download,torrent,download-torrent' | ||
'out':'con', | ||
... | ||
(other input keys for this script) | ||
... | ||
}) | ||
|
||
if r['return']>0: | ||
print (r['error']) | ||
|
||
``` | ||
|
||
</details> | ||
|
||
|
||
#### CM GUI | ||
|
||
```cm run script --tags=gui --script="download,torrent,download-torrent"``` | ||
|
||
Use this [online GUI](https://cKnowledge.org/cm-gui/?tags=download,torrent,download-torrent) to generate CM CMD. | ||
|
||
#### CM modular Docker container | ||
|
||
*TBD* | ||
|
||
___ | ||
### Customization | ||
|
||
|
||
#### Variations | ||
|
||
* *No group (any variation can be selected)* | ||
<details> | ||
<summary>Click here to expand this section.</summary> | ||
|
||
* `_torrent.#` | ||
- Environment variables: | ||
- *CM_TORRENT_FILE*: `#` | ||
- Workflow: | ||
|
||
</details> | ||
|
||
#### Default environment | ||
|
||
<details> | ||
<summary>Click here to expand this section.</summary> | ||
|
||
These keys can be updated via `--env.KEY=VALUE` or `env` dictionary in `@input.json` or using script flags. | ||
|
||
|
||
</details> | ||
|
||
___ | ||
### Script workflow, dependencies and native scripts | ||
|
||
<details> | ||
<summary>Click here to expand this section.</summary> | ||
|
||
1. ***Read "deps" on other CM scripts from [meta](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/_cm.json)*** | ||
* get,generic-sys-util,_transmission | ||
- CM script: [get-generic-sys-util](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-generic-sys-util) | ||
1. ***Run "preprocess" function from [customize.py](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/customize.py)*** | ||
1. Read "prehook_deps" on other CM scripts from [meta](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/_cm.json) | ||
1. ***Run native script if exists*** | ||
* [run.sh](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/run.sh) | ||
1. Read "posthook_deps" on other CM scripts from [meta](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/_cm.json) | ||
1. ***Run "postrocess" function from [customize.py](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/customize.py)*** | ||
1. Read "post_deps" on other CM scripts from [meta](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/download-torrent/_cm.json) | ||
</details> | ||
|
||
___ | ||
### Script output | ||
#### New environment keys (filter) | ||
|
||
#### New environment keys auto-detected from customize | ||
|
||
___ | ||
### Maintainers | ||
|
||
* [Open MLCommons taskforce on automation and reproducibility](https://github.com/mlcommons/ck/blob/master/docs/taskforce.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"alias": "download-torrent", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"deps": [ | ||
{ | ||
"tags": "get,generic-sys-util,_transmission" | ||
} | ||
], | ||
"input_description": {}, | ||
"input_mapping": {}, | ||
"new_env_keys": [], | ||
"new_state_keys": [], | ||
"post_deps": [], | ||
"posthook_deps": [], | ||
"prehook_deps": [], | ||
"tags": [ | ||
"download", | ||
"torrent", | ||
"download-torrent" | ||
], | ||
"uid": "69b752c5618e45bb", | ||
"variations": { | ||
"torrent.#": { | ||
"env": { | ||
"CM_TORRENT_FILE": "#" | ||
} | ||
} | ||
}, | ||
"versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from cmind import utils | ||
import os | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
|
||
meta = i['meta'] | ||
|
||
automation = i['automation'] | ||
|
||
quiet = (env.get('CM_QUIET', False) == 'yes') | ||
|
||
return {'return':0} | ||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
return {'return':0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
transmission-daemon --download-dir ${PWD} | ||
transmission-remote --no-auth -a ${CM_TORRENT_FILE} | ||
test $? -eq 0 || exit $? | ||
transmission-remote -l | ||
test $? -eq 0 || exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.