This repository provides a sample Action for the Roboto platform, designed to read a log file and append a tag to a dataset upon detecting a specific string within the log file.
Ensure you have Docker installed:
Follow these steps to get the Action set up:
-
Clone the Repository
Clone the repository using the command below:
git clone https://github.com/roboto-ai/robologs-example-action.git
-
Execute the Action Locally
Navigate to the project directory and execute the following commands:
cd robologs-example-action/tag_dataset/ # Build the Docker image ./scripts/build.sh # Run the Action ./scripts/run.sh $PWD/input/
A JSON file will be generated in the
output
directory with this structure:{ "put_tags": ["error"], "remove_tags": [], "put_fields": {}, "remove_fields": [] }
-
Deploy the Action to the Roboto Platform
Ensure your Roboto Platform account is set up and the CLI is installed:
Deploy the action using:
./scripts/setup.sh ./scripts/deploy.sh
-
Utilize the CLI to Execute the Action on a Dataset
Create a dataset and retrieve the dataset ID:
roboto datasets create
With the dataset ID, proceed with the following steps:
# Upload a sample log file roboto datasets upload-files -d <dataset_id> -p $PWD/input/log.txt # Run the Action roboto actions invoke tag_dataset --dataset-id <dataset_id> --input-data log.txt
Retrieve the invocation ID from the output. You can check the invocation status with:
roboto invocations status <invocation_id> --tail
Upon completion, verify the
error
tag addition:roboto datasets show --dataset-id <dataset_id>
The output should include:
{ "org_id": "your_org_id", "dataset_id": "some_dataset_id", "tags": ["error"] }
Confirm the tag presence via the Roboto Platform UI:
Feel free to suggest improvements or report issues. Your feedback is valuable in improving Actions for Roboto users.
Happy Coding!